29 lines
1007 B
Bash
29 lines
1007 B
Bash
|
#!/usr/bin/env bash
|
||
|
set -e
|
||
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||
|
set -x
|
||
|
fi
|
||
|
|
||
|
if [[ -n "$1" ]]; then
|
||
|
machine_name_prefix=$1
|
||
|
else
|
||
|
echo "Usage: $0 <machine-name-prefix>"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
machine_domain=borgboxes.network
|
||
|
node_count=4
|
||
|
node_network_dir=testnet-dir
|
||
|
chain_id=laconic_81337-6
|
||
|
|
||
|
echo "Initializing network dirs on all nodes"
|
||
|
for (( i=1 ; i<=$node_count ; i++ ));
|
||
|
do
|
||
|
node_name=${machine_name_prefix}-${i}
|
||
|
node_host_name=${node_name}.${machine_domain}
|
||
|
echo "Running initialize-network ${node_network_dir} on ${node_host_name}"
|
||
|
ssh laconic@${node_host_name} /home/laconic/bin/laconic-so --stack mainnet-laconic deploy setup --network-dir ${node_network_dir} --initialize-network --chain-id ${chain_id} --node-moniker ${node_name}
|
||
|
echo "Running join-network ${node_network_dir} on ${node_host_name}"
|
||
|
ssh laconic@${node_host_name} /home/laconic/bin/laconic-so --stack mainnet-laconic deploy setup --network-dir ${node_network_dir} --join-network --key-name ${node_name}
|
||
|
done
|