摘要
Looking for an RPC TON network endpoint? This guide compares TON RPC providers, provides step-by-step setup instructions, and highlights common pitfalls to help you choose the best infrastructure for your dApp, wallet, or bot.
RPC TON Network Decision Checklist
Before choosing a TON RPC setup, evaluate these factors:
- Endpoint type: Decide between public community endpoints (rate-limited, no SLA) and managed RPC services (dedicated or shared nodes).
- Network coverage: Confirm the provider supports both mainnet and testnet if needed.
- Rate limits and throughput: Check requests-per-second (RPS) limits and whether burst capacity is available.
- Archive data: If your dApp needs historical state or old transactions, verify archive node support.
- WebSocket support: Real-time features like event listening require WSS endpoints.
- Failover and redundancy: Providers with multi-region load balancing reduce downtime risk.
- Pricing model: Understand whether you pay per request, per month for a dedicated node, or tiered packages.
- Geographic distribution: Low-latency endpoints near your user base improve response times.
- Support SLA: Check availability of support channels and response times for production issues.
What Is the RPC TON Network?
The Open Network (TON) is a layer-1 blockchain originally conceived by Telegram. It uses a unique sharding architecture designed for high throughput and low fees. An RPC (Remote Procedure Call) endpoint is the gateway that allows your dApp, wallet, or bot to interact with the TON blockchain—submit transactions, query balances, fetch block data, and more.
Unlike EVM chains where JSON-RPC over HTTPS is standard, TON uses a custom ADNL protocol and provides JSON-RPC via liteservers. Most managed RPC providers wrap this into familiar REST or JSON-RPC interfaces.
TON Mainnet and Testnet Endpoints
Mainnet
- Chain ID: Not applicable (non-EVM)
- Native Currency: TON
- Public Endpoint (community):
https://toncenter.com/api/v2/jsonRPC(rate-limited) - Managed Endpoint Example: Check provider dashboards for dedicated URLs
Testnet
- Chain ID: Not applicable
- Native Currency: Test TON (from faucet)
- Public Endpoint (community):
https://testnet.toncenter.com/api/v2/jsonRPC - Managed Endpoint: Similar pattern via providers
Most managed RPC services offer dedicated endpoints with higher rate limits and optional WSS support. Always verify the specific URL from your provider.
How to Connect to TON via RPC
Step 1: Get an Endpoint
Choose a provider and obtain your RPC endpoint URL and API key (if required). For example, from OnFinality's supported networks you can provision a dedicated TON endpoint.
Step 2: Install a Client Library
TON provides official SDKs. The most common is ton for JavaScript/TypeScript:
npm install ton
For Python, use tonsdk or ton3.
Step 3: Initialize the Client
import { TonClient } from "ton";
const client = new TonClient({
endpoint: "https://your-managed-ton-rpc-url.com/jsonRPC",
apiKey: "YOUR_API_KEY" // if required
});
// Get the latest masterchain info
async function getMasterchainInfo() {
const info = await client.getMasterchainInfo();
console.log("Masterchain info:", info);
}
getMasterchainInfo();
Step 4: Perform Common Operations
- Get account balance:
client.getBalance(address) - Send transaction: Build a transfer message and call
client.sendExternalMessage - Query transaction history:
client.getTransactions(address, { limit: 10 })
For a complete API reference, consult your provider's documentation.
Criteria for Choosing a TON RPC Provider
When evaluating providers for your RPC TON network needs, consider the following criteria. The table below compares typical options.
| Criterion | What to Check | Why It Matters |
|---|---|---|
| Network support | Mainnet and testnet availability | Testing requires testnet; production needs mainnet |
| Rate limits | Requests per second (RPS) | High-traffic dApps need generous or burstable limits |
| Archive data | Access to full transaction history | Explorers and analytics need historical state |
| WebSocket | WSS endpoint presence | Real-time updates for wallets and monitoring |
| Redundancy | Multi-region failover | Ensures uptime during regional outages |
| Pricing model | Pay-as-you-go vs. dedicated node | Dedicated nodes offer predictable performance |
| API compatibility | JSON-RPC version and available methods | Custom methods may differ between providers |
| Latency | Average response time | Lower latency improves user experience |
| Geographic coverage | Regions with endpoints | Choose a provider with nodes near your users |
| Support | Availability of support channels | Critical for production issues |
For detailed pricing comparisons, see RPC pricing.
Common Pitfalls When Using TON RPC
- Rate limiting: Public endpoints like
toncenter.comhave strict limits. For production, use a managed service. - Method differences: Not all providers expose the same
tonmethods. Always check the method list. - WebSocket disconnects: Some providers limit WebSocket connections or drop idle connections. Implement reconnection logic.
- Testnet vs mainnet confusion: Double-check that your endpoint is pointing to the correct network.
- Missing archive nodes: If your dApp queries past blocks, confirm the provider supports archive data.
- Authentication failures: Ensure your API key is valid and correctly configured in your client.
- Stale data due to caching: Some providers cache responses; verify you are fetching fresh data when needed.
Troubleshooting TON RPC Issues
- "Method not found" error: The provider may not support that particular JSON-RPC method. Switch to a provider with broader method coverage.
- Connection timeout: Network congestion or provider overload. Implement retries with exponential backoff.
- Incorrect block data: Verify you are using the correct network endpoint. Test with a simple
getMasterchainInfocall. - Wallet connection failure: Ensure your wallet configuration matches the provider's endpoint and API key settings.
- WebSocket reconnection: Use libraries that support automatic reconnection and heartbeats (e.g.,
wswith reconnect option). - API key invalid: Re-generate your API key from the provider dashboard and update your configuration.
When to Run Your Own TON Node vs. Use a Managed Service
Running a full TON node requires significant hardware (recommended 16+ GB RAM, 2 TB SSD, stable internet). You also need to maintain the node, sync state, and handle upgrades. For most teams, a managed RPC service from a provider like OnFinality offers:
- Instant provisioning (no sync wait)
- Built-in load balancing and failover
- 24/7 monitoring and support
- Scalable throughput as your app grows
Use a managed provider for production dApps, wallets, and bots. Run your own node only if you need deep control, custom indexing, or are validating.
Key Takeaways
- TON uses custom JSON-RPC exposed via liteservers; most managed providers wrap this into easy-to-use endpoints.
- Evaluate providers on network support, rate limits, archive data, WebSocket, redundancy, pricing, latency, and support.
- Public endpoints are fine for testing but unreliable for production.
- Managed services like OnFinality simplify TON infrastructure with dedicated nodes, failover, and global coverage.
- Always test your connection with a simple
getMasterchainInfobefore building complex logic.
Frequently Asked Questions
What is the TON RPC URL?
Mainnet community endpoint: https://toncenter.com/api/v2/jsonRPC. For dedicated endpoints, check your provider's dashboard.
Does TON support WebSocket? Yes, many providers offer WSS endpoints for real-time updates. Verify with your specific provider.
Can I use Ethereum libraries like web3.js with TON?
No, TON is non-EVM. Use the ton JavaScript library or ton3 for Python.
How do I get test TON for testnet? Use the official TON testnet faucet or request from provider faucets.
Is archive data available for TON? Some managed providers support archive nodes. Check before subscribing.
For more details on TON RPC endpoints and managed node plans, visit the TON network page and RPC pricing.
Looking for a reliable RPC TON network provider? Compare options on our supported networks page and view transparent RPC pricing.