You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ecosystem/rpc/overview.mdx
+66-60Lines changed: 66 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,118 +3,124 @@ title: "Overview"
3
3
description: "Understand the main ways to access the TON blockchain."
4
4
---
5
5
6
+
import { Aside } from'/snippets/aside.jsx';
7
+
6
8
## Types of API
7
9
8
10
TON exposes several access layers for interacting with the blockchain, each serving different needs:
9
11
10
-
-**HTTP API** - standard web access for querying accounts, blocks, and sending transactions.
11
-
-**Indexed API** - database-backed API providing structured, decoded, and historical data.
12
+
-**HTTP API** - standard web access for querying accounts, blocks, and sending transactions.
13
+
-**Indexed API** - database-backed API providing structured, decoded, and historical data.
12
14
-**ADNL** - low-level peer-to-peer protocol for direct communication with nodes.
13
15
14
-
<Note>
15
-
**Indexed vs Non-Indexed**
16
-
In TON, APIs differ by how deeply they process data before returning it.
17
-
**Non-indexed APIs** fetch results from liteservers through `tonlibjson`. They’re simple and fast, but the data comes directly from the node: no decoding, joins, or long-term history.
18
-
**Indexed APIs** run an indexer alongside a node. The indexer reads blocks from RocksDB, decodes transactions and actions, and stores them in PostgreSQL for structured access.
19
-
That extra database layer makes it possible to query decoded, historical, and aggregated data without talking to the node directly.
20
-
</Note>
21
-
22
-
16
+
<Asidetype="note">
17
+
**Indexed vs Non-Indexed**\
18
+
In TON, APIs differ by how deeply they process data before returning it.\
19
+
**Non-indexed APIs** fetch results from liteservers through `tonlibjson`. They’re simple and fast, but the data comes directly from the node: no decoding, joins, or long-term history.\
20
+
**Indexed APIs** run an indexer alongside a node. The indexer reads blocks from RocksDB, decodes transactions and actions, and stores them in PostgreSQL for structured access.\
21
+
That extra database layer makes it possible to query decoded, historical, and aggregated data without talking to the node directly.
22
+
</Aside>
23
23
24
24
## HTTP API
25
25
26
-
The HTTP API exposes the TON blockchain through both **REST** and **JSON-RPC** interfaces.
26
+
The HTTP API exposes the TON blockchain through both **REST** and **JSON-RPC** interfaces.\
27
27
It allows developers to fetch account and wallet information, explore blocks and transactions, send messages, call smart contract methods, and more.
28
28
29
-
<Note>
30
-
For production, it’s recommended to integrate at least two providers to ensure uptime.
31
-
</Note>
29
+
<Asidetype="note">
30
+
For production, it’s recommended to integrate at least two providers to ensure uptime.
31
+
</Aside>
32
32
33
33
### Typical use cases
34
-
- Querying accounts, balances, or transactions
35
-
- Sending messages or deploying smart contracts
36
-
- Building wallets and basic dApps
34
+
35
+
- Querying accounts, balances, or transactions
36
+
- Sending messages or deploying smart contracts
37
+
- Building wallets and basic dApps
37
38
38
39
### Run your own instance
39
-
Use the open-source [ton-http-api](https://github.com/toncenter/ton-http-api) to host your own endpoint.
40
+
41
+
Use the open-source [ton-http-api](https://github.com/toncenter/ton-http-api) to host your own endpoint.
40
42
41
43
## Indexed API
42
44
43
-
Indexed APIs extend HTTP functionality by offering structured, decoded, and historical blockchain data.
45
+
Indexed APIs extend HTTP functionality by offering structured, decoded, and historical blockchain data.\
44
46
They are built on top of the **TON Indexer**, which reads data from a full node, decodes transactions and actions, and stores them in a PostgreSQL database for efficient querying.
45
47
46
48
These APIs power explorers and analytics tools that need complex searches or decoded data.
47
49
48
50
### Typical use cases
49
-
- Blockchain explorers and analytics dashboards
50
-
- Historical or decoded transaction queries
51
-
- NFT and Jetton tracking
52
51
53
-
### HTTP vs Indexer
52
+
- Blockchain explorers and analytics dashboards
53
+
- Historical or decoded transaction queries
54
+
- NFT and Jetton tracking
54
55
55
-
| Type | Best for | What you get |
56
-
| --- | --- | --- |
57
-
|**HTTP**| Sending messages or performing standard read requests | Data processed by `tonlib` and served through liteservers over REST or JSON-RPC. Useful for querying accounts, balances, or transactions without indexing overhead. |
58
-
|**Indexer**| Accessing decoded, historical, or aggregated data | Responses served from an indexing database built from a full node’s data. Ideal for explorers, analytics, and structured blockchain queries. |
|**HTTP**| Sending messages or performing standard read requests | Data processed by `tonlib` and served through liteservers over REST or JSON-RPC. Useful for querying accounts, balances, or transactions without indexing overhead. |
61
+
|**Indexer**| Accessing decoded, historical, or aggregated data | Responses served from an indexing database built from a full node’s data. Ideal for explorers, analytics, and structured blockchain queries. |
60
62
61
-
<Tip>
62
-
Prefer **Indexed APIs** for nearly all read operations, as they provide broader coverage, better performance, and decoded data.
63
-
Use **HTTP APIs** when you need to **send messages or transactions** directly to the network.
64
-
</Tip>
63
+
<Asidetype="tip">
64
+
Prefer **Indexed APIs** for nearly all read operations, as they provide broader coverage, better performance, and decoded data.\
65
+
Use **HTTP APIs** when you need to **send messages or transactions** directly to the network.
66
+
</Aside>
65
67
66
68
### Run your own instance
67
-
Use the open-source [ton-indexer](https://github.com/toncenter/ton-indexer) to host your own endpoint.
69
+
70
+
Use the open-source [ton-indexer](https://github.com/toncenter/ton-indexer) to host your own endpoint.
68
71
69
72
## ADNL API
70
73
71
-
**ADNL (Abstract Datagram Network Layer)** is TON’s peer-to-peer protocol for direct node communication.
74
+
**ADNL (Abstract Datagram Network Layer)** is TON’s peer-to-peer protocol for direct node communication.\
72
75
It provides verifiable, low-level access to blockchain data and transaction submission.
73
76
74
77
Clients connect directly to **liteservers** using a binary protocol, downloading key blocks, account states, and Merkle proofs to verify data authenticity.
75
78
76
79
For read operations (such as `runGetMethod`), the client executes a local TVM run using the verified state, without downloading the full blockchain.
|**HTTP**| General-purpose access to blockchain data and message submission | Returns processed data produced by `tonlib` through liteservers, exposed over REST or JSON-RPC. The data is already parsed and formatted for applications, not a raw or verifiable ledger snapshot. |
88
-
|**ADNL**| Direct and verifiable access to the blockchain state | Native peer-to-peer protocol used by TON nodes. Provides binary responses with Merkle proofs, allowing clients to verify the authenticity of account states and transactions directly. |
92
+
|**ADNL**| Direct and verifiable access to the blockchain state | Native peer-to-peer protocol used by TON nodes. Provides binary responses with Merkle proofs, allowing clients to verify the authenticity of account states and transactions directly.|
89
93
90
-
<Tip>
91
-
For most applications, prefer an **Indexed API** for reads, because it provides broader coverage and faster, decoded data.
92
-
Use **HTTP** when you need to **send messages or transactions** directly to the network.
93
-
Choose **ADNL** for low-level, verifiable access or when running your own node or validator infrastructure.
94
-
</Tip>
94
+
<Asidetype="tip">
95
+
For most applications, prefer an **Indexed API** for reads, because it provides broader coverage and faster, decoded data.\
96
+
Use **HTTP** when you need to **send messages or transactions** directly to the network.\
97
+
Choose **ADNL** for low-level, verifiable access or when running your own node or validator infrastructure.
98
+
</Aside>
95
99
96
100
### Run your own instance
101
+
97
102
Use [MyTonCtrl](../node/setup-mytonctrl) to enable a liteserver and expose an ADNL endpoint.
98
103
99
104
## Providers
100
105
101
106
### Official providers
102
107
103
-
| Provider | Type | Public Endpoints | Docs |
104
-
| --- | --- | --- | --- |
105
-
|[TON Center API v2](https://github.com/toncenter/ton-http-api)| HTTP |`https://toncenter.com/api/v2/`, `https://testnet.toncenter.com/api/v2/`|[Docs](./toncenter/get-api-key)|
106
-
|[TON Center API v3](https://github.com/toncenter/ton-indexer)| Indexer |`https://toncenter.com/api/v3/`|[Docs](./toncenter/get-api-key)|
107
-
|[dTON](https://t.me/dtontech_bot)| ADNL | Provided by dTON via [request through official bot](https://t.me/dtontech_bot)| — |
108
-
| Public liteservers | ADNL |`https://ton.org/global-config.json`, `https://ton.org/testnet-global.config.json`| — |
|[TON Center API v2](https://github.com/toncenter/ton-http-api)| HTTP |`https://toncenter.com/api/v2/`, `https://testnet.toncenter.com/api/v2/`|[Docs](./toncenter/get-api-key)|
111
+
|[TON Center API v3](https://github.com/toncenter/ton-indexer)| Indexer |`https://toncenter.com/api/v3/`|[Docs](./toncenter/get-api-key)|
112
+
|[dTON](https://t.me/dtontech_bot)| ADNL | Provided by dTON via [request through official bot](https://t.me/dtontech_bot)| —|
113
+
| Public liteservers | ADNL |`https://ton.org/global-config.json`, `https://ton.org/testnet-global.config.json`| —|
109
114
110
115
### Third party providers
111
-
| Provider | Type | Public Endpoints | Docs |
112
-
| --- | --- | --- | --- |
113
-
|[Chainstack](https://chainstack.com/build-better-with-ton/)| HTTP, Indexer, ADNL | Access via dashboard or project workspace |[Docs](https://docs.chainstack.com/reference/getting-started-ton#getting-started-ton)|
0 commit comments