Skip to main content

106. TonCenter for TON Network Access

Status: Accepted Date: 2025-07-06

Context

To interact with the TON blockchain, our application needs to connect to a TON node. We have two main options:

  1. Run a Private Node: We could set up, host, and maintain our own full TON node. This gives us maximum control and privacy but comes with significant operational overhead (hardware costs, maintenance, synchronization).
  2. Use a Public API Service: We can use a third-party service that runs a fleet of TON nodes and provides access to the network through a simple HTTP API.

For our use case, which involves sending a relatively low volume of simple transactions, running a private node is overkill.

Decision

We will use the TonCenter API as our gateway to the TON network.

TonCenter is a free, public, and widely-used API service for the TON blockchain. It provides a reliable and scalable endpoint for sending transactions and querying blockchain data. Our kaido-ton library will be configured to use the TonCenter API endpoint and will require a TonCenter API key for authenticated access.

Consequences

Positive:

  • Zero Operational Overhead: We completely avoid the cost and complexity of hosting and maintaining our own blockchain node.
  • Reliability and Scalability: TonCenter is a scalable service designed to handle a high volume of requests, which is likely more reliable than a single private node that we would run ourselves.
  • Simplicity: Connecting to a simple HTTP API is much easier than managing a peer-to-peer connection to a blockchain node.

Negative:

  • Dependency on a Third Party: Our entire blockchain integration is dependent on the availability, reliability, and continued existence of the TonCenter service.
  • Rate Limiting and Throttling: As a public service, TonCenter imposes rate limits on API requests. We must handle these gracefully.
  • Centralization: Using a public API service introduces a point of centralization into our interaction with a decentralized network.

Mitigation:

  • Low-Risk Dependency: TonCenter is a well-established and core piece of infrastructure in the TON ecosystem. While a dependency exists, it is on a stable and reputable provider.
  • Resilient Client: Our TonService will be built to handle API errors and rate limiting gracefully, with automatic retries and exponential backoff.
  • Configurable Endpoint: The API endpoint will be configurable. If TonCenter becomes unavailable or if we decide to switch providers (or run our own node) in the future, we can easily change the endpoint URL in our configuration without changing the application code.
  • Fit For Purpose: For our use case of low-volume, non-time-critical hash recording, the benefits of using a public API far outweigh the risks of centralization.