Documentation ¶
Index ¶
- Variables
- func APIs(backend Backend) []rpc.API
- type API
- func (api *API) TraceBlock(ctx context.Context, blob hexutil.Bytes, config *TraceConfig) ([]*txTraceResult, error)
- func (api *API) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error)
- func (api *API) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *TraceConfig) ([]*txTraceResult, error)
- func (api *API) TraceCall(ctx context.Context, args api.TransactionArgs, ...) (interface{}, error)
- func (api *API) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error)
- type Backend
- type Context
- type StateReleaseFunc
- type StdTraceConfig
- type TraceCallConfig
- type TraceConfig
- type Tracer
Constants ¶
This section is empty.
Variables ¶
var DefaultDirectory = directory{/* contains filtered or unexported fields */}
DefaultDirectory is the collection of tracers bundled by default.
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the collection of tracing APIs exposed over the private debugging endpoint.
func (*API) TraceBlock ¶
func (api *API) TraceBlock(ctx context.Context, blob hexutil.Bytes, config *TraceConfig) ([]*txTraceResult, error)
TraceBlock returns the structured logs created during the execution of EVM and returns them as a JSON object.
func (*API) TraceBlockByHash ¶
func (api *API) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error)
TraceBlockByHash returns the structured logs created during the execution of EVM and returns them as a JSON object.
func (*API) TraceBlockByNumber ¶
func (api *API) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *TraceConfig) ([]*txTraceResult, error)
TraceBlockByNumber returns the structured logs created during the execution of EVM and returns them as a JSON object.
func (*API) TraceCall ¶
func (api *API) TraceCall(ctx context.Context, args api.TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, config *TraceCallConfig) (interface{}, error)
TraceCall lets you trace a given eth_call. It collects the structured logs created during the execution of EVM if the given transaction was added on top of the provided block and returns them as a JSON object.
func (*API) TraceTransaction ¶
func (api *API) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error)
TraceTransaction returns the structured logs created during the execution of EVM and returns them as a JSON object.
type Backend ¶
type Backend interface { HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error) GetTransaction(ctx context.Context, txHash common.Hash) (*transaction.Transaction, common.Hash, uint64, uint64, error) RPCGasCap() uint64 ChainConfig() *params.ChainConfig Engine() consensus.Engine ChainDb() kv.RwDB StateAtBlock(ctx context.Context, tx kv.Tx, block *types.Block) (*state.IntraBlockState, error) StateAtTransaction(ctx context.Context, tx kv.Tx, block *types.Block, txIndex int) (*transaction.Message, evmtypes.BlockContext, *state.IntraBlockState, error) }
Backend interface provides the common API services (that are provided by both full and light clients) with access to necessary functions.
type Context ¶
type Context struct { BlockHash common.Hash // Hash of the block the tx is contained within (zero if dangling tx or call) BlockNumber *big.Int // Number of the block the tx is contained within (zero if dangling tx or call) TxIndex int // Index of the transaction within a block (zero if dangling tx or call) TxHash common.Hash // Hash of the transaction being traced (zero if dangling call) }
Context contains some contextual infos for a transaction execution that is not available from within the EVM object.
type StateReleaseFunc ¶
type StateReleaseFunc func()
StateReleaseFunc is used to deallocate resources held by constructing a historical state for tracing purposes.
type StdTraceConfig ¶
StdTraceConfig holds extra parameters to standard-json trace functions.
type TraceCallConfig ¶
type TraceCallConfig struct { TraceConfig StateOverrides *api.StateOverride BlockOverrides *api.BlockOverrides }
TraceCallConfig is the config for traceCall API. It holds one more field to override the state for tracing.
type TraceConfig ¶
type TraceConfig struct { *logger.Config Tracer *string Timeout *string Reexec *uint64 // Config specific to given tracer. Note struct logger // config are historically embedded in main object. TracerConfig json.RawMessage }
TraceConfig holds extra parameters to trace functions.