-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
310 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# |source| me | ||
|
||
upload_ci_artifact() { | ||
echo "--- artifact: $1" | ||
if [[ -r "$1" ]]; then | ||
ls -l "$1" | ||
if ${BUILDKITE:-false}; then | ||
( | ||
set -x | ||
buildkite-agent artifact upload "$1" | ||
) | ||
fi | ||
else | ||
echo ^^^ +++ | ||
echo "$1 not found" | ||
fi | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
#!/bin/bash | ||
# | ||
# usage: $0 <network path to solana repo on leader machine> <number of nodes in the network>" | ||
# | ||
|
||
if [[ -z $1 ]]; then | ||
echo "usage: $0 [network path to solana repo on leader machine] <number of nodes in the network>" | ||
exit 1 | ||
fi | ||
here=$(dirname "$0") | ||
# shellcheck source=multinode-demo/common.sh | ||
source "$here"/common.sh | ||
SOLANA_CONFIG_DIR=config-client-demo | ||
|
||
LEADER=$1 | ||
COUNT=${2:-1} | ||
leader=${1:-${here}/..} # Default to local solana repo | ||
count=${2:-1} | ||
|
||
rsync -vz "$LEADER"/{leader.json,mint-demo.json} . || exit $? | ||
set -ex | ||
mkdir -p $SOLANA_CONFIG_DIR | ||
rsync -vz "$leader"/config/leader.json $SOLANA_CONFIG_DIR/ | ||
rsync -vz "$leader"/config/mint-demo.json $SOLANA_CONFIG_DIR/ | ||
|
||
# if RUST_LOG is unset, default to info | ||
export RUST_LOG=${RUST_LOG:-solana=info} | ||
|
||
cargo run --release --bin solana-client-demo -- \ | ||
-n "$COUNT" -l leader.json -d < mint-demo.json 2>&1 | tee client.log | ||
# shellcheck disable=SC2086 # $solana_client_demo should not be quoted | ||
exec $solana_client_demo \ | ||
-n "$count" -l $SOLANA_CONFIG_DIR/leader.json -d \ | ||
< $SOLANA_CONFIG_DIR/mint-demo.json 2>&1 | tee client-demo.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# |source| this file | ||
# | ||
# Disable complaints about unused variables in this file: | ||
# shellcheck disable=2034 | ||
|
||
if [[ -d "$SNAP" ]]; then # Running as a Linux Snap? | ||
solana_program() { | ||
local program="$1" | ||
printf "%s/command-%s.wrapper" "$SNAP" "$program" | ||
} | ||
SOLANA_CUDA="$(snapctl get enable-cuda)" | ||
else | ||
solana_program() { | ||
local program="$1" | ||
local features="" | ||
if [[ "$program" =~ ^(.*)-cuda$ ]]; then | ||
program=${BASH_REMATCH[1]} | ||
features="--features=cuda,erasure" | ||
fi | ||
printf "cargo run --release --bin solana-%s %s -- " "$program" "$features" | ||
} | ||
fi | ||
|
||
solana_client_demo=$(solana_program client-demo) | ||
solana_drone=$(solana_program drone) | ||
solana_fullnode=$(solana_program fullnode) | ||
solana_fullnode_config=$(solana_program fullnode-config) | ||
solana_fullnode_cuda=$(solana_program fullnode-cuda) | ||
solana_genesis_demo=$(solana_program genesis-demo) | ||
solana_mint_demo=$(solana_program mint-demo) | ||
|
||
export RUST_LOG=${RUST_LOG:-solana=info} # if RUST_LOG is unset, default to info | ||
export RUST_BACKTRACE=1 | ||
[[ $(uname) = Linux ]] && (set -x; sudo sysctl -w net.core.rmem_max=26214400 1>/dev/null 2>/dev/null) | ||
|
||
SOLANA_CONFIG_DIR=${SNAP_DATA:-$PWD}/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# | ||
# usage: $0 <network path to solana repo on leader machine> | ||
# | ||
|
||
here=$(dirname "$0") | ||
# shellcheck source=multinode-demo/common.sh | ||
source "$here"/common.sh | ||
SOLANA_CONFIG_DIR=config-drone | ||
|
||
leader=${1:-${here}/..} # Default to local solana repo | ||
|
||
set -ex | ||
mkdir -p $SOLANA_CONFIG_DIR | ||
rsync -vz "$leader"/config/leader.json $SOLANA_CONFIG_DIR/ | ||
rsync -vz "$leader"/config/mint-demo.json $SOLANA_CONFIG_DIR/ | ||
|
||
# shellcheck disable=SC2086 # $solana_drone should not be quoted | ||
exec $solana_drone \ | ||
-l $SOLANA_CONFIG_DIR/leader.json < $SOLANA_CONFIG_DIR/mint-demo.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,22 @@ | ||
#!/bin/bash | ||
here=$(dirname "$0") | ||
|
||
# shellcheck source=/dev/null | ||
. "${here}"/myip.sh | ||
|
||
myip=$(myip) || exit $? | ||
here=$(dirname "$0") | ||
# shellcheck source=multinode-demo/common.sh | ||
source "$here"/common.sh | ||
|
||
[[ -f leader-"${myip}".json ]] || { | ||
echo "I can't find a matching leader config file for \"${myip}\"... | ||
Please run ${here}/setup.sh first. | ||
" | ||
[[ -f "$SOLANA_CONFIG_DIR"/leader.json ]] || { | ||
echo "$SOLANA_CONFIG_DIR/leader.json not found, run ${here}/setup.sh first" | ||
exit 1 | ||
} | ||
|
||
# if RUST_LOG is unset, default to info | ||
export RUST_LOG=${RUST_LOG:-solana=info} | ||
|
||
[[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400 1>/dev/null 2>/dev/null | ||
|
||
# this makes a leader.json file available alongside genesis, etc. for | ||
# validators and clients | ||
cp leader-"${myip}".json leader.json | ||
if [[ -n "$SOLANA_CUDA" ]]; then | ||
program="$solana_fullnode_cuda" | ||
else | ||
program="$solana_fullnode" | ||
fi | ||
|
||
cargo run --release --bin solana-fullnode -- \ | ||
-l leader-"${myip}".json \ | ||
< genesis.log tx-*.log \ | ||
> tx-"$(date -u +%Y%m%d%H%M%S%N)".log | ||
# shellcheck disable=SC2086 # $program should not be quoted | ||
exec $program \ | ||
-l "$SOLANA_CONFIG_DIR"/leader.json \ | ||
< "$SOLANA_CONFIG_DIR"/genesis.log "$SOLANA_CONFIG_DIR"/tx-*.log \ | ||
> "$SOLANA_CONFIG_DIR"/tx-"$(date -u +%Y%m%d%H%M%S%N)".log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
#!/bin/bash | ||
|
||
num_tokens=${1:-1000000000} | ||
|
||
here=$(dirname "$0") | ||
# shellcheck source=multinode-demo/common.sh | ||
source "$here"/common.sh | ||
|
||
# shellcheck source=/dev/null | ||
. "${here}"/myip.sh | ||
set -e | ||
|
||
myip=$(myip) || exit $? | ||
echo "Cleaning $SOLANA_CONFIG_DIR" | ||
rm -rvf "$SOLANA_CONFIG_DIR" | ||
mkdir -p "$SOLANA_CONFIG_DIR" | ||
|
||
num_tokens=${1:-1000000000} | ||
echo "Creating $SOLANA_CONFIG_DIR/mint-demo.json with $num_tokens tokens" | ||
$solana_mint_demo <<<"$num_tokens" > "$SOLANA_CONFIG_DIR"/mint-demo.json | ||
|
||
echo "Creating $SOLANA_CONFIG_DIR/genesis.log" | ||
$solana_genesis_demo < "$SOLANA_CONFIG_DIR"/mint-demo.json > "$SOLANA_CONFIG_DIR"/genesis.log | ||
|
||
echo "Creating $SOLANA_CONFIG_DIR/leader.json" | ||
$solana_fullnode_config -d > "$SOLANA_CONFIG_DIR"/leader.json | ||
|
||
cargo run --release --bin solana-mint-demo <<<"${num_tokens}" > mint-demo.json | ||
cargo run --release --bin solana-genesis-demo < mint-demo.json > genesis.log | ||
echo "Creating $SOLANA_CONFIG_DIR/validator.json" | ||
$solana_fullnode_config -d -b 9000 > "$SOLANA_CONFIG_DIR"/validator.json | ||
|
||
cargo run --release --bin solana-fullnode-config -- -d > leader-"${myip}".json | ||
cargo run --release --bin solana-fullnode-config -- -b 9000 -d > validator-"${myip}".json | ||
ls -lh "$SOLANA_CONFIG_DIR/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,40 @@ | ||
#!/bin/bash | ||
here=$(dirname "$0") | ||
# shellcheck source=multinode-demo/common.sh | ||
source "$here"/common.sh | ||
|
||
# shellcheck source=/dev/null | ||
. "${here}"/myip.sh | ||
|
||
leader=$1 | ||
|
||
[[ -z ${leader} ]] && { | ||
echo "usage: $0 [network path to solana repo on leader machine]" | ||
usage() { | ||
echo "usage: $0 [network path to solana repo on leader machine] [network ip address of leader]" | ||
exit 1 | ||
} | ||
|
||
myip=$(myip) || exit $? | ||
if [[ "$1" = "-h" || -n "$3" ]]; then | ||
usage | ||
fi | ||
|
||
[[ -f validator-"$myip".json ]] || { | ||
echo "I can't find a matching validator config file for \"${myip}\"... | ||
Please run ${here}/setup.sh first. | ||
" | ||
exit 1 | ||
} | ||
leader=${1:-${here}/..} # Default to local solana repo | ||
leader_ip=${2:-127.0.0.1} # Default to local leader | ||
leader_port=8001 | ||
|
||
rsync -vz "${leader}"/{mint-demo.json,leader.json,genesis.log,tx-*.log} . || exit $? | ||
if [[ -n "$SOLANA_CUDA" ]]; then | ||
program="$solana_fullnode_cuda" | ||
else | ||
program="$solana_fullnode" | ||
fi | ||
|
||
[[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400 1>/dev/null 2>/dev/null | ||
|
||
# if RUST_LOG is unset, default to info | ||
export RUST_LOG=${RUST_LOG:-solana=info} | ||
[[ -f "$SOLANA_CONFIG_DIR"/validator.json ]] || { | ||
echo "$SOLANA_CONFIG_DIR/validator.json not found, run ${here}/setup.sh first" | ||
exit 1 | ||
} | ||
|
||
set -ex | ||
SOLANA_LEADER_CONFIG_DIR="$SOLANA_CONFIG_DIR"/leader-config | ||
rm -rf "$SOLANA_LEADER_CONFIG_DIR" | ||
rsync -vPrz "${leader}"/config/ "$SOLANA_LEADER_CONFIG_DIR" | ||
ls -lh "$SOLANA_LEADER_CONFIG_DIR" | ||
|
||
cargo run --release --bin solana-fullnode -- \ | ||
-l validator-"${myip}".json -v leader.json \ | ||
< genesis.log tx-*.log | ||
# shellcheck disable=SC2086 # $program should not be quoted | ||
exec $program \ | ||
-l "$SOLANA_CONFIG_DIR"/validator.json -t "$leader_ip:$leader_port" \ | ||
< "$SOLANA_LEADER_CONFIG_DIR"/genesis.log "$SOLANA_LEADER_CONFIG_DIR"/tx-*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
leader_address="$(snapctl get leader-address)" | ||
if [[ -z "$leader_address" ]]; then | ||
# Assume drone is running on the same node as the leader by default | ||
leader_address="localhost" | ||
fi | ||
|
||
exec drone.sh rsync://"$leader_address" |
Oops, something went wrong.