Add a stand-alone gossip node on the blocksteamer instance

The blocksteamer instance is the TdS cluster entrypoint.  Running an
additional solana-gossip node allows other participants to join a
cluster even if the validator node on the blocksteamer instance goes down.
This commit is contained in:
Michael Vines 2020-01-01 23:00:26 -07:00
parent 48a36f59a6
commit a217920561
2 changed files with 37 additions and 24 deletions

View File

@ -501,6 +501,7 @@ startBootstrapLeader() {
ssh "${sshOptions[@]}" -n "$ipAddress" \ ssh "${sshOptions[@]}" -n "$ipAddress" \
"./solana/net/remote/remote-node.sh \ "./solana/net/remote/remote-node.sh \
$deployMethod \ $deployMethod \
$ipAddress \
bootstrap-leader \ bootstrap-leader \
$entrypointIp \ $entrypointIp \
$((${#validatorIpList[@]} + ${#blockstreamerIpList[@]} + ${#archiverIpList[@]})) \ $((${#validatorIpList[@]} + ${#blockstreamerIpList[@]} + ${#archiverIpList[@]})) \
@ -570,6 +571,7 @@ startNode() {
ssh "${sshOptions[@]}" -n "$ipAddress" \ ssh "${sshOptions[@]}" -n "$ipAddress" \
"./solana/net/remote/remote-node.sh \ "./solana/net/remote/remote-node.sh \
$deployMethod \ $deployMethod \
$ipAddress \
$nodeType \ $nodeType \
$entrypointIp \ $entrypointIp \
$((${#validatorIpList[@]} + ${#blockstreamerIpList[@]} + ${#archiverIpList[@]})) \ $((${#validatorIpList[@]} + ${#blockstreamerIpList[@]} + ${#archiverIpList[@]})) \

View File

@ -5,27 +5,28 @@ cd "$(dirname "$0")"/../..
set -x set -x
deployMethod="$1" deployMethod="$1"
nodeType="$2" ipAddress="$2"
entrypointIp="$3" nodeType="$3"
numNodes="$4" entrypointIp="$4"
if [[ -n $5 ]]; then numNodes="$5"
export RUST_LOG="$5" if [[ -n $6 ]]; then
export RUST_LOG="$6"
fi fi
skipSetup="$6" skipSetup="$7"
failOnValidatorBootupFailure="$7" failOnValidatorBootupFailure="$8"
externalPrimordialAccountsFile="$8" externalPrimordialAccountsFile="$9"
maybeDisableAirdrops="$9" maybeDisableAirdrops="${10}"
internalNodesStakeLamports="${10}" internalNodesStakeLamports="${11}"
internalNodesLamports="${11}" internalNodesLamports="${12}"
nodeIndex="${12}" nodeIndex="${13}"
numBenchTpsClients="${13}" numBenchTpsClients="${14}"
benchTpsExtraArgs="${14}" benchTpsExtraArgs="${15}"
numBenchExchangeClients="${15}" numBenchExchangeClients="${16}"
benchExchangeExtraArgs="${16}" benchExchangeExtraArgs="${17}"
genesisOptions="${17}" genesisOptions="${18}"
extraNodeArgs="${18}" extraNodeArgs="${19}"
gpuMode="${19:-auto}" gpuMode="${20:-auto}"
GEOLOCATION_API_KEY="${20}" GEOLOCATION_API_KEY="${21}"
set +x set +x
missing() { missing() {
@ -34,6 +35,7 @@ missing() {
} }
[[ -n $deployMethod ]] || missing deployMethod [[ -n $deployMethod ]] || missing deployMethod
[[ -n $ipAddress ]] || missing ipAddress
[[ -n $nodeType ]] || missing nodeType [[ -n $nodeType ]] || missing nodeType
[[ -n $entrypointIp ]] || missing entrypointIp [[ -n $entrypointIp ]] || missing entrypointIp
[[ -n $numNodes ]] || missing numNodes [[ -n $numNodes ]] || missing numNodes
@ -276,18 +278,22 @@ EOF
fi fi
args=( args=(
--entrypoint "$entrypointIp:8001"
--gossip-port 8001
--rpc-port 8899 --rpc-port 8899
) )
if [[ $nodeType = blockstreamer ]]; then if [[ $nodeType = blockstreamer ]]; then
args+=( args+=(
--blockstream /tmp/solana-blockstream.sock --entrypoint "$ipAddress:8001"
--gossip-port 9001
--no-voting --no-voting
--dev-no-sigverify --dev-no-sigverify
--blockstream /tmp/solana-blockstream.sock
) )
else else
args+=(--enable-rpc-exit) args+=(
--entrypoint "$entrypointIp:8001"
--gossip-port 8001
--enable-rpc-exit
)
if [[ -n $internalNodesLamports ]]; then if [[ -n $internalNodesLamports ]]; then
args+=(--node-lamports "$internalNodesLamports") args+=(--node-lamports "$internalNodesLamports")
fi fi
@ -357,6 +363,11 @@ EOF
cat >> ~/solana/on-reboot <<EOF cat >> ~/solana/on-reboot <<EOF
~/solana/restart-explorer ~/solana/restart-explorer
echo --- Starting gossip spy node
ln -sfT gossip.log.\$now gossip.log
nohup solana-gossip spy --gossip-port 8001 --gossip-host "$ipAddress" --entrypoint $entrypointIp:8001 > gossip.log.\$now 2>&1 &
sleep 1
head gossip.log
EOF EOF
fi fi