debash: Add solana-gossip get-rpc-url command to avoid hard coding (#5513)

This commit is contained in:
Michael Vines
2019-08-13 10:49:48 -07:00
committed by GitHub
parent 97d57d168b
commit 08f6a2ea3e
5 changed files with 67 additions and 36 deletions

View File

@ -56,7 +56,7 @@ done
: "${storage_keypair:="$SOLANA_ROOT"/farf/replicator-storage-keypair"$label".json}"
ledger="$SOLANA_ROOT"/farf/replicator-ledger"$label"
rpc_url=$("$here"/rpc-url.sh "$entrypoint")
rpc_url=$($solana_gossip get-rpc-url --entrypoint "$entrypoint")
if [[ ! -r $identity_keypair ]]; then
$solana_keygen new -o "$identity_keypair"

View File

@ -1,14 +0,0 @@
#!/usr/bin/env bash
#
# Given a gossip entrypoint derive the entrypoint's RPC address
#
entrypoint_address=$1
if [[ -z $entrypoint_address ]]; then
echo "Error: entrypoint address not specified" >&2
exit 1
fi
# TODO: Rather than hard coding, add a `solana-gossip rpc-address` command that
# actually asks the entrypoint itself for its RPC address
echo "http://${entrypoint_address%:*}:8899"

View File

@ -175,7 +175,7 @@ else
gossip_entrypoint="$entrypoint_hostname":8001
fi
fi
rpc_url=$("$here"/rpc-url.sh "$gossip_entrypoint")
drone_address="${gossip_entrypoint%:*}":9900
: "${identity_keypair_path:=$ledger_dir/identity-keypair.json}"
@ -291,6 +291,7 @@ setup_validator_accounts() {
}
while true; do
rpc_url=$($solana_gossip get-rpc-url --entrypoint "$gossip_entrypoint")
if new_genesis_block; then
# If the genesis block has changed remove the now stale ledger and start all
# over again