Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
"group": "RPC providers",
"pages": [
"ecosystem/rpc/overview",
"ecosystem/rpc/traces",
{
"group": "TON Center",
"pages": [
Expand Down
55 changes: 55 additions & 0 deletions ecosystem/rpc/traces.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: "Traces"
---

import { Aside } from "/snippets/aside.jsx";
import { Image } from '/snippets/image.jsx';

A trace is a set of messages and transactions produced by a single external message.

Each _i-th_ transaction in the trace is triggered by a message sent during the action phase of some earlier _j-th_ transaction, where _j < i_.

<div className="flex justify-center my-4">
<Image
src="/resources/images/rpc/trace_def_light.svg"
darkSrc="/resources/images/rpc/trace_def_dark.svg"
alt="Trace diagram"
/>
</div>

All messages and transactions in the trace are ordered by their [logical time (lt)](/ton/tblkch#1-4-1-logical-time), reflecting their logical dependencies. The diagram shows transactions on independent accounts, each triggered by an incoming message, with `lt` values indicated for every message.

<Image
src="/resources/images/rpc/traces_lt_light.svg"
darkSrc="/resources/images/rpc/traces_lt_dark.svg"
alt="Traces with logical time"
/>

<Aside type={"note"}>
Transactions may be triggered not only by external messages but also by tick-tock events, commonly used within internal TON blockchain contracts, such as governance or elector contracts.
</Aside>


## Using traces in Tonviewer

In [Tonviewer](https://tonviewer.com/), traces are visualized as **directed acyclic graphs (DAGs)**, where _transactions are nodes_ and _messages are edges_, showing the full sequence of account state changes triggered by a single external message.

### Tracing operations

Traces offer **a high-level** view of an operation, illustrating how multiple transactions and messages interact to produce the final result. Within the graph, related transactions are grouped into human-readable actions, _providing developers with both the low-level transaction flow and the corresponding higher-level operations_.

**Example**

The NFT transfer illustrates a single operation that consists of **three transactions**, each triggered by messages. To learn how to read traces, follow [this article](/ecosystem/explorers/tonviewer#steps-to-analyze-an-operation).

<Image
src="/resources/images/rpc/nft_transfer_trace_light.png"
darkSrc="/resources/images/rpc/nft_transfer_trace_dark.png"
alt="NFT transfer trace"
/>

## High-level access using API

To fetch transaction data, use the high-level [`GET /traces`](/api-reference/actions/get-traces) endpoint.
This method allows you to retrieve all related transactions for a given operation, without parsing individual transactions.

Binary file added resources/images/rpc/nft_transfer_trace_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/images/rpc/trace_def_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/images/rpc/trace_def_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/images/rpc/traces_lt_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/images/rpc/traces_lt_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading