aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-02-25 20:35:36 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:50:03 +0800
commit96bec15ef46df2b490fee1edca856766e60e60bd (patch)
tree283b276b7d3d90252eb820ca474525693ad9bc06
parent41beca8eef01ed7db55b4d1f17dc32b7ea2d171b (diff)
downloaddexon-96bec15ef46df2b490fee1edca856766e60e60bd.tar.gz
dexon-96bec15ef46df2b490fee1edca856766e60e60bd.tar.zst
dexon-96bec15ef46df2b490fee1edca856766e60e60bd.zip
test: build bootnode if not exist
-rwxr-xr-xtest/run_test.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/run_test.sh b/test/run_test.sh
index 60f7cad82..f995393f6 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -2,10 +2,17 @@
NETWORK="--bootnodes enode://0478aa13c91aa0db8e93b668313b7eb0532fbdb24f64772375373b14dbe326c238ad09ab4469f6442c9a9753f1275aeec2e531912c14a958ed1feb4ae7e227ef@127.0.0.1:30301"
GENESIS="genesis.json"
-# Start bootnode.
-../build/bin/bootnode -nodekey keystore/bootnode.key --verbosity=9 > bootnode.log 2>&1 &
-GDEX=../build/bin/gdex
+GDEX="../build/bin/gdex"
+BOOTNODE="../build/bin/bootnode"
+
+if [ ! -e "$BOOTNODE" ]; then
+ echo "Building bootnode for the first time ..."
+ go build -o $BOOTNODE ../cmd/bootnode
+fi
+
+# Start bootnode.
+$BOOTNODE -nodekey keystore/bootnode.key --verbosity=9 > bootnode.log 2>&1 &
# Kill all previous instances.
pkill -9 -f gdex