# @chainsafe/geth-dev-assistant

> Configuration utility for geth's `--dev` ephemeral POA network.

Latest version **0.1.11** (published 2021-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @chainsafe/geth-dev-assistant
pnpm add @chainsafe/geth-dev-assistant
yarn add @chainsafe/geth-dev-assistant
bun add @chainsafe/geth-dev-assistant
```

Provides the command `geth-dev-assistant`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2021-07-06 |
| First published | 2020-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 19.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | cgewecke |
| Maintainers | priom, gregthegreek |
| Keywords | go, ethereum, CI |

## Links

- npm: https://www.npmjs.com/package/@chainsafe/geth-dev-assistant
- Repository: https://github.com/cgewecke/geth-dev-assistant
- Homepage: https://github.com/cgewecke/geth-dev-assistant#readme
- Issues: https://github.com/cgewecke/geth-dev-assistant/issues
- npm.io page: https://npm.io/package/@chainsafe/geth-dev-assistant

## Dependencies (4)

- [web3](https://npm.io/package/web3.md) ^1.4.0
- [yargs](https://npm.io/package/yargs.md) ^13.2.2
- [colors](https://npm.io/package/colors.md) ^1.3.3
- [node-emoji](https://npm.io/package/node-emoji.md) ^1.10.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.1.11 (latest) — 2021-07-06
- 0.1.10 — 2021-05-13
- 0.1.9 — 2021-03-12
- 0.1.5 — 2020-08-18

## README

# 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](https://user-images.githubusercontent.com/7332026/57965995-0fe36600-7901-11e9-94eb-83a49b171bcb.png)

+ 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
```shell
npm install --save-dev geth-dev-assistant
```

### Run
```shell
npx geth-dev-assistant [options]
```

### Usage Example
```shell
npx geth-dev-assistant \
    --tag 'latest' \
    --accounts 5 \
    --balance 50 \
    --gasLimit 12000000

# 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 | (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                   |


### Other resources
+ A POA network setup using genesis.json [at 0xProject](https://github.com/0xProject/0x-monorepo/blob/development/packages/devnet/genesis.json).
+ [ethnode](https://github.com/vrde/ethnode) a zero config tool to run a local Ethereum dev node (geth & parity!)
+ Geth client options [wiki](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options)

---
_Source: https://npm.io/package/@chainsafe/geth-dev-assistant · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
