Open source / Blockchain infrastructure
TON Syncer
A Go service and library for synchronizing TON account transactions with an application database.
2023 · Published on GitHubBuilt for EQT Bot
TON Syncer was developed for EQT Bot, a Telegram financial-tracking product. Publishing the synchronization component separately made it available as both a standalone service and an embeddable library.
The task
Keep an application’s transaction history in sync with TON accounts. The project can run as a service with a PostgreSQL adapter or be embedded as a library using a storage interface.
- Check accounts
- Queue updates
- Page through history
- Store transactions
The engineering
Account-checking workers identify accounts due for synchronization and enqueue update jobs. A separate worker pool fetches transaction history in pages, following TON transaction hashes and logical-time cursors. Reading stops when it encounters already-stored history.
Storage & coordination
The PostgreSQL adapter stores account synchronization timestamps and transactions; the service uses a PostgreSQL-backed job queue. Configuration controls worker-pool sizes and polling intervals. A storage interface separates the synchronization logic from application-specific tables.
My work
I developed the synchronization service and library, including the worker coordination, transaction-history traversal and PostgreSQL integration.
Source code
The public repository contains the implementation and setup instructions.