From 24c1fbc1db741ba0de64ee952d7d5f77426cb18a Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Tue, 5 Mar 2019 17:36:06 +0700 Subject: [PATCH 1/2] Allow custom maxpeers --- docker/tomochain/entrypoint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/tomochain/entrypoint.sh b/docker/tomochain/entrypoint.sh index c5cfcaa092..273ff70889 100755 --- a/docker/tomochain/entrypoint.sh +++ b/docker/tomochain/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 DEBUG_MODE; 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" @@ -155,6 +156,11 @@ 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" @@ -167,7 +173,7 @@ exec tomo $params \ --identity $IDENTITY \ --password ./password \ --port 30303 \ - --maxpeers 25 \ + --maxpeers $MAXPEERS \ --txpool.globalqueue 5000 \ --txpool.globalslots 5000 \ --rpc \ From 445ba3d54b6fab31186ac842206d0911040c952d Mon Sep 17 00:00:00 2001 From: Etienne Napoleone Date: Tue, 5 Mar 2019 18:03:53 +0700 Subject: [PATCH 2/2] minor organisation tweak --- docker/tomochain/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/tomochain/entrypoint.sh b/docker/tomochain/entrypoint.sh index 273ff70889..4ccb515748 100755 --- a/docker/tomochain/entrypoint.sh +++ b/docker/tomochain/entrypoint.sh @@ -171,9 +171,9 @@ exec tomo $params \ --datadir $DATA_DIR \ --keystore $KEYSTORE_DIR \ --identity $IDENTITY \ + --maxpeers $MAXPEERS \ --password ./password \ --port 30303 \ - --maxpeers $MAXPEERS \ --txpool.globalqueue 5000 \ --txpool.globalslots 5000 \ --rpc \