Plumb blockstreamer name through testnet scripts
This commit is contained in:
parent
deeabb862d
commit
18d48f09f8
@ -18,7 +18,7 @@ enableGpu=false
|
||||
bootDiskType=""
|
||||
leaderRotation=true
|
||||
useTarReleaseChannel=false
|
||||
apiNode=false
|
||||
blockstreamer=false
|
||||
|
||||
usage() {
|
||||
exitcode=0
|
||||
@ -44,7 +44,7 @@ Deploys a CD testnet
|
||||
(default: $tarChannelOrTag)
|
||||
-n [number] - Number of additional full nodes (default: $additionalFullNodeCount)
|
||||
-c [number] - Number of client bencher nodes (default: $clientNodeCount)
|
||||
-u - Include an API node (default: $apiNode)
|
||||
-u - Include a Blockstreamer (default: $blockstreamer)
|
||||
-P - Use public network IP addresses (default: $publicNetwork)
|
||||
-G - Enable GPU, and set count/type of GPUs to use (e.g n1-standard-16 --accelerator count=4,type=nvidia-tesla-k80)
|
||||
-g - Enable GPU (default: $enableGpu)
|
||||
@ -127,7 +127,7 @@ while getopts "h?p:Pn:c:s:t:gG:a:Dbd:ru" opt; do
|
||||
skipSetup=true
|
||||
;;
|
||||
u)
|
||||
apiNode=true
|
||||
blockstreamer=true
|
||||
;;
|
||||
*)
|
||||
usage "Error: unhandled option: $opt"
|
||||
@ -171,7 +171,7 @@ if ! $skipSetup; then
|
||||
-n "$additionalFullNodeCount"
|
||||
)
|
||||
|
||||
if $apiNode; then
|
||||
if $blockstreamer; then
|
||||
create_args+=(-u)
|
||||
fi
|
||||
|
||||
|
@ -29,8 +29,8 @@ fullnodeIpList=()
|
||||
fullnodeIpListPrivate=()
|
||||
clientIpList=()
|
||||
clientIpListPrivate=()
|
||||
apiIpList=()
|
||||
apiIpListPrivate=()
|
||||
blockstreamerIpList=()
|
||||
blockstreamerIpListPrivate=()
|
||||
leaderRotation=
|
||||
|
||||
buildSshOptions() {
|
||||
|
44
net/gce.sh
44
net/gce.sh
@ -17,7 +17,7 @@ gce)
|
||||
bootstrapLeaderMachineType=$cpuBootstrapLeaderMachineType
|
||||
fullNodeMachineType=n1-standard-16
|
||||
clientMachineType=n1-standard-16
|
||||
apiNodeMachineType=n1-standard-8
|
||||
blockstreamerMachineType=n1-standard-8
|
||||
;;
|
||||
ec2)
|
||||
# shellcheck source=net/scripts/ec2-provider.sh
|
||||
@ -28,7 +28,7 @@ ec2)
|
||||
bootstrapLeaderMachineType=$cpuBootstrapLeaderMachineType
|
||||
fullNodeMachineType=m4.2xlarge
|
||||
clientMachineType=m4.2xlarge
|
||||
apiNodeMachineType=m4.2xlarge
|
||||
blockstreamerMachineType=m4.2xlarge
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown cloud provider: $cloudProvider"
|
||||
@ -39,7 +39,7 @@ esac
|
||||
prefix=testnet-dev-${USER//[^A-Za-z0-9]/}
|
||||
additionalFullNodeCount=5
|
||||
clientNodeCount=1
|
||||
apiNode=false
|
||||
blockstreamer=false
|
||||
fullNodeBootDiskSizeInGb=1000
|
||||
clientBootDiskSizeInGb=75
|
||||
|
||||
@ -72,12 +72,12 @@ Manage testnet instances
|
||||
create-specific options:
|
||||
-n [number] - Number of additional fullnodes (default: $additionalFullNodeCount)
|
||||
-c [number] - Number of client nodes (default: $clientNodeCount)
|
||||
-u - Include an API node (default: $apiNode)
|
||||
-u - Include a Blockstreamer (default: $blockstreamer)
|
||||
-P - Use public network IP addresses (default: $publicNetwork)
|
||||
-g - Enable GPU (default: $enableGpu)
|
||||
-G - Enable GPU, and set count/type of GPUs to use
|
||||
(e.g $cpuBootstrapLeaderMachineType --accelerator count=4,type=nvidia-tesla-k80)
|
||||
-a [address] - Address to be be assigned to the API node if present,
|
||||
-a [address] - Address to be be assigned to the Blockstreamer if present,
|
||||
otherwise the bootstrap fullnode.
|
||||
* For GCE, [address] is the "name" of the desired External
|
||||
IP Address.
|
||||
@ -145,7 +145,7 @@ while getopts "h?p:Pn:c:z:gG:a:d:bu" opt; do
|
||||
bootDiskType=$OPTARG
|
||||
;;
|
||||
u)
|
||||
apiNode=true
|
||||
blockstreamer=true
|
||||
;;
|
||||
*)
|
||||
usage "unhandled option: $opt"
|
||||
@ -363,12 +363,12 @@ EOF
|
||||
cloud_ForEachInstance waitForStartupComplete
|
||||
}
|
||||
|
||||
echo "apiIpList=()" >> "$configFile"
|
||||
echo "apiIpListPrivate=()" >> "$configFile"
|
||||
echo "Looking for api instances..."
|
||||
cloud_FindInstances "$prefix-api"
|
||||
echo "blockstreamerIpList=()" >> "$configFile"
|
||||
echo "blockstreamerIpListPrivate=()" >> "$configFile"
|
||||
echo "Looking for blockstreamer instances..."
|
||||
cloud_FindInstances "$prefix-blockstreamer"
|
||||
[[ ${#instances[@]} -eq 0 ]] || {
|
||||
cloud_ForEachInstance recordInstanceIp apiIpList
|
||||
cloud_ForEachInstance recordInstanceIp blockstreamerIpList
|
||||
cloud_ForEachInstance waitForStartupComplete
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ Network composition:
|
||||
Bootstrap leader = $bootstrapLeaderMachineType (GPU=$enableGpu)
|
||||
Additional fullnodes = $additionalFullNodeCount x $fullNodeMachineType
|
||||
Client(s) = $clientNodeCount x $clientMachineType
|
||||
API Node = $apiNode
|
||||
Blockstreamer = $blockstreamer
|
||||
|
||||
Leader rotation: $leaderRotation
|
||||
|
||||
@ -497,8 +497,8 @@ touch /.instance-startup-complete
|
||||
|
||||
EOF
|
||||
|
||||
if $apiNode; then
|
||||
apiNodeAddress=$customAddress
|
||||
if $blockstreamer; then
|
||||
blockstreamerAddress=$customAddress
|
||||
else
|
||||
bootstrapLeaderAddress=$customAddress
|
||||
fi
|
||||
@ -519,10 +519,10 @@ EOF
|
||||
"$startupScript" "" "$bootDiskType"
|
||||
fi
|
||||
|
||||
if $apiNode; then
|
||||
cloud_CreateInstances "$prefix" "$prefix-api" "1" \
|
||||
"$imageName" "$apiNodeMachineType" "$fullNodeBootDiskSizeInGb" \
|
||||
"$startupScript" "$apiNodeAddress" "$bootDiskType"
|
||||
if $blockstreamer; then
|
||||
cloud_CreateInstances "$prefix" "$prefix-blockstreamer" "1" \
|
||||
"$imageName" "$blockstreamerMachineType" "$fullNodeBootDiskSizeInGb" \
|
||||
"$startupScript" "$blockstreamerAddress" "$bootDiskType"
|
||||
fi
|
||||
|
||||
$metricsWriteDatapoint "testnet-deploy net-create-complete=1"
|
||||
@ -558,10 +558,10 @@ info)
|
||||
printNode bench-tps "$ipAddress" "$ipAddressPrivate"
|
||||
done
|
||||
|
||||
for i in $(seq 0 $(( ${#apiIpList[@]} - 1)) ); do
|
||||
ipAddress=${apiIpList[$i]}
|
||||
ipAddressPrivate=${apiIpListPrivate[$i]}
|
||||
printNode api "$ipAddress" "$ipAddressPrivate"
|
||||
for i in $(seq 0 $(( ${#blockstreamerIpList[@]} - 1)) ); do
|
||||
ipAddress=${blockstreamerIpList[$i]}
|
||||
ipAddressPrivate=${blockstreamerIpListPrivate[$i]}
|
||||
printNode blockstreamer "$ipAddress" "$ipAddressPrivate"
|
||||
done
|
||||
;;
|
||||
*)
|
||||
|
10
net/net.sh
10
net/net.sh
@ -358,9 +358,9 @@ start() {
|
||||
|
||||
declare bootstrapLeader=true
|
||||
declare nodeType=fullnode
|
||||
for ipAddress in "${fullnodeIpList[@]}" - "${apiIpList[@]}"; do
|
||||
for ipAddress in "${fullnodeIpList[@]}" - "${blockstreamerIpList[@]}"; do
|
||||
if [[ $ipAddress = - ]]; then
|
||||
nodeType=apinode
|
||||
nodeType=blockstreamer
|
||||
continue
|
||||
fi
|
||||
if $updateNodes; then
|
||||
@ -445,7 +445,7 @@ start() {
|
||||
echo
|
||||
echo "+++ Deployment Successful"
|
||||
echo "Bootstrap leader deployment took $bootstrapNodeDeployTime seconds"
|
||||
echo "Additional fullnode deployment (${#fullnodeIpList[@]} full nodes, ${#apiIpList[@]} api nodes) took $additionalNodeDeployTime seconds"
|
||||
echo "Additional fullnode deployment (${#fullnodeIpList[@]} full nodes, ${#blockstreamerIpList[@]} blockstreamer nodes) took $additionalNodeDeployTime seconds"
|
||||
echo "Client deployment (${#clientIpList[@]} instances) took $clientDeployTime seconds"
|
||||
echo "Network start logs in $netLogDir:"
|
||||
ls -l "$netLogDir"
|
||||
@ -480,7 +480,7 @@ stop() {
|
||||
SECONDS=0
|
||||
$metricsWriteDatapoint "testnet-deploy net-stop-begin=1"
|
||||
|
||||
for ipAddress in "${fullnodeIpList[@]}" "${apiIpList[@]}" "${clientIpList[@]}"; do
|
||||
for ipAddress in "${fullnodeIpList[@]}" "${blockstreamerIpList[@]}" "${clientIpList[@]}"; do
|
||||
stopNode "$ipAddress"
|
||||
done
|
||||
|
||||
@ -529,7 +529,7 @@ logs)
|
||||
for ipAddress in "${clientIpList[@]}"; do
|
||||
fetchRemoteLog "$ipAddress" client
|
||||
done
|
||||
for ipAddress in "${apiIpList[@]}"; do
|
||||
for ipAddress in "${blockstreamerIpList[@]}"; do
|
||||
fetchRemoteLog "$ipAddress" fullnode
|
||||
done
|
||||
;;
|
||||
|
@ -169,7 +169,7 @@ local|tar)
|
||||
./multinode-demo/bootstrap-leader.sh $maybeNoLeaderRotation > bootstrap-leader.log 2>&1 &
|
||||
ln -sTf bootstrap-leader.log fullnode.log
|
||||
;;
|
||||
fullnode|apinode)
|
||||
fullnode|blockstreamer)
|
||||
net/scripts/rsync-retry.sh -vPrc "$entrypointIp":~/.cargo/bin/ ~/.cargo/bin/
|
||||
|
||||
if [[ -e /dev/nvidia0 && -x ~/.cargo/bin/solana-fullnode-cuda ]]; then
|
||||
@ -181,7 +181,7 @@ local|tar)
|
||||
if ! $leaderRotation; then
|
||||
args+=("--no-leader-rotation")
|
||||
fi
|
||||
if [[ $nodeType = apinode ]]; then
|
||||
if [[ $nodeType = blockstreamer ]]; then
|
||||
args+=(
|
||||
--blockstream /tmp/solana-blockstream.sock
|
||||
--no-signer
|
||||
@ -193,7 +193,7 @@ local|tar)
|
||||
./multinode-demo/setup.sh -t fullnode $setupArgs
|
||||
fi
|
||||
|
||||
if [[ $nodeType = apinode ]]; then
|
||||
if [[ $nodeType = blockstreamer ]]; then
|
||||
npm install @solana/blockexplorer@1
|
||||
npx solana-blockexplorer > blockexplorer.log 2>&1 &
|
||||
fi
|
||||
|
@ -63,11 +63,11 @@ else
|
||||
done
|
||||
fi
|
||||
echo
|
||||
echo API nodes:
|
||||
if [[ ${#apiIpList[@]} -eq 0 ]]; then
|
||||
echo Blockstreamers:
|
||||
if [[ ${#blockstreamerIpList[@]} -eq 0 ]]; then
|
||||
echo " None"
|
||||
else
|
||||
for ipAddress in "${apiIpList[@]}"; do
|
||||
for ipAddress in "${blockstreamerIpList[@]}"; do
|
||||
printNode fullnode "$ipAddress"
|
||||
done
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user