Quickly configure and launch a geth --dev
ephemeral POA network.
Helpful when using geth in CI.
- 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.
npm install --save-dev geth-dev-assistant
npx geth-dev-assistant [options]
npx geth-dev-assistant \
--tag 'latest' \
--accounts 5 \
--balance 50 \
--gasLimit 12000000
# Run tests
npx mocha
# Clean-up
docker stop geth-client
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 | (varies by geth version) |
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 | http port to connect to client with | number | 8545 |
help | show help | bool | false |
- 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