#!/usr/bin/env bash # # Start a fullnode # here=$(dirname "$0") # shellcheck source=multinode-demo/common.sh source "$here"/common.sh # shellcheck source=scripts/oom-score-adj.sh source "$here"/../scripts/oom-score-adj.sh fullnode_usage() { if [[ -n $1 ]]; then echo "$*" echo fi cat </dev/null 2>&1 } set -e PS4="$(basename "$0"): " pid= kill_fullnode() { if [[ -n $pid ]]; then declare _pid=$pid pid= echo "killing pid $_pid" kill "$_pid" || true wait "$_pid" || true echo "$_pid killed" fi } trap 'kill_fullnode' INT TERM ERR while true; do if [[ $node_type != bootstrap_leader ]] && new_gensis_block; then # If the genesis block has changed remove the now stale ledger and # vote/stake/storage keypairs for the node and start all over again ( set -x rm -rf "$ledger_config_dir" "$state_dir" "$configured_flag" ) if [[ $node_type = validator ]]; then $solana_keygen new -f -o "$vote_keypair_path" $solana_keygen new -f -o "$stake_keypair_path" $solana_keygen new -f -o "$storage_keypair_path" fi if [[ $node_type = replicator ]]; then $solana_keygen new -f -o "$storage_keypair_path" fi fi if [[ $node_type = replicator ]]; then storage_pubkey=$($solana_keygen pubkey "$storage_keypair_path") setup_replicator_account "${entrypoint_address%:*}" \ "$node_lamports" cat <