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.

43 lines
1.3 KiB

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