Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How do I get an RPC endpoint for TON?

How do I get an RPC endpoint for the TON network, and where can I get relevant documentation for it?

1
1
Posted one year ago
Votes Newest

Answers 2


First of all, what is your usage for the RPC endpoint you want?

To obtain an RPC endpoint for the TON network, you can either run your own node or use a public node run by a third party. To run your own node, you will need to download and set up the TON software, which can be obtained from the official TON GitHub repository. For public nodes, you can check websites such as TON Labs or search for TON nodes on popular forums.

Documentation for the TON network, including information on the RPC API, can be found in the TON Developers section of the TON Labs website and on the official TON GitHub repository.

https://github.com/ton-core
https://github.com/ton-community

Please note that TonApi (https://tonapi.io/) is a centralized indexed service and not RPC. For decentralized apps you need your blockchain queries to be routed to full nodes or validator nodes. This doesn't happen with TonApi since it has special indexes that TON full nodes and vliadator nodes don't support.

  
  
wiki
Posted one year ago
Edited one year ago

TLDR

For most cases https://www.orbs.com/ton-access is a good solution for getting unthrottled and decentralized RPC access

It also has convenient JS API:

import { getHttpEndpoint } from "@orbs-network/ton-access";
import { TonClient } from "ton";

// get the decentralized RPC endpoint
const endpoint = await getHttpEndpoint(); 

// initialize ton library
const client = new TonClient({ endpoint });

Longer answer

It depends on your use-case. There are three primary use-cases for using RPC:

  1. You want to experiment as a developer, learn and play. You will make a small number of calls. For this TON Access is probably the best because you don't need to register and it's reliable.

  2. You're building a production dapp and your web client needs to make RPC calls like calling getters. For this TON Access is the best because that's why it was made. Your dapp users are anonymous and this is the only service that will not throttle them by declaration since they don't have API keys.

  3. You build a production backend that needs to make many calls to the chain. For example, you build an indexing service that shows all holders of a Jetton so to index the data in your backend you need RPC. For this TON Access is not good at all and you're better with services like TonCenter or TonApi. These services will require that you register an API key which makes sense since you're a heavy user.

Don't run your own RPC

If you're building a centralized service then run your own RPC. But if you're building a decentralized service like a dapp, relying on a server that you run by yourself is too centralized and considered bad practice.

Be aware of multiple RPC protocols

Unlike Ethereum, TON doesn't have a single RPC protocol that everybody uses. There are currently 3 different RPC protocols people use:

  1. HTTP API V2 created by TonCenter
  2. HTTP API V4 created by TonWhales
  3. Raw ADNL over HTTP

TON Access is curently the only RPC providers that support all 3 protocols.

Please note that TonApi is a centralized indexed service and not RPC. For decentralized apps you need your blockchain queries to be routed to full nodes or validator nodes. This doesn't happen with TonApi since it has special indexes that TON full nodes and validator nodes don't support.

Disclosure

I helped build TON Access. The reason I built it because there was no decentralized RPC provider for dapps in the ecosystem and I think such a thing is important.

5
5
Posted one year ago
Edited one year ago
Tal Kol
359 × 3 Administrator
  
  

Thanks @<1485644594262577152|Tal Kol> for clarify!

Howard   one year ago Report