Allow custom maxpeers

This commit is contained in:
AnilChinchawale 2019-02-26 14:39:47 +05:30
parent 0b6a7ed1ad
commit 6af0f56740

View file

@ -7,6 +7,7 @@
# - BOOTNODES (default to empty)
# - EXTIP (default to empty)
# - VERBOSITY (default to 3)
# - MAXPEERS (default to 25)
# - SYNC_MODE (default to 'full')
# - NETWORK_ID (default to '89')
# - WS_SECRET (default to empty)
@ -28,7 +29,7 @@ accountsCount=$(
# file to env
for env in IDENTITY PASSWORD PRIVATE_KEY BOOTNODES WS_SECRET NETSTATS_HOST \
NETSTATS_PORT EXTIP SYNC_MODE NETWORK_ID ANNOUNCE_TXS STORE_REWARD; do
NETSTATS_PORT EXTIP SYNC_MODE NETWORK_ID ANNOUNCE_TXS STORE_REWARD DEBUG_MODE MAXPEERS; do
file=$(eval echo "\$${env}_FILE")
if [[ -f $file ]] && [[ ! -z $file ]]; then
echo "Replacing $env by $file"
@ -55,7 +56,7 @@ if [[ ! -z $NETWORK_ID ]]; then
;;
89 )
genesisPath="testnet.json"
params="$params --XDC-testnet"
params="$params --XDC-testnet --gcmode archive --rpcapi db,eth,net,web3,personal,debug"
;;
90 )
genesisPath="devnet.json"
@ -150,6 +151,16 @@ if [[ ! -z $STORE_REWARD ]]; then
params="$params --store-reward"
fi
# debug mode
if [[ ! -z $DEBUG_MODE ]]; then
params="$params --gcmode archive --rpcapi db,eth,net,web3,personal,debug"
fi
# maxpeers
if [[ -z $MAXPEERS ]]; then
MAXPEERS=25
fi
# dump
echo "dump: $IDENTITY $account $BOOTNODES"
@ -162,7 +173,7 @@ exec XDC $params \
--identity $IDENTITY \
--password ./password \
--port 30303 \
--maxpeers 25 \
--maxpeers $MAXPEERS \
--txpool.globalqueue 5000 \
--txpool.globalslots 5000 \
--rpc \
@ -175,6 +186,6 @@ exec XDC $params \
--wsport 8546 \
--wsorigins "*" \
--mine \
--gasprice "2500" \
--gasprice "250000000" \
--targetgaslimit "84000000" \
"$@"
"$@"