From 2e251ccc5ccf428e0d7f81afd6c2d46aac83cbc6 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 24 May 2019 04:31:39 -0700 Subject: [PATCH] De-fullnode variable names (#4420) --- book/src/testnet-participation.md | 10 +- ci/localnet-sanity.sh | 2 +- multinode-demo/fullnode.sh | 179 +++++++++++++++--------------- 3 files changed, 96 insertions(+), 95 deletions(-) diff --git a/book/src/testnet-participation.md b/book/src/testnet-participation.md index 147f92d77..65298ddf3 100644 --- a/book/src/testnet-participation.md +++ b/book/src/testnet-participation.md @@ -154,20 +154,20 @@ validator to ports 11000-11011. When `validator.sh` starts, it will output a validator configuration that looks similar to: ```bash -======================[ Validator configuration ]====================== -node pubkey: 4ceWXsL3UJvn7NYZiRkw7NsryMpviaKBDYr8GK7J61Dm +======================[ validator configuration ]====================== +identity pubkey: 4ceWXsL3UJvn7NYZiRkw7NsryMpviaKBDYr8GK7J61Dm vote pubkey: 2ozWvfaXQd1X6uKh8jERoRGApDqSqcEy6fF1oN13LL2G ledger: ... accounts: ... ====================================================================== ``` -The **node pubkey** for your validator can also be found by running: +The **identity pubkey** for your validator can also be found by running: ```bash $ solana-keygen pubkey validator-keypair.json ``` -From another console, confirm the IP address and **node pubkey** of your validator is visible in the +From another console, confirm the IP address and **identity pubkey** of your validator is visible in the gossip network by running: ```bash $ solana-gossip --entrypoint testnet.solana.com:8001 spy @@ -190,7 +190,7 @@ $ solana-keygen pubkey ./config-local/validator-vote-keypair.json ### Sharing Metrics From Your Validator If you have obtained a metrics username/password from the Solana maintainers to help us monitor the health of the testnet, please perform the following steps -before starting the validator node to activate metrics reporting: +before starting the validator to activate metrics reporting: ```bash export u="username obtained from the Solana maintainers" export p="password obtained from the Solana maintainers" diff --git a/ci/localnet-sanity.sh b/ci/localnet-sanity.sh index 1be0bee85..c188e0dd7 100755 --- a/ci/localnet-sanity.sh +++ b/ci/localnet-sanity.sh @@ -256,7 +256,7 @@ rollingNodeRestart() { } verifyLedger() { - for ledger in bootstrap-leader fullnode; do + for ledger in bootstrap-leader validator; do echo "--- $ledger ledger verification" ( source multinode-demo/common.sh diff --git a/multinode-demo/fullnode.sh b/multinode-demo/fullnode.sh index 110461675..6b277d436 100755 --- a/multinode-demo/fullnode.sh +++ b/multinode-demo/fullnode.sh @@ -23,8 +23,8 @@ Start a validator or a replicator --blockstream PATH - open blockstream at this unix domain socket location --init-complete-file FILE - create this file, if it doesn't already exist, once node initialization is complete - --label LABEL - Append the given label to the fullnode configuration files, useful when running - multiple fullnodes from the same filesystem location + --label LABEL - Append the given label to the configuration files, useful when running + multiple fullnodes in the same workspace --stake LAMPORTS - Number of lamports to stake --no-voting - start node without vote signer --rpc-port port - custom RPC port for this node @@ -129,13 +129,6 @@ setup_validator_accounts() { return 0 } -ledger_not_setup() { - echo "Error: $*" - echo - echo "Please run: ${here}/setup.sh" - exit 1 -} - setup_replicator_account() { declare entrypoint_ip=$1 declare node_keypair_path=$2 @@ -163,12 +156,19 @@ setup_replicator_account() { return 0 } +ledger_not_setup() { + echo "Error: $*" + echo + echo "Please run: ${here}/setup.sh" + exit 1 +} + args=() node_type=validator stake=42 # number of lamports to assign as stake poll_for_new_genesis_block=0 label= -fullnode_keypair_path= +identity_keypair_path= no_restart=0 positional_args=() @@ -197,7 +197,7 @@ while [[ -n $1 ]]; do args+=("$1" "$2") shift 2 elif [[ $1 = --identity ]]; then - fullnode_keypair_path=$2 + identity_keypair_path=$2 args+=("$1" "$2") shift 2 elif [[ $1 = --enable-rpc-exit ]]; then @@ -236,7 +236,40 @@ while [[ -n $1 ]]; do fi done -if [[ $node_type = bootstrap_leader ]]; then + +if [[ $node_type = replicator ]]; then + if [[ ${#positional_args[@]} -gt 2 ]]; then + fullnode_usage "$@" + fi + + read -r entrypoint entrypoint_address shift < <(find_entrypoint "${positional_args[@]}") + shift "$shift" + + : "${identity_keypair_path:=$SOLANA_CONFIG_DIR/replicator-keypair$label.json}" + storage_keypair_path="$SOLANA_CONFIG_DIR"/replicator-storage-keypair$label.json + ledger_config_dir=$SOLANA_CONFIG_DIR/replicator-ledger$label + + mkdir -p "$SOLANA_CONFIG_DIR" + [[ -r "$identity_keypair_path" ]] || $solana_keygen -o "$identity_keypair_path" + [[ -r "$storage_keypair_path" ]] || $solana_keygen -o "$storage_keypair_path" + + identity_pubkey=$($solana_keygen pubkey "$identity_keypair_path") + storage_pubkey=$($solana_keygen pubkey "$storage_keypair_path") + + cat </dev/null 2>&1 && wait "$pid"' INT TERM ERR - if [[ $node_type = validator ]] && ((stake)); then - setup_validator_accounts "${entrypoint_address%:*}" \ - "$fullnode_keypair_path" \ - "$fullnode_vote_keypair_path" \ - "$fullnode_stake_keypair_path" \ - "$fullnode_storage_keypair_path" \ - "$stake" - elif [[ $node_type = replicator ]] && ((stake)); then - setup_replicator_account "${entrypoint_address%:*}" \ - "$replicator_keypair_path" \ - "$replicator_storage_keypair_path" \ - "$stake" + if ((stake)); then + if [[ $node_type = validator ]]; then + setup_validator_accounts "${entrypoint_address%:*}" \ + "$identity_keypair_path" \ + "$vote_keypair_path" \ + "$stake_keypair_path" \ + "$storage_keypair_path" \ + "$stake" + elif [[ $node_type = replicator ]]; then + setup_replicator_account "${entrypoint_address%:*}" \ + "$identity_keypair_path" \ + "$storage_keypair_path" \ + "$stake" + fi fi echo "$PS4$program ${args[*]}"