github.com/karalabe/go-ethereum@v0.8.5/eth/test/mine.sh (about) 1 #!/bin/bash 2 # bash ./mine.sh node_id timeout(sec) [basechain] 3 ETH=../../ethereum 4 MINE="$ETH -datadir tmp/nodes/$1 -seed=false -port '' -shh=false -id test$1" 5 rm -rf tmp/nodes/$1 6 echo "Creating chain $1..." 7 if [[ "" != "$3" ]]; then 8 CHAIN="chains/$3.chain" 9 CHAINARG="-chain $CHAIN" 10 $MINE -mine $CHAINARG -loglevel 3 | grep 'importing' 11 fi 12 $MINE -mine -loglevel 0 & 13 PID=$! 14 sleep $2 15 kill $PID 16 $MINE -loglevel 3 <(echo "eth.export(\"chains/$1.chain\")") > /tmp/eth.test/mine.tmp & 17 PID=$! 18 sleep 1 19 kill $PID 20 cat /tmp/eth.test/mine.tmp | grep 'exporting'