-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0cc6b36
commit 3302b4f
Showing
34 changed files
with
995 additions
and
554 deletions.
There are no files selected for viewing
111 changes: 0 additions & 111 deletions
111
v1.0/RPC Nodes/rpc-evm/rpc-haqq/eth_gettransactionbyhash.md
This file was deleted.
Oops, something went wrong.
125 changes: 0 additions & 125 deletions
125
v1.0/RPC Nodes/rpc-evm/rpc-haqq/eth_gettransactionreceipt.md
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
v1.0/RPC Nodes/rpc-evm/rpc-haqq.md → v1.0/RPC Nodes/rpc-evm/rpc-horizen-eon.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 128 additions & 0 deletions
128
v1.0/RPC Nodes/rpc-evm/rpc-horizen-eon/debug_traceblockbyhash.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
--- | ||
title: "debug_traceblockbyhash" | ||
slug: "rpc-horizen-eon-debug_traceblockbyhash" | ||
excerpt: "Horizen Eon RPC" | ||
category: 65c5e93c623cad004b45d505 | ||
hidden: false | ||
metadata: | ||
description: "Horizen Eon RPC" | ||
image: [] | ||
keywords: "horizen-eon, rpc" | ||
robots: "index" | ||
createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" | ||
updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" | ||
--- | ||
[block:html]{"html":"<div style=\"padding: 10px 20px; border-radius: 5px; background-color: #e6e2ff; margin: 0 0 30px 0;\">\n <h5>Archive Method</h5>\n <p>Only on the full archive nodes. Complex queries might take longer and incur additional cost</p>\n</div>"}[/block] | ||
|
||
### How to use it | ||
|
||
{% tabs %} | ||
{% tab title="TypeScript/JavaScript" %} | ||
{% code overflow="wrap" lineNumbers="true" %} | ||
```typescript | ||
// yarn add @tatumio/tatum | ||
|
||
import { TatumSDK, HorizenEon, Network } from '@tatumio/tatum' | ||
|
||
const tatum = await TatumSDK.init<HorizenEon>({network: Network.HORIZEN_EON}) | ||
|
||
const result = await tatum.rpc.debugTraceBlockByHash( | ||
'0x48dfcf43404dffdb3b93a0b0d9982b642b221187bc3ed5c023bdab6c0e863e3d', | ||
{ | ||
tracer: 'callTracer', | ||
tracerConfig: { | ||
onlyTopCall: true, | ||
timeout: '5s', | ||
} | ||
} | ||
) | ||
|
||
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs | ||
``` | ||
{% endcode %} | ||
{% endtab %} | ||
{% endtabs %} | ||
|
||
### Overview | ||
|
||
`debug_traceBlockByHash` is an RPC method that allows developers to trace all transactions within a block using a given tracer. This is particularly useful for analyzing the behavior of all transactions in a block, investigating potential issues, and understanding the flow of execution within smart contracts. | ||
|
||
By using the `callTracer` tracer, developers can obtain more detailed information about the calls made during each transaction, including the input, output, and depth of the calls. | ||
|
||
### Parameters | ||
|
||
* `block_hash` (required): The hash of the block to be traced. | ||
* Example: `"0x1dcf337a03e08a8c00e31de6f5b6d9a6e1c6f1d5e5e6c89fc5f5b5a30e6d5d0c"` | ||
* `options` (optional): An object containing configuration options for the tracer. | ||
* `tracer` (required, string): The tracer to use, in this case, `'callTracer'`. | ||
* `tracerConfig` (required, string): object containing `'timeout'` and `'onlyTopCall'` paramter | ||
* `timeout` (required, string): The maximum amount of time the tracer is allowed to run in seconds (e.g. "10s"). Default is "5s". | ||
* `onlyTopCall` (required, boolean): Setting this to true will only trace the main (top-level) call and none of the sub-calls. This avoids extra processing for each call frame if only the top-level call info is required (useful for getting revertReason). | ||
* Example: `{ tracer: 'callTracer', tracerConfig: { onlyTopCall: true, timeout: '5s', }}` | ||
|
||
### Return Object | ||
|
||
The return object is an array of objects, each representing the trace result of a transaction within the block. Each object contains the following fields: | ||
|
||
* `from`: The address the transaction was sent from. | ||
* `gas`: The gas provided for the transaction. | ||
* `gasUsed`: The total gas used by the transaction. | ||
* `to`: The address the transaction was sent to. | ||
* `input`: The input data for the transaction. | ||
* `output`: The output data from the transaction. | ||
* `calls`: An array of objects, each representing a call made during the transaction. Each object contains: | ||
* `from`: The address the call was made from. | ||
* `gas`: The gas provided for the call. | ||
* `gasUsed`: The gas used by the call. | ||
* `to`: The address the call was made to. | ||
* `input`: The input data for the call. | ||
* `output`: The output data from the call. | ||
* `type`: The type of the call (e.g., "STATICCALL"). | ||
|
||
{% hint style="info" %} | ||
This method is available only on the full archive node. | ||
{% endhint %} | ||
|
||
### JSON-RPC Request and Response Examples | ||
|
||
#### Request | ||
|
||
```json | ||
{ | ||
"id": 1, | ||
"jsonrpc": "2.0", | ||
"method": "debug_traceBlockByHash", | ||
"params": [ | ||
"0x1dcf337a03e08a8c00e31de6f5b6d9a6e1c6f1d5e5e6c89fc5f5b5a30e6d5d0c", | ||
{ | ||
"tracer": "callTracer", | ||
"timeout": "10s" | ||
} | ||
] | ||
} | ||
|
||
``` | ||
|
||
#### Response | ||
|
||
```json | ||
{ | ||
"id": 1, | ||
"jsonrpc": "2.0", | ||
"result": [ | ||
{ | ||
"result": { | ||
"from": "0x8894e0a0c962cb723c1976a4421c95949be2d4e3", | ||
"gas": "0x2d48c", | ||
"gasUsed": "0xc7ab", | ||
"to": "0x55d398326f99059ff775485246999027b3197955", | ||
"input": "0xa9059cbb0000000000000000000000003b9f33b3a9d382fa60283c555bde8f78855957be00000000000000000000000000000000000000000000000d4e7f4f79da7c0000", | ||
"output": "0x0000000000000000000000000000000000000000000000000000000000000001", | ||
"value": "0x0", | ||
"type": "CALL" | ||
} | ||
} | ||
] | ||
} | ||
|
||
``` |
Oops, something went wrong.