Replies: 1 comment 5 replies
-
That will be the major issue yes, on top of that there is a rate limit (at least for free RPC).
We can improve better by emitting events on critical contract state changes so the fetching will work on-demand instead of scheduled. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Skipper full application architecture
Updated scheme of app services relations. Arrows represents data flow direction
Services
TON API - external service tonapi.io
API and Indexer are backend threads/processes/tasks (no matter) of backend application. Indexer listen to updates in blockchain, serialize it to database data structure and store it. API read stored data from database.
Updates from blockchain
After some research i find out that there is no need to listen emitted events in TON. There is HTTP API endpoint in tonapi.io:
/v2/accounts/{account_id}/traces
it return list of latest account traces:Trace structure:
Trace is (as i understood) group of transactions that has communicated with each other. If one of transaction related to specified account it appear in traces list endpoint.
We could periodically get list of latest traces for Skipper contract and check is there is some new traces. If there is, we fetch detailed information about each trace using
/v2/traces/{trace_id}
endpoint. It result has full info about transactions in this trace. So we could see opcodes and messages body (not sure it's full body, but opcodes are there) thus we could know is there new votes or new proposals.Also using traces listening we could fit in free tier in tonapi with 1 rpc.
Beta Was this translation helpful? Give feedback.
All reactions