What's the best practice to get all transactions from TON in time sequence? like extract all txs from [startBlockId, endBlockId] for futher development.

In other blockchains, it can simple be done by call getBlock and getTransaction, but in TON, the blockId consists of (workchainId, ShardId, Seqno), and the same workchain could have multiple shards.

Dec 9, 2023, 2:01 PM
I haven't done it myself but I think this is a good approximation:

1- Find master chain block with a starting sequence number, let's say 1.

2- Then read the next master chain block with the next sequence number, 2 in this example.

3- Find all shard chains in between from this second master chain block.

4- Read transactions from each shard chain block number found in previous step sequentially, until all shard chains and all transactions are processed.

5- Then repeat this process by moving to the next master chain block.
Dec 9, 2023, 3:37 PM

© 2024 Draquery.com All rights reserved.