Enable easy full-rpc services on testnet nodes (#20529)

This commit is contained in:
Tyera Eulberg 2021-10-07 19:08:29 -06:00 committed by GitHub
parent 57592e463e
commit a6a4cfda89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View File

@ -105,6 +105,8 @@ Operate a configured testnet
- Override the number of slots in an epoch - Override the number of slots in an epoch
--warp-slot WARP_SLOT --warp-slot WARP_SLOT
- Boot from a snapshot that has warped ahead to WARP_SLOT rather than a slot 0 genesis. - Boot from a snapshot that has warped ahead to WARP_SLOT rather than a slot 0 genesis.
--full-rpc
- Support full RPC services on all nodes
sanity/start-specific options: sanity/start-specific options:
-F - Discard validator nodes that didn't bootup successfully -F - Discard validator nodes that didn't bootup successfully
-o noInstallCheck - Skip solana-install sanity -o noInstallCheck - Skip solana-install sanity
@ -310,6 +312,7 @@ startBootstrapLeader() {
\"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize $maybeWaitForSupermajority $maybeAllowPrivateAddr $maybeAccountsDbSkipShrink $maybeSkipRequireTower\" \ \"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize $maybeWaitForSupermajority $maybeAllowPrivateAddr $maybeAccountsDbSkipShrink $maybeSkipRequireTower\" \
\"$gpuMode\" \ \"$gpuMode\" \
\"$maybeWarpSlot\" \ \"$maybeWarpSlot\" \
\"$maybeFullRpc\" \
\"$waitForNodeInit\" \ \"$waitForNodeInit\" \
\"$extraPrimordialStakes\" \ \"$extraPrimordialStakes\" \
\"$TMPFS_ACCOUNTS\" \ \"$TMPFS_ACCOUNTS\" \
@ -381,6 +384,7 @@ startNode() {
\"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize $maybeWaitForSupermajority $maybeAllowPrivateAddr $maybeAccountsDbSkipShrink $maybeSkipRequireTower\" \ \"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize $maybeWaitForSupermajority $maybeAllowPrivateAddr $maybeAccountsDbSkipShrink $maybeSkipRequireTower\" \
\"$gpuMode\" \ \"$gpuMode\" \
\"$maybeWarpSlot\" \ \"$maybeWarpSlot\" \
\"$maybeFullRpc\" \
\"$waitForNodeInit\" \ \"$waitForNodeInit\" \
\"$extraPrimordialStakes\" \ \"$extraPrimordialStakes\" \
\"$TMPFS_ACCOUNTS\" \ \"$TMPFS_ACCOUNTS\" \
@ -788,6 +792,7 @@ netemCommand="add"
clientDelayStart=0 clientDelayStart=0
netLogDir= netLogDir=
maybeWarpSlot= maybeWarpSlot=
maybeFullRpc=false
waitForNodeInit=true waitForNodeInit=true
extraPrimordialStakes=0 extraPrimordialStakes=0
@ -896,6 +901,9 @@ while [[ -n $1 ]]; do
elif [[ $1 == --warp-slot ]]; then elif [[ $1 == --warp-slot ]]; then
maybeWarpSlot="$1 $2" maybeWarpSlot="$1 $2"
shift 2 shift 2
elif [[ $1 == --full-rpc ]]; then
maybeFullRpc=true
shift 1
elif [[ $1 == --async-node-init ]]; then elif [[ $1 == --async-node-init ]]; then
waitForNodeInit=false waitForNodeInit=false
shift 1 shift 1

View File

@ -24,9 +24,10 @@ genesisOptions="${15}"
extraNodeArgs="${16}" extraNodeArgs="${16}"
gpuMode="${17:-auto}" gpuMode="${17:-auto}"
maybeWarpSlot="${18}" maybeWarpSlot="${18}"
waitForNodeInit="${19}" maybeFullRpc="${19}"
extraPrimordialStakes="${20:=0}" waitForNodeInit="${20}"
tmpfsAccounts="${21:false}" extraPrimordialStakes="${21:=0}"
tmpfsAccounts="${22:false}"
set +x set +x
missing() { missing() {
@ -277,6 +278,11 @@ EOF
args+=(--accounts /mnt/solana-accounts) args+=(--accounts /mnt/solana-accounts)
fi fi
if $maybeFullRpc; then
args+=(--enable-rpc-transaction-history)
args+=(--enable-cpi-and-log-storage)
fi
if [[ $airdropsEnabled = true ]]; then if [[ $airdropsEnabled = true ]]; then
cat >> ~/solana/on-reboot <<EOF cat >> ~/solana/on-reboot <<EOF
./multinode-demo/faucet.sh > faucet.log 2>&1 & ./multinode-demo/faucet.sh > faucet.log 2>&1 &
@ -400,6 +406,11 @@ EOF
args+=(--accounts /mnt/solana-accounts) args+=(--accounts /mnt/solana-accounts)
fi fi
if $maybeFullRpc; then
args+=(--enable-rpc-transaction-history)
args+=(--enable-cpi-and-log-storage)
fi
cat >> ~/solana/on-reboot <<EOF cat >> ~/solana/on-reboot <<EOF
$maybeSkipAccountsCreation $maybeSkipAccountsCreation
nohup multinode-demo/validator.sh ${args[@]} > validator.log.\$now 2>&1 & nohup multinode-demo/validator.sh ${args[@]} > validator.log.\$now 2>&1 &