Only add --mining-pool arg when a mining pool keypair exists

This commit is contained in:
Michael Vines 2019-06-17 15:30:07 -07:00
parent 0ff9c4cd8e
commit b44d8c394e
1 changed files with 6 additions and 3 deletions

View File

@ -273,8 +273,6 @@ if [[ $node_type = replicator ]]; then
storage_keypair_path="$SOLANA_CONFIG_DIR"/replicator-storage-keypair$label.json
ledger_config_dir=$SOLANA_CONFIG_DIR/replicator-ledger$label
configured_flag=$SOLANA_CONFIG_DIR/replicator$label.configured
storage_mining_pool_keypair_path="$SOLANA_CONFIG_DIR"/storage-mining-pool-keypair.json
storage_mining_pool_pubkey=$($solana_keygen pubkey "$storage_mining_pool_keypair_path")
mkdir -p "$SOLANA_CONFIG_DIR"
[[ -r "$identity_keypair_path" ]] || $solana_keygen new -o "$identity_keypair_path"
@ -295,7 +293,12 @@ EOF
default_arg --identity "$identity_keypair_path"
default_arg --storage-keypair "$storage_keypair_path"
default_arg --ledger "$ledger_config_dir"
default_arg --mining-pool "$storage_mining_pool_pubkey"
storage_mining_pool_keypair_path="$SOLANA_CONFIG_DIR"/storage-mining-pool-keypair.json
if [[ -r $storage_mining_pool_keypair_path ]]; then
storage_mining_pool_pubkey=$($solana_keygen pubkey "$storage_mining_pool_keypair_path")
default_arg --mining-pool "$storage_mining_pool_pubkey"
fi
rsync_entrypoint_url=$(rsync_url "$entrypoint")
elif [[ $node_type = bootstrap_leader ]]; then