Clean up .configured flag handling to work with an external identity keypair (#4579)
automerge
This commit is contained in:
parent
194491ae96
commit
1c765124e7
|
@ -119,7 +119,8 @@ $ solana-gossip --entrypoint testnet.solana.com:8001 spy
|
||||||
|
|
||||||
Now configure a key pair for your validator by running:
|
Now configure a key pair for your validator by running:
|
||||||
```bash
|
```bash
|
||||||
$ solana-keygen -o validator-keypair.json
|
$ solana-keygen -o ~/validator-keypair.json
|
||||||
|
$ solana-keygen pubkey ~/validator-keypair.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Then use one of the following commands, depending on your installation
|
Then use one of the following commands, depending on your installation
|
||||||
|
@ -128,20 +129,20 @@ choice, to start the node:
|
||||||
If this is a `solana-install`-installation:
|
If this is a `solana-install`-installation:
|
||||||
```bash
|
```bash
|
||||||
$ clear-config.sh
|
$ clear-config.sh
|
||||||
$ validator.sh --identity validator-keypair.json --poll-for-new-genesis-block testnet.solana.com
|
$ validator.sh --identity ~/validator-keypair.json --poll-for-new-genesis-block testnet.solana.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, the `solana-install run` command can be used to run the validator
|
Alternatively, the `solana-install run` command can be used to run the validator
|
||||||
node while periodically checking for and applying software updates:
|
node while periodically checking for and applying software updates:
|
||||||
```bash
|
```bash
|
||||||
$ clear-config.sh
|
$ clear-config.sh
|
||||||
$ solana-install run validator.sh -- --identity validator-keypair.json --poll-for-new-genesis-block testnet.solana.com
|
$ solana-install run validator.sh -- --identity ~/validator-keypair.json --poll-for-new-genesis-block testnet.solana.com
|
||||||
```
|
```
|
||||||
|
|
||||||
If you built from source:
|
If you built from source:
|
||||||
```bash
|
```bash
|
||||||
$ USE_INSTALL=1 ./multinode-demo/clear-config.sh
|
$ USE_INSTALL=1 ./multinode-demo/clear-config.sh
|
||||||
$ USE_INSTALL=1 ./multinode-demo/validator.sh --identity validator-keypair.json --poll-for-new-genesis-block testnet.solana.com
|
$ USE_INSTALL=1 ./multinode-demo/validator.sh --identity ~/validator-keypair.json --poll-for-new-genesis-block testnet.solana.com
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Controlling local network port allocation
|
#### Controlling local network port allocation
|
||||||
|
@ -164,7 +165,7 @@ accounts: ...
|
||||||
|
|
||||||
The **identity pubkey** for your validator can also be found by running:
|
The **identity pubkey** for your validator can also be found by running:
|
||||||
```bash
|
```bash
|
||||||
$ solana-keygen pubkey validator-keypair.json
|
$ solana-keygen pubkey ~/validator-keypair.json
|
||||||
```
|
```
|
||||||
|
|
||||||
From another console, confirm the IP address and **identity 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
|
||||||
|
|
|
@ -94,7 +94,7 @@ setup_validator_accounts() {
|
||||||
declare storage_pubkey
|
declare storage_pubkey
|
||||||
storage_pubkey=$($solana_keygen pubkey "$storage_keypair_path")
|
storage_pubkey=$($solana_keygen pubkey "$storage_keypair_path")
|
||||||
|
|
||||||
if [[ -f "$node_keypair_path".configured ]]; then
|
if [[ -f $configured_flag ]]; then
|
||||||
echo "Vote and stake accounts have already been configured"
|
echo "Vote and stake accounts have already been configured"
|
||||||
else
|
else
|
||||||
# Fund the node with enough tokens to fund its Vote, Staking, and Storage accounts
|
# Fund the node with enough tokens to fund its Vote, Staking, and Storage accounts
|
||||||
|
@ -118,7 +118,7 @@ setup_validator_accounts() {
|
||||||
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
create-validator-storage-account "$node_pubkey" "$storage_pubkey" || return $?
|
create-validator-storage-account "$node_pubkey" "$storage_pubkey" || return $?
|
||||||
|
|
||||||
touch "$node_keypair_path".configured
|
touch "$configured_flag"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
|
@ -146,7 +146,7 @@ setup_replicator_account() {
|
||||||
declare storage_pubkey
|
declare storage_pubkey
|
||||||
storage_pubkey=$($solana_keygen pubkey "$storage_keypair_path")
|
storage_pubkey=$($solana_keygen pubkey "$storage_keypair_path")
|
||||||
|
|
||||||
if [[ -f "$node_keypair_path".configured ]]; then
|
if [[ -f $configured_flag ]]; then
|
||||||
echo "Replicator account has already been configured"
|
echo "Replicator account has already been configured"
|
||||||
else
|
else
|
||||||
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" airdrop "$node_lamports" || return $?
|
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" airdrop "$node_lamports" || return $?
|
||||||
|
@ -155,7 +155,7 @@ setup_replicator_account() {
|
||||||
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
create-replicator-storage-account "$node_pubkey" "$storage_pubkey" || return $?
|
create-replicator-storage-account "$node_pubkey" "$storage_pubkey" || return $?
|
||||||
|
|
||||||
touch "$node_keypair_path".configured
|
touch "$configured_flag"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" \
|
$solana_wallet --keypair "$node_keypair_path" --url "http://$entrypoint_ip:8899" \
|
||||||
|
@ -257,6 +257,7 @@ if [[ $node_type = replicator ]]; then
|
||||||
: "${identity_keypair_path:=$SOLANA_CONFIG_DIR/replicator-keypair$label.json}"
|
: "${identity_keypair_path:=$SOLANA_CONFIG_DIR/replicator-keypair$label.json}"
|
||||||
storage_keypair_path="$SOLANA_CONFIG_DIR"/replicator-storage-keypair$label.json
|
storage_keypair_path="$SOLANA_CONFIG_DIR"/replicator-storage-keypair$label.json
|
||||||
ledger_config_dir=$SOLANA_CONFIG_DIR/replicator-ledger$label
|
ledger_config_dir=$SOLANA_CONFIG_DIR/replicator-ledger$label
|
||||||
|
configured_flag=$SOLANA_CONFIG_DIR/replicator$label.configured
|
||||||
|
|
||||||
mkdir -p "$SOLANA_CONFIG_DIR"
|
mkdir -p "$SOLANA_CONFIG_DIR"
|
||||||
[[ -r "$identity_keypair_path" ]] || $solana_keygen -o "$identity_keypair_path"
|
[[ -r "$identity_keypair_path" ]] || $solana_keygen -o "$identity_keypair_path"
|
||||||
|
@ -294,6 +295,7 @@ elif [[ $node_type = bootstrap_leader ]]; then
|
||||||
ledger_config_dir="$SOLANA_CONFIG_DIR"/bootstrap-leader-ledger
|
ledger_config_dir="$SOLANA_CONFIG_DIR"/bootstrap-leader-ledger
|
||||||
accounts_config_dir="$SOLANA_CONFIG_DIR"/bootstrap-leader-accounts
|
accounts_config_dir="$SOLANA_CONFIG_DIR"/bootstrap-leader-accounts
|
||||||
storage_keypair_path=$SOLANA_CONFIG_DIR/bootstrap-leader-storage-keypair.json
|
storage_keypair_path=$SOLANA_CONFIG_DIR/bootstrap-leader-storage-keypair.json
|
||||||
|
configured_flag=$SOLANA_CONFIG_DIR/bootstrap-leader.configured
|
||||||
|
|
||||||
default_arg --rpc-port 8899
|
default_arg --rpc-port 8899
|
||||||
default_arg --rpc-drone-address 127.0.0.1:9900
|
default_arg --rpc-drone-address 127.0.0.1:9900
|
||||||
|
@ -313,6 +315,7 @@ elif [[ $node_type = validator ]]; then
|
||||||
storage_keypair_path=$SOLANA_CONFIG_DIR/validator-storage-keypair$label.json
|
storage_keypair_path=$SOLANA_CONFIG_DIR/validator-storage-keypair$label.json
|
||||||
ledger_config_dir=$SOLANA_CONFIG_DIR/validator-ledger$label
|
ledger_config_dir=$SOLANA_CONFIG_DIR/validator-ledger$label
|
||||||
accounts_config_dir=$SOLANA_CONFIG_DIR/validator-accounts$label
|
accounts_config_dir=$SOLANA_CONFIG_DIR/validator-accounts$label
|
||||||
|
configured_flag=$SOLANA_CONFIG_DIR/validator$label.configured
|
||||||
|
|
||||||
mkdir -p "$SOLANA_CONFIG_DIR"
|
mkdir -p "$SOLANA_CONFIG_DIR"
|
||||||
[[ -r "$identity_keypair_path" ]] || $solana_keygen -o "$identity_keypair_path"
|
[[ -r "$identity_keypair_path" ]] || $solana_keygen -o "$identity_keypair_path"
|
||||||
|
@ -383,8 +386,7 @@ while true; do
|
||||||
# keypair for the node and start all over again
|
# keypair for the node and start all over again
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
rm -rf "$ledger_config_dir" "$accounts_config_dir" \
|
rm -rf "$ledger_config_dir" "$accounts_config_dir" "$configured_flag"
|
||||||
"$vote_keypair_path".configured "$storage_keypair_path".configured
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue