Skip to content

Commit 4b53ea7

Browse files
authored
avoid peer script in new devnet with 460 nodes (#2349)
* ci: add NODE_KEY handling and config.toml support * ci: restore NODE_KEY handling before XDC initialization
1 parent 3bacbce commit 4b53ea7

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

cicd/devnet/start.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/bin/bash
2+
3+
# Restore nodekey from secret before XDC init runs, so init does not generate a new one.
4+
if [ -n "$NODE_KEY" ] && [ ! -f /work/xdcchain/XDC/nodekey ]; then
5+
mkdir -p /work/xdcchain/XDC
6+
echo "$NODE_KEY" > /work/xdcchain/XDC/nodekey
7+
echo "Restored nodekey from NODE_KEY secret."
8+
fi
9+
210
if [ ! -d /work/xdcchain/XDC/chaindata ]
311
then
412
if test -z "$PRIVATE_KEY"
@@ -118,10 +126,16 @@ fi
118126
echo "Running a node with wallet: ${wallet} at IP: ${instance_ip}"
119127
echo "Starting nodes with $bootnodes ..."
120128

129+
config_arg=""
130+
if [ -f /work/config.toml ]; then
131+
echo "config.toml found, using static peers from --config /work/config.toml"
132+
config_arg="--config /work/config.toml"
133+
fi
134+
121135
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
122136
# https://github.com/XinFinOrg/XDPoSChain/issues/268
123137

124-
XDC --ethstats ${netstats} \
138+
XDC ${config_arg} --ethstats ${netstats} \
125139
--gcmode ${gc_mode} --syncmode ${sync_mode} \
126140
--nat extip:${instance_ip} \
127141
--bootnodes ${bootnodes} \

0 commit comments

Comments
 (0)