ganache-cli

Fast Ethereum RPC client

Subcommands

NameDescription
forkCacheSizeThe maximum size, in bytes, of the in-memory cache for queries on a chain fork. Defaults to 1_073_741_824 bytes (1 gigabyte)

Options

NameDescription
-a, --accounts <number>Specify the number of accounts to generate at startup
-e, --defaultBalanceEther <number>Amount of ether to assign each test account. Default is 100
-b, --blockTime <seconds>Specify blockTime in seconds for automatic mining. If you don't specify this flag, ganache will instantly mine a new block for every transaction
-d, --deterministicGenerate deterministic addresses based on a pre-defined mnemonic
-n, --secureLock available accounts by default (good for third party transaction signing)
-m, --mnemonicUse a bip39 mnemonic phrase for generating a PRNG seed, which is in turn used for hierarchical deterministic (HD) account generation
-p, --port <port number>Port number to listen on. Defaults to 8545
-h, --host <Hostname>Hostname to listen on. Defaults to 127.0.0.1 (defaults to 0.0.0.0 for Docker instances of ganache-cli)
-s, --seedUse arbitrary data to generate the HD wallet mnemonic to be used
-g, --gasPrice <price>The price of gas in wei (defaults to 20000000000)
-l, --gasLimit <limit>The block gas limit (defaults to 0x6691b7)
--callGasLimit <limit>Sets the transaction gas limit for eth_call and eth_estimateGas calls
-k, --hardfork <hardfork>Allows users to specify which hardfork should be used
-f, --fork <HTTP location & port>Fork from another currently running Ethereum client at a given block. Input should be the HTTP location and port of the other client
-i, --networkId <Network ID>Specify the network id ganache-cli will use to identify itself (defaults to the current time or the network id of the forked blockchain if configured)
--chainId <Chain ID>Specify the Chain ID ganache-cli will use for eth_chainId RPC and the CHAINID opcode
--db <folder>Specify a path to a directory to save the chain database. If a database already exists, ganache-cli will initialize that chain instead of creating a new one
--debugOutput VM opcodes for debugging
--memOutput ganache-cli memory usage statistics. This replaces normal output
-q, --quietRun ganache-cli without any logs
-?, --helpDisplay help information
--versionDisplay the version of ganache-cli
--account_keys_path, --acctKeys <file>Specifies a file to save accounts and private keys to, for testing
--noVMErrorsOnRPCResponseDo not transmit transaction failures as RPC errors
--allowUnlimitedContractSizeAllows unlimited contract sizes while debugging
--keepAliveTimeout <timeout>Sets the HTTP server's keepAliveTimeout in milliseconds
-t, --time <date>Date (ISO 8601) that the first block should start
--account <<privatekey>, balance...>Specify any number of times passing arbitrary private keys and their associated balances to generate initial addresses
-u, --unlock <address or account index...>Specify any number of times passing either an address or an account index to unlock specific accounts