0.1.11 • Published 3 years ago

@chainsafe/geth-dev-assistant v0.1.11

Weekly downloads
132
License
MIT
Repository
github
Last release
3 years ago

geth-dev-assistant

Quickly configure and launch a geth --dev ephemeral POA network. Helpful when using geth in CI.

Screen Shot 2019-05-18 at 12 06 40 AM

  • Pulls a specified geth docker image from Docker Hub
  • Launches a docker geth instance as a background process
  • Waits until geth is ready to receive calls over http / websockets
  • (Optionally) creates, unlocks and funds some password generated accounts
  • (Optionally) mines blocks with no-op txs until a gas limit target is reached.

Geth --dev seeds with a single funded account and has a relatively low default block gas limit (~ 10 mil). If the client's mining period is set to 0, it needs to be spun with transactions before a higher gas limit target is reached.

Install

npm install --save-dev geth-dev-assistant

Run

npx geth-dev-assistant [options]

Usage Example

npx geth-dev-assistant \
    --tag 'latest' \
    --accounts 5 \
    --balance 50 \
    --gasLimit 12000000

# Run tests
npx mocha

# Clean-up
docker stop geth-client

Options

OptionDescriptionTypeDefault
accountsnumber of accounts to create / unlocknumber0 (use default acct)
passwordfor geth accountsstring"left-hand-of-darkness"
balancenew account starting balances (in ETH)number100
gasLimitblock gas limit target to mine towardsnumber(varies by geth version)
launchpull and launch a geth docker instancebooltrue
reporoot docker repo (useful for forks)string'ethereum/client-go'
taggeth version / docker tag to fetchstring'stable'
offlinedo not pull image from docker hubboolfalse
sleepmax seconds to wait for geth to spin upnumber10
periodautomining intervalnumber0 (insta-mine)
porthttp port to connect to client withnumber8545
helpshow helpboolfalse

Other resources

  • A POA network setup using genesis.json at 0xProject.
  • ethnode a zero config tool to run a local Ethereum dev node (geth & parity!)
  • Geth client options wiki
0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.5

4 years ago