{"modulePath":"github.com/smartcontractkit/chainlink-testing-framework/framework","version":"v0.17.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package rpc\n\n## Types\n\n```go\ntype AnvilContainer struct {\n\ttestcontainers.Container\n\tURL string\n}\n```\n\n```go\nfunc StartAnvil(params []string) (*AnvilContainer, error)\n```\n\n```go\ntype BlockResponse struct {\n\tJsonrpc string        `json:\"jsonrpc\"`\n\tID      int           `json:\"id\"`\n\tResult  *types.Header `json:\"result\"`\n}\n```\n\n```go\ntype CurrentBlockResponse struct {\n\tResult string `json:\"result\"`\n}\n```\n\n```go\ntype GethContainer struct {\n\ttestcontainers.Container\n\tURL string\n}\n```\n\n```go\ntype RPCClient struct {\n\tURL string\n\t// contains filtered or unexported fields\n}\n```\nRPCClient is an RPC client for various node simulators API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/) TODO: fix in next PRs nolint\n\n```go\nfunc New(url string, headers http.Header) *RPCClient\n```\nNew creates new RPC client that can be used with Geth or Anvil this is a high level wrapper for common calls we use\n\n```go\nfunc (m *RPCClient) AnvilAutoImpersonate(b bool) error\n```\nAnvilAutoImpersonate sets auto impersonification to true or false\n\n```go\nfunc (m *RPCClient) AnvilDropTransaction(params []interface{}) error\n```\nAnvilDropTransaction removes transaction from tx pool API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/)\n\n```go\nfunc (m *RPCClient) AnvilMine(params []interface{}) error\n```\nAnvilMine calls \"evm\\_mine\", mines one or more blocks, see the reference on RPCClient API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/)\n\n```go\nfunc (m *RPCClient) AnvilSetAutoMine(flag bool) error\n```\nAnvilSetAutoMine calls \"evm\\_setAutomine\", turns automatic mining on, see the reference on RPCClient API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/)\n\n```go\nfunc (m *RPCClient) AnvilSetBlockGasLimit(params []interface{}) error\n```\nAnvilSetBlockGasLimit sets next block gas limit API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/)\n\n```go\nfunc (m *RPCClient) AnvilSetMinGasPrice(gas uint64) error\n```\nAnvilSetMinGasPrice sets min gas price (pre-EIP-1559 anvil is required) API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/)\n\n```go\nfunc (m *RPCClient) AnvilSetNextBlockBaseFeePerGas(gas *big.Int) error\n```\nAnvilSetNextBlockBaseFeePerGas sets next block base fee per gas value API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/)\n\n```go\nfunc (m *RPCClient) AnvilSetStorageAt(params []interface{}) error\n```\nAnvilSetStorageAt sets storage at address API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/)\n\n```go\nfunc (m *RPCClient) AnvilTxPoolStatus(params []interface{}) (*TxStatusResponse, error)\n```\nAnvilTxPoolStatus calls \"txpool\\_status\", returns txpool status, see the reference on RPCClient API Reference [https://book.getfoundry.sh/reference/anvil/](https://book.getfoundry.sh/reference/anvil/)\n\n```go\nfunc (m *RPCClient) BlockNumber() (int64, error)\n```\nCall \"eth\\_blockNumber\" to get the current block number\n\n```go\nfunc (m *RPCClient) EVMIncreaseTime(seconds uint64) error\n```\nEVMIncreaseTime jumps forward in time by \\`seconds\\`. The parameter is a JSON number (in seconds)\n\n```go\nfunc (m *RPCClient) GetHeaderByNumber(blockNumber int64) (*types.Header, error)\n```\nGetHeaderByNumber retrieves block details by block number this is purely debug method to verify the gas chaos is applied\n\n```go\nfunc (m *RPCClient) GethSetHead(blocksBack int) error\n```\n\n```go\nfunc (m *RPCClient) PrintBlockBaseFee() error\n```\nPrintBlockBaseFee prints block base fee this is purely debug method to verify gas chaos is applied\n\n```go\ntype RemoteAnvilMiner struct {\n\tClient *RPCClient\n\t// contains filtered or unexported fields\n}\n```\nRemoteAnvilMiner is a remote miner for Anvil node Allows to control blocks emission more precisely to mimic real networks workload\n\n```go\nfunc NewRemoteAnvilMiner(url string, headers http.Header) *RemoteAnvilMiner\n```\nNewRemoteAnvilMiner creates a new remote miner client\n\n```go\nfunc (m *RemoteAnvilMiner) MineBatch(capacity int64, checkInterval time.Duration, sendInterval time.Duration)\n```\nMineBatch checks the pending transactions in the pool, if threshold is reached mines the block and repeat the process\n\n```go\nfunc (m *RemoteAnvilMiner) MinePeriodically(interval time.Duration)\n```\nMinePeriodically mines blocks with a specified interval should be used when Anvil mining is off\n\n```go\nfunc (m *RemoteAnvilMiner) Stop()\n```\nStop stops the miner\n\n```go\ntype TxStatusResponse struct {\n\tResult struct {\n\t\tPending string `json:\"pending\"`\n\t} `json:\"result\"`\n}\n```\nTxStatusResponse common RPC response body\n\n","path":"github.com/smartcontractkit/chainlink-testing-framework/framework/rpc","name":"rpc","synopsis":"","isRedistributable":true}
