From 6af0f5674098e64d2895cce2fc52b1134d7e1ac8 Mon Sep 17 00:00:00 2001 From: AnilChinchawale Date: Tue, 26 Feb 2019 14:39:47 +0530 Subject: [PATCH] Allow custom maxpeers --- docker/XDCchain/entrypoint.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docker/XDCchain/entrypoint.sh b/docker/XDCchain/entrypoint.sh index 2f21edf521..2865703c56 100755 --- a/docker/XDCchain/entrypoint.sh +++ b/docker/XDCchain/entrypoint.sh @@ -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" \ - "$@" + "$@" \ No newline at end of file