geth-dev-assistant

0.1.8 • Public • Published

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 (~ 6 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 \
    --launch \
    --tag 'latest' \
    --accounts 5 \
    --balance 50 \
    --gasLimit 7000000
 
# Run tests 
npx mocha
 
# Clean-up 
docker stop geth-client

Options

Option Description Type Default
accounts number of accounts to create / unlock number 0 (use default acct)
password for geth accounts string "left-hand-of-darkness"
balance new account starting balances (in ETH) number 100
gasLimit block gas limit target to mine towards number 5900000
launch pull and launch a geth docker instance bool true
repo root docker repo (useful for forks) string 'ethereum/client-go'
tag geth version / docker tag to fetch string 'stable'
offline do not pull image from docker hub bool false
sleep max seconds to wait for geth to spin up number 10
period automining interval number 0 (insta-mine)
port port to connect to client with number 8545
help show help bool false

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

Readme

Keywords

Package Sidebar

Install

npm i geth-dev-assistant

Weekly Downloads

90

Version

0.1.8

License

MIT

Unpacked Size

19.7 kB

Total Files

12

Last publish

Collaborators

  • cgewecke