From 311475a879d54a86b090a163d76ae4fbb850bf22 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Mon, 18 Jun 2018 15:23:56 -0700 Subject: [PATCH] update demo scripts * add setup to combine init steps, configurable initial mint * bash -e -> bash and be explicit about errors with || exit $? * feed transaction logs to validator, too --- multinode-demo/client.sh | 4 ++-- multinode-demo/leader.sh | 4 +++- multinode-demo/setup.sh | 9 +++++++++ multinode-demo/validator.sh | 4 ++-- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100755 multinode-demo/setup.sh diff --git a/multinode-demo/client.sh b/multinode-demo/client.sh index 14dea2e27aa711..10b6305de5723c 100755 --- a/multinode-demo/client.sh +++ b/multinode-demo/client.sh @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash if [[ -z $1 ]]; then printf 'usage: %s [network path to solana repo on leader machine] [number of nodes in the network if greater then 1]' "$0" @@ -9,7 +9,7 @@ LEADER=$1 COUNT=${2:-1} set -x -rsync -v -e ssh "$LEADER"/{leader.json,mint-demo.json} . +rsync -v "$LEADER"/{leader.json,mint-demo.json} . || exit $? # if RUST_LOG is unset, default to info export RUST_LOG=${RUST_LOG:-solana=info} diff --git a/multinode-demo/leader.sh b/multinode-demo/leader.sh index 934f8f62a333a1..9a6b88b7d618b7 100755 --- a/multinode-demo/leader.sh +++ b/multinode-demo/leader.sh @@ -5,4 +5,6 @@ export RUST_LOG=${RUST_LOG:-solana=info} set -x [[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400 -cargo run --release --bin solana-fullnode -- -l leader.json < genesis.log + +cargo run --release --bin solana-fullnode -- \ + -l leader.json < genesis.log tx-*.log > tx-"$(date -u +%Y%m%d%k%M%S%N)" diff --git a/multinode-demo/setup.sh b/multinode-demo/setup.sh new file mode 100755 index 00000000000000..1737d9e62dca06 --- /dev/null +++ b/multinode-demo/setup.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +TOKENS=${1:-1000000000} + +cargo run --release --bin solana-mint-demo <<<"${TOKENS}" > mint-demo.json +cargo run --release --bin solana-genesis-demo < mint-demo.json > genesis.log + +cargo run --release --bin solana-fullnode-config -- -d > leader.json +cargo run --release --bin solana-fullnode-config -- -d > validator.json diff --git a/multinode-demo/validator.sh b/multinode-demo/validator.sh index ba4032251014c6..be854970d246d4 100755 --- a/multinode-demo/validator.sh +++ b/multinode-demo/validator.sh @@ -9,7 +9,7 @@ LEADER=$1 set -x -rsync -v -e ssh "$LEADER"/{mint-demo.json,leader.json,genesis.log} . || exit $? +rsync -v "$LEADER"/{mint-demo.json,leader.json,genesis.log,tx-*.log} . || exit $? [[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400 @@ -17,4 +17,4 @@ rsync -v -e ssh "$LEADER"/{mint-demo.json,leader.json,genesis.log} . || exit $? export RUST_LOG=${RUST_LOG:-solana=info} cargo run --release --bin solana-fullnode -- \ - -l validator.json -v leader.json < genesis.log + -l validator.json -v leader.json < genesis.log tx-*.log