Debug
Debug methods
To enable the debug route namespace, you need to modify the configuration and add the "debug" parameter as shown below:
debug_traceBlockByNumber
Executes all transactions in the block specified by number with a tracer and returns the tracing result.
Parameters
QUANTITY|TAG - integer of a block number, or the string "latest"
Object - The tracer options:
enableMemory: Boolean - (optional, default: false) The flag indicating enabling memory capture.
disableStack: Boolean - (optional, default: false) The flag indicating disabling stack capture.
disableStorage: Boolean - (optional, default: false) The flag indicating disabling storage capture.
enableReturnData: Boolean - (optional, default: false) The flag indicating enabling return data capture.
timeOut: String - (optional, default: "5s") The timeout for cancellation of execution.
Returns
Array - Array of trace objects with the following fields:
failed: Boolean - the tx is successful or not
gas: QUANTITY - the total consumed gas in the tx
returnValue: DATA - the return value of the executed contract call
structLogs: Array - the trace result of each step with the following fields:
pc: QUANTITY - the current index in bytecode
op: String - the name of current executing operation
gas: QUANTITY - the available gas ßin the execution
gasCost: QUANTITY - the gas cost of the operation
depth: QUANTITY - the number of levels of calling functions
error: String - the error of the execution
stack: Array - array of values in the current stack
memory: Array - array of values in the current memory
storage: Object - mapping of the current storage
refund: QUANTITY - the total of current refund value
Example
debug_traceBlockByHash
Executes all transactions in the block specified by block hash with a tracer and returns the tracing result.
Parameters
DATA , 32 Bytes - Hash of a block.
Object - The tracer options. See debug_traceBlockByNumber for more details.
Returns
Array - Array of trace objects. See debug_traceBlockByNumber for more details.
Example
debug_traceBlock
Executes all transactions in the block given from the first argument with a tracer and returns the tracing result.
Parameters
DATA - RLP Encoded block bytes
Object - The tracer options. See debug_traceBlockByNumber for more details.
Returns
Array - Array of trace objects. See debug_traceBlockByNumber for more details.
Example
debug_traceTransaction
Executes the transaction specified by transaction hash with a tracer and returns the tracing result.
Parameters
DATA , 32 Bytes - Hash of a transaction.
Object - The tracer options. See debug_traceBlockByNumber for more details.
Returns
Object - Trace object. See debug_traceBlockByNumber for more details.
Example
debug_traceCall
Executes a new message call with a tracer and returns the tracing result.
Parameters
Object - The transaction call object
from: DATA, 20 Bytes - (optional) The address the transaction is sent from.
to: DATA, 20 Bytes - The address the transaction is directed to.
gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas
value: QUANTITY - (optional) Integer of the value sent with this transaction
data: DATA - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation
QUANTITY|TAG - integer block number, or the string "latest"
Object - The tracer options. See debug_traceBlockByNumber for more details.
Returns
Object - Trace object. See debug_traceBlockByNumber for more details.
Example
Last updated