Ganache Ethereum JSON-RPC Documentation

submited by
Style Pass
2023-03-16 00:30:06

This reference describes all Ganache JSON-RPC methods and provides interactive examples for each method. The interactive examples are powered by Ganache in the Browser and demonstrate using Ganache programmatically as an EIP-1193 provider. Try running these examples to see Ganache in action! Each editor can be changed to further test Ganache features.

Pro Tip: You can define your own provider by adding const provider = ganache.provider({}) to the start of any example and passing in your startup options.

State Override object - An address-to-state mapping, where each entry specifies some state to be ephemerally overridden prior to executing the call. Each address maps to an object containing:

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.

Returns a collection of historical block gas data and optional effective fee spent per unit of gas for a given percentile of block gas usage.

Leave a Comment