#!/usr/bin/env bash set -e cd "$(dirname "$0")"/../.. set -x deployMethod="$1" nodeType="$2" publicNetwork="$3" entrypointIp="$4" numNodes="$5" RUST_LOG="$6" skipSetup="$7" leaderRotation="$8" set +x export RUST_LOG=${RUST_LOG:-solana=warn} # if RUST_LOG is unset, default to warn missing() { echo "Error: $1 not specified" exit 1 } [[ -n $deployMethod ]] || missing deployMethod [[ -n $nodeType ]] || missing nodeType [[ -n $publicNetwork ]] || missing publicNetwork [[ -n $entrypointIp ]] || missing entrypointIp [[ -n $numNodes ]] || missing numNodes [[ -n $skipSetup ]] || missing skipSetup [[ -n $leaderRotation ]] || missing leaderRotation cat > deployConfig < oom-monitor.log 2>&1 & scripts/net-stats.sh > net-stats.log 2>&1 & maybeNoLeaderRotation= if ! $leaderRotation; then maybeNoLeaderRotation="--no-leader-rotation" fi case $nodeType in bootstrap-leader) if [[ -e /dev/nvidia0 && -x ~/.cargo/bin/solana-fullnode-cuda ]]; then echo Selecting solana-fullnode-cuda export SOLANA_CUDA=1 fi if [[ $skipSetup != true ]]; then ./multinode-demo/setup.sh -t bootstrap-leader $setupArgs fi ./multinode-demo/drone.sh > drone.log 2>&1 & ./multinode-demo/bootstrap-leader.sh $maybeNoLeaderRotation > bootstrap-leader.log 2>&1 & ln -sTf bootstrap-leader.log fullnode.log ;; fullnode) net/scripts/rsync-retry.sh -vPrc "$entrypointIp":~/.cargo/bin/ ~/.cargo/bin/ if [[ -e /dev/nvidia0 && -x ~/.cargo/bin/solana-fullnode-cuda ]]; then echo Selecting solana-fullnode-cuda export SOLANA_CUDA=1 fi if [[ $skipSetup != true ]]; then ./multinode-demo/setup.sh -t fullnode $setupArgs fi ./multinode-demo/fullnode.sh $maybeNoLeaderRotation "$entrypointIp":~/solana "$entrypointIp:8001" > fullnode.log 2>&1 & ;; *) echo "Error: unknown node type: $nodeType" exit 1 ;; esac ;; *) echo "Unknown deployment method: $deployMethod" exit 1 esac