mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
make start script accept SYNC_MODE and GC_MODE
This commit is contained in:
parent
e83b87a80e
commit
a78982814b
3 changed files with 63 additions and 6 deletions
|
|
@ -77,6 +77,24 @@ else
|
||||||
instance_ip=$INSTANCE_IP
|
instance_ip=$INSTANCE_IP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sync_mode=full
|
||||||
|
if test -z "$SYNC_MODE"
|
||||||
|
then
|
||||||
|
echo "SYNC_MODE not set, default to full" #full or fast
|
||||||
|
else
|
||||||
|
echo "SYNC_MODE found, set to $SYNC_MODE"
|
||||||
|
sync_mode=$SYNC_MODE
|
||||||
|
fi
|
||||||
|
|
||||||
|
gc_mode=archive
|
||||||
|
if test -z "$GC_MODE"
|
||||||
|
then
|
||||||
|
echo "GC_MODE not set, default to archive" #full or archive
|
||||||
|
else
|
||||||
|
echo "GC_MODE found, set to $GC_MODE"
|
||||||
|
gc_mode=$GC_MODE
|
||||||
|
fi
|
||||||
|
|
||||||
netstats="${NODE_NAME}-${wallet}-${instance_ip}:xinfin_xdpos_hybrid_network_stats@devnetstats.hashlabs.apothem.network:1999"
|
netstats="${NODE_NAME}-${wallet}-${instance_ip}:xinfin_xdpos_hybrid_network_stats@devnetstats.hashlabs.apothem.network:1999"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -86,9 +104,10 @@ echo "Starting nodes with $bootnodes ..."
|
||||||
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
|
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
|
||||||
# https://github.com/XinFinOrg/XDPoSChain/issues/268
|
# https://github.com/XinFinOrg/XDPoSChain/issues/268
|
||||||
|
|
||||||
XDC --ethstats ${netstats} --gcmode archive \
|
XDC --ethstats ${netstats} \
|
||||||
|
--gcmode ${gc_mode} --syncmode ${sync_mode} \
|
||||||
--nat extip:${instance_ip} \
|
--nat extip:${instance_ip} \
|
||||||
--bootnodes ${bootnodes} --syncmode full \
|
--bootnodes ${bootnodes} \
|
||||||
--datadir /work/xdcchain --networkid 551 \
|
--datadir /work/xdcchain --networkid 551 \
|
||||||
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
||||||
--http-port $rpc_port \
|
--http-port $rpc_port \
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,24 @@ else
|
||||||
ws_port=$WS_PORT
|
ws_port=$WS_PORT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sync_mode=full
|
||||||
|
if test -z "$SYNC_MODE"
|
||||||
|
then
|
||||||
|
echo "SYNC_MODE not set, default to full" #full or fast
|
||||||
|
else
|
||||||
|
echo "SYNC_MODE found, set to $SYNC_MODE"
|
||||||
|
sync_mode=$SYNC_MODE
|
||||||
|
fi
|
||||||
|
|
||||||
|
gc_mode=archive
|
||||||
|
if test -z "$GC_MODE"
|
||||||
|
then
|
||||||
|
echo "GC_MODE not set, default to archive" #full or archive
|
||||||
|
else
|
||||||
|
echo "GC_MODE found, set to $GC_MODE"
|
||||||
|
gc_mode=$GC_MODE
|
||||||
|
fi
|
||||||
|
|
||||||
INSTANCE_IP=$(curl https://checkip.amazonaws.com)
|
INSTANCE_IP=$(curl https://checkip.amazonaws.com)
|
||||||
netstats="${NODE_NAME}-${wallet}-${INSTANCE_IP}:xinfin_xdpos_hybrid_network_stats@stats.xinfin.network:3000"
|
netstats="${NODE_NAME}-${wallet}-${INSTANCE_IP}:xinfin_xdpos_hybrid_network_stats@stats.xinfin.network:3000"
|
||||||
|
|
||||||
|
|
@ -77,9 +95,10 @@ echo "Starting nodes with $bootnodes ..."
|
||||||
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
|
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
|
||||||
# https://github.com/XinFinOrg/XDPoSChain/issues/268
|
# https://github.com/XinFinOrg/XDPoSChain/issues/268
|
||||||
|
|
||||||
XDC --ethstats ${netstats} --gcmode archive \
|
XDC --ethstats ${netstats} \
|
||||||
|
--gcmode ${gc_mode} --syncmode ${sync_mode} \
|
||||||
--nat extip:${INSTANCE_IP} \
|
--nat extip:${INSTANCE_IP} \
|
||||||
--bootnodes ${bootnodes} --syncmode full \
|
--bootnodes ${bootnodes} \
|
||||||
--datadir /work/xdcchain --networkid 50 \
|
--datadir /work/xdcchain --networkid 50 \
|
||||||
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
||||||
--http-port $rpc_port \
|
--http-port $rpc_port \
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,24 @@ else
|
||||||
ws_port=$WS_PORT
|
ws_port=$WS_PORT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sync_mode=full
|
||||||
|
if test -z "$SYNC_MODE"
|
||||||
|
then
|
||||||
|
echo "SYNC_MODE not set, default to full" #full or fast
|
||||||
|
else
|
||||||
|
echo "SYNC_MODE found, set to $SYNC_MODE"
|
||||||
|
sync_mode=$SYNC_MODE
|
||||||
|
fi
|
||||||
|
|
||||||
|
gc_mode=archive
|
||||||
|
if test -z "$GC_MODE"
|
||||||
|
then
|
||||||
|
echo "GC_MODE not set, default to archive" #full or archive
|
||||||
|
else
|
||||||
|
echo "GC_MODE found, set to $GC_MODE"
|
||||||
|
gc_mode=$GC_MODE
|
||||||
|
fi
|
||||||
|
|
||||||
INSTANCE_IP=$(curl https://checkip.amazonaws.com)
|
INSTANCE_IP=$(curl https://checkip.amazonaws.com)
|
||||||
netstats="${NODE_NAME}-${wallet}-${INSTANCE_IP}:xdc_xinfin_apothem_network_stats@stats.apothem.network:2000"
|
netstats="${NODE_NAME}-${wallet}-${INSTANCE_IP}:xdc_xinfin_apothem_network_stats@stats.apothem.network:2000"
|
||||||
|
|
||||||
|
|
@ -79,9 +97,10 @@ echo "Starting nodes with $bootnodes ..."
|
||||||
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
|
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
|
||||||
# https://github.com/XinFinOrg/XDPoSChain/issues/268
|
# https://github.com/XinFinOrg/XDPoSChain/issues/268
|
||||||
|
|
||||||
XDC --ethstats ${netstats} --gcmode archive \
|
XDC --ethstats ${netstats} \
|
||||||
|
--gcmode ${gc_mode} --syncmode ${sync_mode} \
|
||||||
--nat extip:${INSTANCE_IP} \
|
--nat extip:${INSTANCE_IP} \
|
||||||
--bootnodes ${bootnodes} --syncmode full \
|
--bootnodes ${bootnodes} \
|
||||||
--datadir /work/xdcchain --networkid 51 \
|
--datadir /work/xdcchain --networkid 51 \
|
||||||
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
||||||
--http-port $rpc_port \
|
--http-port $rpc_port \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue