I am wondering about the snapshot functionality of smart contract. Given the application ids I would like to take snapshots, is it possible to take the lastest updates of those apps using the algo-sdk functions?
do you mean the state values for stateful smart contracts?
@JasonW Yes, I am asking for the solution returning the state values of many apps (e.g. like 50-100 apps) of a given time stamp.
You may be able to do some of this using the indexer. Specifically search the chain for all applications, loop through these, and then look up the creator account to get the global state of each contract. The local state would be a bit more complex as the current values are stored in the ledger under the individual accounts that have opted in. Algorand Developer Docs
Thanks for your response @JasonW .
I think I am focused on the availability of returning the state values of a certain timestamp, so maybe the input of the solution should contain the time variable. The indexer function you mentioned seems only including the round number as input.
Any ideas on how to search the global states with datae-time limitations?
I’m not sure if my suggestion would be helpful or not, but I figured it won’t hurt suggesting.
What I’m hearing from you is that you need to have a single “source” that would include the “master-hash”. Would it be possible for you to construct the applications (which are known in advance) in a Merkle-tree like way, so that every update to an application also updates it’s parent, and it’s parent-parent and ending with the root ?
With the current limitation of 16 transactions/group, you can have 2^16 applications there, which is quite a large number.
Thanks @tsachi for your reply.
Your idea souns interesting. I think I could take use of your idea along with using the round number to search among the smart contract apps.
But I have a question about using the round number here. I am focused on finding the correpsonding transaction time given the round number. Is there anything in algo sdk or indexer client that could return the exact time stamp of a certain round number?
hmm. Transactions doesn’t have a time of their own. The block header does contain a timestamp, which is monotonic and uniform on the network.
Would that satisfy what you’re looking for?