Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions local-devnet/client_env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash
# set -e

# ideally read config from validatorConfig and figure out all nodes in the array
# if validatorConfig is genesis bootnode then we read the genesis/validator_config.yaml for this
# please note that the clients are infered from the name of the nodes
nodes=("zeam_0" "ream_0" "qlean_0")

# ---------------------------------------------------------------------------------------------
# the client binary or docker setup configuration for this devnet
# 1. code & activate for your client
# 2. binary requires one standard arg: --data_dir to specify data dir at the
Expand Down
20 changes: 0 additions & 20 deletions parse-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,6 @@ then
validatorConfig="genesis_bootnode"
fi;

# ideally read config from validatorConfig and figure out all nodes in the array
# if validatorConfig is genesis bootnode then we read the genesis/validator_config.yaml for this
# please note that the clients are infered from the name of the nodes
nodes=("zeam_0" "zeam_1")

# collect the nodes that the user has asked us to spin
spin_nodes=()
for item in "${nodes[@]}"; do
if [ $node == $item ] || [ $node == "all" ]
then
node_present=true
spin_nodes+=($item)
fi;
done
if [ ! -n "$node_present" ] && [ node != "all" ]
then
echo "invalid specified node, options =${nodes[@]} all, exiting."
exit;
fi;

if [ -n "$freshStart" ]
then
echo "starting from a fresh genesis time..."
Expand Down
4 changes: 3 additions & 1 deletion set-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ mkdir $dataDir
for item in "${spin_nodes[@]}"; do
itemDataDir="$dataDir/$item"
mkdir $itemDataDir
cmd="rm -rf $itemDataDir/*"
# with docker previous runs could have created dirs with non current user
# hence might need sudo
cmd="sudo rm -rf $itemDataDir/*"
# always show the executing command
echo $cmd
eval $cmd
Expand Down
23 changes: 19 additions & 4 deletions spin-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,29 @@
currentDir=$(pwd)
scriptDir=$(dirname $0)

# 1. parse env and args
source "$(dirname $0)/parse-env.sh"
source "$(dirname $0)/set-up.sh"

# get the client cmds with args set
# 2. get the client cmds with args set
source "$scriptDir/$NETWORK_DIR/client_env.sh"

popupTerminal="gnome-terminal --disable-factory --"
# 3. collect the nodes that the user has asked us to spin and perform setup
spin_nodes=()
for item in "${nodes[@]}"; do
if [ $node == $item ] || [ $node == "all" ]
then
node_present=true
spin_nodes+=($item)
fi;
done
if [ ! -n "$node_present" ] && [ node != "all" ]
then
echo "invalid specified node, options =${nodes[@]} all, exiting."
exit;
fi;
source "$(dirname $0)/set-up.sh"

# 4. run clients
popupTerminal="gnome-terminal --disable-factory --"
for item in "${spin_nodes[@]}"; do
# extract client config
IFS='_' read -r -a elements <<< "$item"
Expand Down