From bd1e989b11cd47d952676a377e9281c821cdea6a Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 9 May 2019 07:51:45 -0700 Subject: [PATCH] The fullnode identity keypair can now be provided via --identity (#4228) automerge --- book/src/testnet-participation.md | 49 ++++++++++++++++----------- multinode-demo/extra-fullnode-args.sh | 5 +++ multinode-demo/fullnode.sh | 9 ++--- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/book/src/testnet-participation.md b/book/src/testnet-participation.md index 3fbe4aa736..84cd7a10d6 100644 --- a/book/src/testnet-participation.md +++ b/book/src/testnet-participation.md @@ -104,25 +104,31 @@ $ solana-gossip --network testnet.solana.com:8001 spy # Press ^C to exit ``` -Then the following command will start a new validator node. +Now configure a key pair for your validator by running: +```bash +$ solana-keygen -o fullnode-keypair.json +``` + +Then use one of the following commands, depending on your installation +choice, to start the node: If this is a `solana-install`-installation: ```bash $ clear-fullnode-config.sh -$ fullnode.sh --poll-for-new-genesis-block testnet.solana.com +$ fullnode.sh --identity fullnode-keypair.json --poll-for-new-genesis-block testnet.solana.com ``` Alternatively, the `solana-install run` command can be used to run the validator node while periodically checking for and applying software updates: ```bash $ clear-fullnode-config.sh -$ solana-install run fullnode.sh -- --poll-for-new-genesis-block testnet.solana.com +$ solana-install run fullnode.sh -- --identity fullnode-keypair.json --poll-for-new-genesis-block testnet.solana.com ``` If you built from source: ```bash $ USE_INSTALL=1 ./multinode-demo/clear-fullnode-config.sh -$ USE_INSTALL=1 ./multinode-demo/fullnode.sh --poll-for-new-genesis-block testnet.solana.com +$ USE_INSTALL=1 ./multinode-demo/fullnode.sh --identity fullnode-keypair.json --poll-for-new-genesis-block testnet.solana.com ``` #### Controlling local network port allocation @@ -132,35 +138,40 @@ example, `fullnode.sh --dynamic-port-range 11000-11010 ...` will restrict the validator to ports 11000-11011. ### Validator Monitoring +When `fullnode.sh` starts, it will output a fullnode configuration that looks +similar to: +```bash +======================[ Fullnode configuration ]====================== +node pubkey: 4ceWXsL3UJvn7NYZiRkw7NsryMpviaKBDYr8GK7J61Dm +vote pubkey: 2ozWvfaXQd1X6uKh8jERoRGApDqSqcEy6fF1oN13LL2G +ledger: ... +accounts: ... +====================================================================== +``` + +The **node pubkey** for your validator can also be found by running: +```bash +$ solana-keygen pubkey fullnode-keypair.json +``` + From another console, confirm the IP address of your validator is visible in the gossip network by running: ```bash $ solana-gossip --network testnet.solana.com:8001 spy ``` -When `fullnode.sh` starts, it will output a fullnode configuration that looks -similar to: -```bash -======================[ Fullnode configuration ]====================== -node id: 4ceWXsL3UJvn7NYZiRkw7NsryMpviaKBDYr8GK7J61Dm -vote id: 2ozWvfaXQd1X6uKh8jERoRGApDqSqcEy6fF1oN13LL2G -ledger: ... -accounts: ... -====================================================================== -``` - -Provide the **vote id** pubkey to the `solana-wallet show-vote-account` command to view +Provide the **vote pubkey** to the `solana-wallet show-vote-account` command to view the recent voting activity from your validator: ```bash $ solana-wallet -n testnet.solana.com show-vote-account 2ozWvfaXQd1X6uKh8jERoRGApDqSqcEy6fF1oN13LL2G ``` -The vote id for the validator can also be found by running: +The vote pubkey for the validator can also be found by running: ```bash # If this is a `solana-install`-installation run: -$ solana-keygen pubkey ~/.local/share/solana/install/active_release/config-local/fullnode-vote-id.json +$ solana-keygen pubkey ~/.local/share/solana/install/active_release/config-local/fullnode-vote-keypair.json # Otherwise run: -$ solana-keygen pubkey ./config-local/fullnode-vote-id.json +$ solana-keygen pubkey ./config-local/fullnode-vote-keypair.json ``` ### Sharing Metrics From Your Validator diff --git a/multinode-demo/extra-fullnode-args.sh b/multinode-demo/extra-fullnode-args.sh index 549da4712a..8c074da674 100644 --- a/multinode-demo/extra-fullnode-args.sh +++ b/multinode-demo/extra-fullnode-args.sh @@ -16,6 +16,7 @@ extra_fullnode_args=() stake=43 # number of lamports to assign as stake (plus transaction fee to setup the stake) poll_for_new_genesis_block=0 label= +fullnode_id_path= while [[ ${1:0:1} = - ]]; do if [[ $1 = --label ]]; then @@ -28,6 +29,10 @@ while [[ ${1:0:1} = - ]]; do stake=0 extra_fullnode_args+=("$1" "$2") shift 2 + elif [[ $1 = --identity ]]; then + fullnode_id_path=$2 + args+=("$1" "$2") + shift 2 elif [[ $1 = --enable-rpc-exit ]]; then extra_fullnode_args+=("$1") shift diff --git a/multinode-demo/fullnode.sh b/multinode-demo/fullnode.sh index 9d88ca52ef..6a384303fe 100755 --- a/multinode-demo/fullnode.sh +++ b/multinode-demo/fullnode.sh @@ -9,6 +9,7 @@ source "$here"/common.sh # shellcheck source=scripts/oom-score-adj.sh source "$here"/../scripts/oom-score-adj.sh + # shellcheck source=multinode-demo/extra-fullnode-args.sh source "$here"/extra-fullnode-args.sh @@ -41,8 +42,8 @@ else program=$solana_fullnode fi -fullnode_id_path=$SOLANA_CONFIG_DIR/fullnode-id$label.json -fullnode_vote_id_path=$SOLANA_CONFIG_DIR/fullnode-vote-id$label.json +: "${fullnode_id_path:=$SOLANA_CONFIG_DIR/fullnode-keypair$label.json}" +fullnode_vote_id_path=$SOLANA_CONFIG_DIR/fullnode-vote-keypair$label.json ledger_config_dir=$SOLANA_CONFIG_DIR/fullnode-ledger$label accounts_config_dir=$SOLANA_CONFIG_DIR/fullnode-accounts$label @@ -55,8 +56,8 @@ fullnode_vote_id=$($solana_keygen pubkey "$fullnode_vote_id_path") cat <