From d722cab5239dbd9938f5a99ab4f5aa8b1e7a078e Mon Sep 17 00:00:00 2001 From: Dumi Loghin Date: Fri, 2 Nov 2018 09:24:49 +0000 Subject: [PATCH] start ethereum takes number of miner threads as parameter --- src/micro/ethereum_script/start_ethereum.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/micro/ethereum_script/start_ethereum.sh b/src/micro/ethereum_script/start_ethereum.sh index e32a1f49..b56479cd 100755 --- a/src/micro/ethereum_script/start_ethereum.sh +++ b/src/micro/ethereum_script/start_ethereum.sh @@ -10,6 +10,16 @@ rm -rf $ETH_DATA/{geth,keystore} mkdir -p $ETH_DATA/keystore cp ./key/* $ETH_DATA/keystore +# miner threads +NM=1 +if [ $# -gt 0 ]; then + NM=$1 +fi +echo "Starting geth with $NM miner threads" + # ------------private chain(10 accounts)------------ +# geth 1.4.18 uses --minerthreads +# geth 1.8.15 uses --miner.threads + $GETH --datadir=$ETH_DATA init genesis.json -$GETH --datadir=$ETH_DATA --nodiscover --rpcapi="db,eth,net,web3,personal,web3" --rpc --rpcaddr "localhost" --rpcport "8545" --rpccorsdomain "*" --gasprice 0 --maxpeers 32 --networkid 9119 --unlock "0x12f029d57082315085bfb4d4d8345c92c5cdd881" --password <(echo -n "") --mine --minerthreads 4 +$GETH --datadir=$ETH_DATA --nodiscover --rpcapi="db,eth,net,web3,personal,web3" --rpc --rpcaddr "localhost" --rpcport "8545" --rpccorsdomain "*" --gasprice 0 --maxpeers 32 --networkid 9119 --unlock "0x12f029d57082315085bfb4d4d8345c92c5cdd881" --password <(echo -n "") --mine --minerthreads $NM > /dev/null 2>&1 &