Skip to content

Commit

Permalink
start ethereum takes number of miner threads as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dloghin committed Nov 2, 2018
1 parent 701492a commit d722cab
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/micro/ethereum_script/start_ethereum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &

0 comments on commit d722cab

Please sign in to comment.