aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-03 15:28:45 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:52 +0800
commite7f80a566b38c906b0a6fb5e8d60d0e68e3a510e (patch)
treefaa67b9219e93810cb4edb686c074ef2263b604b /test
parent1b8ce702f45aa122ea0d89655c5fdef5e6ddb37e (diff)
downloaddexon-e7f80a566b38c906b0a6fb5e8d60d0e68e3a510e.tar.gz
dexon-e7f80a566b38c906b0a6fb5e8d60d0e68e3a510e.tar.zst
dexon-e7f80a566b38c906b0a6fb5e8d60d0e68e3a510e.zip
test: start a separate RPC node for testing block sync
Diffstat (limited to 'test')
-rwxr-xr-xtest/run_test.sh27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/run_test.sh b/test/run_test.sh
index 91742ca4b..c07da0f8e 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -2,18 +2,43 @@
GDEX=../build/bin/gdex
+# Kill all previous instances.
pkill -9 -f gdex
+# Start bootnode.
bootnode -nodekey bootnode.key --verbosity=9 > bootnode.log 2>&1 &
logsdir=$PWD/log-$(date '+%Y-%m-%d-%H:%M:%S')
mkdir $logsdir
+rm -f log-latest
+ln -s $logsdir log-latest
+
+# A standalone RPC server for accepting RPC requests.
+datadir=$PWD/Dexon.rpc
+rm -rf $datadir
+$GDEX --datadir=$datadir init genesis.json
+$GDEX --verbosity=4 --gcmode=archive --datadir=$datadir \
+ --rpc --rpcapi=eth,net,web3,debug --rpcaddr=0.0.0.0 --rpcport=8543 \
+ --ws --wsapi=eth,net,web3,debug --wsaddr=0.0.0.0 --wsport=8544 \
+ --wsorigins='*' --rpcvhosts='*' --rpccorsdomain="*" \
+ > $logsdir/gdex.rpc.log 2>&1 &
+
+# Nodes
for i in $(seq 0 3); do
datadir=$PWD/Dexon.$i
rm -rf $datadir
$GDEX --datadir=$datadir init genesis.json
- $GDEX --verbosity=4 --gcmode=archive --datadir=$datadir --nodekey=test$i.nodekey --port=$((28000 + $i)) --rpc --rpcaddr=0.0.0.0 --rpcport=$((8545 + $i * 2)) --rpcapi=eth,net,web3,debug --ws --wsapi=eth,net,web3,debug --wsaddr=0.0.0.0 --wsport=$((8546 + $i * 2)) --wsorigins='*' --rpcvhosts='*' --rpccorsdomain="*" > $logsdir/gdex.$i.log 2>&1 &
+ $GDEX --verbosity=4 --gcmode=archive \
+ --bp \
+ --datadir=$datadir --nodekey=test$i.nodekey \
+ --port=$((30305 + $i)) \
+ --rpc --rpcapi=eth,net,web3,debug \
+ --rpcaddr=0.0.0.0 --rpcport=$((8545 + $i * 2)) \
+ --ws --wsapi=eth,net,web3,debug \
+ --wsaddr=0.0.0.0 --wsport=$((8546 + $i * 2)) \
+ --wsorigins='*' --rpcvhosts='*' --rpccorsdomain="*" \
+ > $logsdir/gdex.$i.log 2>&1 &
done
tail -f $logsdir/gdex.*.log