You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. #! /bin/bash
  2. set -e
  3. # assumes machines already created
  4. N_MACHINES=4
  5. MACH_PREFIX=netmon
  6. APP_INIT_SCRIPT=$GOPATH/src/github.com/tendermint/mintnet/examples/counter/app/init.sh
  7. TESTNET_DIR=~/testnets_netmon
  8. CHAINS_AND_VALS=$TESTNET_DIR/chains_and_vals.json
  9. CHAINS_DIR=$TESTNET_DIR/chains
  10. VALS_DIR=$TESTNET_DIR/validators
  11. VALSETS=(validator-set-numero-uno BOA BunkBankBandaloo victory_validators)
  12. #VALSETS=(my-val-set)
  13. CHAINS=(blockchain1 chainiac Chainelle chain-a-daisy blockchain100 bandit-chain gambit-chain gambit-chain-duo gambit-chain-1002)
  14. #CHAINS=(my-chain)
  15. mkdir -p $TESTNET_DIR
  16. echo "{}" > $CHAINS_AND_VALS
  17. echo "Make some validator sets"
  18. # make some validator sets
  19. for valset in ${VALSETS[@]}; do
  20. mintnet init validator-set $VALS_DIR/$valset
  21. netmon chains-and-vals val $CHAINS_AND_VALS $VALS_DIR/$valset
  22. done
  23. echo "Make some blockchains"
  24. # make some blockchains with each validator set
  25. for i in ${!CHAINS[@]}; do
  26. valset=$(($i % ${#VALSETS[@]}))
  27. mintnet init --machines "${MACH_PREFIX}[1-4]" chain --app $APP_INIT_SCRIPT --validator-set $VALS_DIR/${VALSETS[$valset]} $CHAINS_DIR/${CHAINS[$i]}
  28. done
  29. echo "Start the chains"
  30. for chain in ${CHAINS[@]}; do
  31. # randomize the machine order for each chain
  32. machs=`python -c "import random; x=range(1, $(($N_MACHINES+1))); random.shuffle(x); print \",\".join(map(str,x))"`
  33. echo $machs
  34. echo $chain
  35. mintnet start --publish-all --machines ${MACH_PREFIX}[$machs] app-$chain $CHAINS_DIR/$chain
  36. # add the new chain config
  37. netmon chains-and-vals chain $CHAINS_AND_VALS $CHAINS_DIR/$chain
  38. done