Debug API
The 4EVERLAND RPC Debug API allows developers to trace and analyze executed transactions and blocks on the blockchain. This comprehensive guide provides detailed instructions on how to utilize the Debug API effectively. Please note that the examples below are based on the BSC mainnet, and the endpoint URL should be replaced with the network's endpoint for other networks.
Endpoints
The Debug API endpoints follow the structure:
Endpoint:
https://{chain-network}.4everland.org/v1/{apikey}
Supported Networks(mainnet): BSC, Ethereum, Polygon.
debug_traceBlockByHash
debug_traceBlockByHash
This method enables the tracing of a specific block by its hash. It returns an array of block traces, including details such as type, sender address, receiver address, value, gas details, input data, output, errors, and sub-calls.
Parameters
String: Block hash for the block to be traced
tracer
Object: Currently only supportscallTracer
Returns
The request will return an array of block traces
type
string : CALL or CREATEfrom
string: 20 Bytes - address of the senderto
string: 20 Bytes - address of the receiver. null when its a contract creation transactionvalue
string: amount of value for transfer (in hex)gas
string: amount of gas provided for the call (in hex)gasUsed
string: amount of gsa used during the call (in hex)input
string: call dataoutput
string: return dataerror
string: error, if anyrevertReason
string: solidity revert reason, if anycalls
string: list of sub-calls
Example Request
Result
debug_traceBlockByNumber
debug_traceBlockByNumber
Similar to the debug_traceBlockByHash method, this method allows tracing based on the block number or tag. It returns an array of block traces with details similar to the previous method.
Parameters
String - Either the hex value of a block number OR One of the following block tags:
pending
- A sample next block built by the client on top of latest and containing the set of transactions usually taken from local mempool. Intuitively, you can think of these as blocks that have not been mined yet.latest
- The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions.safe
- The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is “unlikely” to be re-orged. Only available on Ethereum Mainnet and Goerli.finalized
- The most recent crypto-economically secure block, that has been accepted by >2/3 of validators. Cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is very unlikely to be re-orged. Only available on Ethereum Mainnet and Goerli.earliest
- The lowest numbered block the client has available. Intuitively, you can think of this as the first block created.
tracer
Object - Currently only supportscallTracer
(see above for definition).
Returns
The request will return an array of block traces
type
string : CALL or CREATEfrom
string: 20 Bytes - address of the senderto
string: 20 Bytes - address of the receiver. null when its a contract creation transactionvalue
string: amount of value for transfer (in hex)gas
string: amount of gas provided for the call (in hex)gasUsed
string: amount of gas used during the call (in hex)input
string: call dataoutput
string: return dataerror
string: error, if anyrevertReason
string: solidity revert reason, if anycalls
string: list of sub-calls
Example Request
Result
debug_traceTransaction
debug_traceTransaction
This method enables the tracing of a specific transaction by its hash. It returns an array of block traces providing detailed information about the transaction's execution, similar to the block tracing methods.
Parameters
String - Transaction hash
Object - options for call, can be any of the following options:
tracer
: Object - Currently only supportscallTracer
(see above for definition).timeout
: STRING - A duration string of decimal numbers that overrides the default timeout of 5 seconds for JavaScript-based tracing calls. Max timeout is "10s". Valid time units are "ns", "us", "ms", "s" each with optional fractions, such as "300ms" or "2s45ms".
Returns
The request will return an array of block traces
type
string : CALL or CREATEfrom
string: 20 Bytes - address of the senderto
string: 20 Bytes - address of the receiver. null when its a contract creation transactionvalue
string: amount of value for transfer (in hex)gas
string: amount of gas provided for the call (in hex)gasUsed
string: amount of gas used during the call (in hex)input
string: call dataoutput
string: return dataerror
string: error, if anyrevertReason
string: solidity revert reason, if anycalls
string: list of sub-calls
Example Request
Result
debug_traceCall
debug_traceCall
The debug_traceCall method allows tracing specific calls within a transaction, providing detailed information about the call’s execution, similar to the transaction tracing methods.
Parameters
Object - Transaction object
from
: string 20 Bytes - The address the transaction is sent from.to
: string (required) 20 Bytes - The address the transaction is directed togasprice
: string Integer of the gasPrice used for each paid gas.(note:most of our users(95%+) never set the gasPrice on eth_call)value
: string Integer of the value sent with this transactiondata
: string Hash of the method signature and encoded parameters
String - Block hash, block number (in hex), or block tag One of the following options: - block hash - block number (in hex) - block tag (one of the following): `pending` - A sample next block built by the client on top of latest and containing the set of transactions usually taken from local mempool. Intuitively, you can think of these as blocks that have not been mined yet. * `latest` - The most recent block in the canonical chain observed by the client. This block may be re-orged out of the canonical chain even under healthy/normal conditions. * `safe` - The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination.Intuitively, this block is “unlikely” to be re-orged. Only available on Ethereum Mainnet and Goerli. * `finalized` - The most recent crypto-economically secure block, that has been accepted by >2/3 of validators. Cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is very unlikely to be re-orged. Only available on Ethereum Mainnet and Goerli. * `earliest` - The lowest numbered block the client has available. Intuitively, you can think of this as the first block created.
Returns
The request will return an array of block traces
type
string : CALL or CREATEfrom
string: 20 Bytes - address of the senderto
string: 20 Bytes - address of the receiver. null when its a contract creation transactionvalue
string: amount of value for transfer (in hex)gas
string: amount of gas provided for the call (in hex)gasUsed
string: amount of gas used during the call (in hex)input
string: call dataoutput
string: return dataerror
string: error, if anyrevertReason
string: solidity revert reason, if anycalls
string: list of sub-calls
Example Request
Result
Last updated