anza-xyz / agave

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://www.anza.xyz/
Apache License 2.0
452 stars 222 forks source link

state of an account at a particular slot/block #3127

Open degenSumi opened 1 month ago

degenSumi commented 1 month ago

hey,

I am trying to get the historical state of a token account so that we can track an users balance historically, however i can't find links in this answer in a related question:

Hi @leoluk, we have created an AccountsDb plugin framework enabling replicating accounts data to external data stores such as db or Kafka on top of which one can build applications serving clients with accounts data an offloading the core validator. We have an reference implementation with PostgreSQL. You can get more info in https://github.com/lijunwangs/solana/tree/master/accountsdb-plugin-interface and https://github.com/lijunwangs/solana/tree/master/accountsdb-plugin-postgres. This enables one to persist the historical data for accounts. Please check it out and let me know if you have any questions/suggestions.

degenSumi commented 1 month ago

i am getting the same data for these two requests:

let oldInfo = await connection.getAccountInfo(new PublicKey("CYwvrMNTYzS9bXftriexXmcgRavXfNo8octro6Yjzv7h"), {
    minContextSlot: 0
});

console.log(oldInfo)
let accounInfo = await connection.getAccountInfo(new PublicKey("CYwvrMNTYzS9bXftriexXmcgRavXfNo8octro6Yjzv7h"), {
    minContextSlot: 294756213
});
console.log(accountInfo);
Alexandr-zarea commented 1 month ago

Nagaprasadvr commented 1 month ago

This is most likely your rpc issue which archives historical data , please check with them