github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/tests/web3/truffle.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  chain=$(mktemp -d)
     4  cd $chain
     5  $burrow_bin spec -v1 -d2 | $burrow_bin configure -s- --curve-type secp256k1 > burrow.toml
     6  $burrow_bin start &> /dev/null &
     7  burrow_pid=$!
     8  
     9  contracts=$(mktemp -d)
    10  cd $contracts
    11  
    12  function finish {
    13      kill -TERM $burrow_pid
    14      rm -rf "$chain"
    15      rm -rf "$contracts"
    16  }
    17  trap finish EXIT
    18  
    19  npm install -g truffle
    20  truffle unbox metacoin
    21  
    22  cat << EOF > truffle-config.js
    23  module.exports = {
    24    networks: {
    25     burrow: {
    26       host: "127.0.0.1",
    27       port: 26660,
    28       network_id: "*",
    29     },
    30    }
    31  };
    32  EOF
    33  truffle test --network burrow