aboutsummaryrefslogtreecommitdiffstats
path: root/eth/test/mine.sh
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-06 00:10:42 +0800
committerobscuren <geffobscura@gmail.com>2015-01-06 00:10:42 +0800
commit6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2 (patch)
treeb898711590694cfaa6f10dbc2a4c8591232954ef /eth/test/mine.sh
parentb0854fbff5c3d588134f577918a39d08002235dc (diff)
downloadgo-tangerine-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.tar
go-tangerine-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.tar.gz
go-tangerine-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.tar.bz2
go-tangerine-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.tar.lz
go-tangerine-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.tar.xz
go-tangerine-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.tar.zst
go-tangerine-6abf8ef78f1474fdeb7a6a6ce084bf994cc055f2.zip
Merge
Diffstat (limited to 'eth/test/mine.sh')
-rw-r--r--eth/test/mine.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/eth/test/mine.sh b/eth/test/mine.sh
new file mode 100644
index 000000000..0d95db1e4
--- /dev/null
+++ b/eth/test/mine.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# bash ./mine.sh node_id timeout(sec) [basechain]
+ETH=../../ethereum
+MINE="$ETH -datadir tmp/nodes/$1 -seed=false -port '' -shh=false -id test$1"
+rm -rf tmp/nodes/$1
+echo "Creating chain $1..."
+if [[ "" != "$3" ]]; then
+ CHAIN="chains/$3.chain"
+ CHAINARG="-chain $CHAIN"
+ $MINE -mine $CHAINARG -loglevel 3 | grep 'importing'
+fi
+$MINE -mine -loglevel 0 &
+PID=$!
+sleep $2
+kill $PID
+$MINE -loglevel 3 <(echo "eth.export(\"chains/$1.chain\")") > /tmp/eth.test/mine.tmp &
+PID=$!
+sleep 1
+kill $PID
+cat /tmp/eth.test/mine.tmp | grep 'exporting'