Skip to main content
Skip table of contents

Trace API

OnFinality’s Trace API helps web3 teams trace and monitor the behaviour of their applications through the state_traceBlock Substrate RPC method, enabling developers to trace the re-execution of a single block.

How to use the Trace API

Trace API is available by simply calling the network’s native Trace Method (see Supported Networks below) from your private API endpoint.

Available to workspaces on the Growth and Ultimate plans

Trace API is only available via HTTPs. Web Sockets is not supported.

Examples

RPC Method

traceBlock(block: Hash, targets: Option<Text>, storageKeys: Option<Text>, methods: Option<Text>): TraceBlockResponse
interfaceapi.rpc.state.traceBlock
jsonrpcstate_traceBlock
summary: Provides a way to trace the re-execution of a single block

- https://polkadot.js.org/docs/substrate/rpc/#traceblockblock-hash-targets-optiontext-storagekeys-optiontext-methods-optiontext-traceblockresponse

Example CURL with filter parameters applied

CODE
curl -H "Content-Type: application/json" --data '{"id": 1, "jsonrpc":"2.0", "method": "state_traceBlock", "params":["0xede5f333204a27dca8e303ebf13ba235751df318aabf4b66db1425b4525866fd","state","","Put,Append,ChildPut,ChildKill,ClearPrefix,ChildClearPrefix"]}' https://polkadot.api.onfinality.io/rpc\?apikey\=REPLACE-WITH-YOUR-API-KEY

Best Practices

Tracing can be intensive on the node. To ensure fair usage of shared resources, we have set Response Unit weightings on trace methods which limit the throughput of trace requests.

We also recommend you:

  • Use parameters to filter the trace request to only necessary information

  • Send steady load, for example tracing each new block as they are produced

If you are rapidly tracing historic blocks, such as indexing, we suggest that you use an OnFinality Dedicated Node to perform the original backfill before swapping over to the Trace API once you’ve caught up.

Supported Networks

Network

Trace Method

Response Units
What's this?

Polkadot

state_traceBlock

45

Kusama

state_traceBlock

45

Westend

state_traceBlock

45

Moonbeam

debug_traceTransaction

30

debug_traceBlockByNumber

50

debug_traceBlockByHash

50

trace_filter

10

txpool_content

500

txpool_inspect

1

txpool_status

1

Moonriver

debug_traceTransaction

30

debug_traceBlockByNumber

50

debug_traceBlockByHash

50

trace_filter

10

txpool_content

500

txpool_inspect

1

txpool_status

1

Altair

state_traceBlock

20

Automata

state_traceBlock

20

Automata Contextfree

state_traceBlock

20

Bajun

state_traceBlock

20

Bifrost Kusama

state_traceBlock

20

Bifrost Parachain (Polkadot)

state_traceBlock

20

Bridge Hub (Polkadot)

state_traceBlock

20

Bridge Hub (Westend)

state_traceBlock

20

Centrifuge Parachain

state_traceBlock

20

Clover

state_traceBlock

20

Collectives

state_traceBlock

20

Composable Finance

state_traceBlock

20

Crab

state_traceBlock

20

Edgeware

state_traceBlock

20

Efinity

state_traceBlock

20

Encointer

state_traceBlock

20

HydraDX

state_traceBlock

20

Integritee Parachain

state_traceBlock

20

Interlay

state_traceBlock

20

Interlay Kintsugi

state_traceBlock

20

Karura

state_traceBlock

20

Khala

state_traceBlock

20

Kilt Spiritnet

state_traceBlock

20

Mangata X

state_traceBlock

20

Nodle Parachain

state_traceBlock

20

Parallel

state_traceBlock

20

Pioneer (by Bit.Country)

state_traceBlock

20

Polkadex

state_traceBlock

20

Quartz

state_traceBlock

20

Robonomics

state_traceBlock

20

Sora

state_traceBlock

20

Statemine

state_traceBlock

20

Statemint

state_traceBlock

20

Unique Network

state_traceBlock

20

Westend

state_traceBlock

20

Westmint

state_traceBlock

20

XX Network

state_traceBlock

20

Zeitgeist

state_traceBlock

20

Can’t find the network you’re looking for? Contact us at support@onfinality.io to make a request

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.