@laborx/command-ganache-plugin
v0.1.10
Published
Provides ganache plugin for node's Command
Downloads
46
Keywords
Readme
Ganache plugin for Command
Provides an extension of Ganache for Command.
Install
yarn add -D @laborx/command-ganache-plugin
Usage
- Create
testrpc.json
(or with other config filename) and specify ganache configuration, for example:
{
"network_id": 666,
"host": "127.0.0.1",
"port": 8546,
"db_path": "./data/blockchain",
"gasPrice": 1,
"gasLimit": 8000000,
"account_keys_path": "./test-accounts.json",
"mnemonic": "brave dry ride escape panther wave wife coin input come cash survey"
}
Other options from ganache-cli specification could be added as-is.
CLI
Run from command line with the following syntax
npx -p @laborx/command-ganache-plugin ganache-runner ganache --config=./testrpc.json
or in package.json
{
"scripts": {
"ganache-runner": "ganache-runner",
"ganache": "yarn ganache-runner ganache --config=./testrpc.json"
}
}
From code
import { runGanache } from "@laborx/command-ganache-plugin";
const server = runGanache({ config: "./testrpc.json" })