tronprotocol / java-tron

Java implementation of the Tron whitepaper
GNU Lesser General Public License v3.0
3.76k stars 1.41k forks source link

How to query state of past block? #6074

Closed bbaktaeho closed 5 hours ago

bbaktaeho commented 4 weeks ago

Can’t I get the state of past blocks on Tron? For example, I want to check the TRC-20 balance owned by account in 10000 block.

See docs,

QUANTITY|TAG - currently, only "latest" is available. 

Isn't there a solution not only for JSONRPC but also for other APIs?

laurenceja commented 4 weeks ago

@bbaktaeho As I know, now it does not support to query a TRC20 token balance on a past block directly. Alternatively, we can get the events about accounts, and save the balance changes to realize this function indirectly.

bbaktaeho commented 4 weeks ago

@laurenceja Thanks. I want query the historical balance of TRC-20. But, currently not possible in the tron ​​java client.

DongDongSunny commented 4 weeks ago

you could see all the transactions related to your own easily use transcan, like this link, choose the Type to "Trigger Smart Contract" and choose the change balance method like "Transfer" or your customised method

S1ep commented 3 weeks ago

@bbaktaeho As I know, now it does not support to query a TRC20 token balance on a past block directly. Alternatively, we can get the events about accounts, and save the balance changes to realize this function indirectly.

@laurenceja Do you know any tron data statistical provider provide the function?

laurenceja commented 22 hours ago

@S1ep Sorry, I haven't heard of it.