Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
41 changes: 41 additions & 0 deletions ecosystem/rpc/traces.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: "Traces"
---

import { Aside } from "/snippets/aside.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_.

![Trace](/resources/images/rpc/trace_def.svg)

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.

![Trace logical time](/resources/images/rpc/traces_lt.svg)

<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_.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense.

There is no such grouping inside of traces. Trace is merely a tree, generated completely autonomously, with no such feedback from a person possible.


**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).

![NFT transfer trace](/resources/images/rpc/nft_transfer_trace.png)


## 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.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions resources/images/rpc/trace_def.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading