Browse Source

add setup.sh

pull/1943/head
Ethan Buchman 9 years ago
parent
commit
ec8fd017a5
1 changed files with 43 additions and 0 deletions
  1. +43
    -0
      setup.sh

+ 43
- 0
setup.sh View File

@ -0,0 +1,43 @@
#! /bin/bash
set -e
# assumes machines already created
N_MACHINES=4
TESTNET_DIR=~/testnets
CHAINS_AND_VALS=$TESTNET_DIR/chains_and_vals.json
CHAINS_DIR=$TESTNET_DIR/chains
VALS_DIR=$TESTNET_DIR/validators
VALSETS=(validator-set-numero-uno BOA BunkBankBandaloo victory_validators)
#VALSETS=(my-val-set)
CHAINS=(blockchain1 chainiac Chainelle chain-a-daisy blockchain100 bandit-chain gambit-chain gambit-chain-duo gambit-c hain-1002)
#CHAINS=(my-chain)
mkdir -p $TESTNET_DIR
echo "{}" > $CHAINS_AND_VALS
echo "Make some validator sets"
# make some validator sets
for valset in ${VALSETS[@]}; do
mintnet init validator-set $VALS_DIR/$valset
netmon chains-and-vals val $CHAINS_AND_VALS $VALS_DIR/$valset
done
echo "Make some blockchains"
# make some blockchains with each validator set
for i in ${!CHAINS[@]}; do
valset=$(($i % ${#VALSETS[@]}))
echo $valset
mintnet init chain --validator-set $VALS_DIR/${VALSETS[$valset]} $CHAINS_DIR/${CHAINS[$i]}
done
echo "Start the chains"
for chain in ${CHAINS[@]}; do
machs=`python -c "import random; x=range(1, $(($N_MACHINES+1))); random.shuffle(x); print \",\".join(map(str,x))"`
echo $machs
echo $chain
mintnet start --publish-all --machines mach[$machs] app-$chain $CHAINS_DIR/$chain
netmon chains-and-vals chain $CHAINS_AND_VALS $CHAINS_DIR/$chain
done

Loading…
Cancel
Save