Skip to content

drift-labs/solana-accountsdb-compression-dictionary-utils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solana AccountsDB Reader

Forked the original repo to add Drift specific filtering of accounts from snapshots and outputs to a series of json files (--max_accounts_per_file accounts each) for easy consumption by test frameworks.

Drift filtering rules

  • accounts owned by Drift (dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH)
  • clock account (SysvarC1ock11111111111111111111111111111111)
  • oracle accounts by parsing latest PerpMarket and SpotMarket accounts

Running

cargo run --bin solana-accountsdb-dictionary-creator -- \
-a /path/to/snapshots/snapshot-285291102-4qgm3tsNBzajWfeYYPAYxv6NeYCzPDsRp1eGF63jvLCm.tar.zst \
-o /path/to/output/dir \
-m 10000
-r https://api.drift-api.com/rpc
  • you will need to provide a valid RPC endpoint with getProgramAccounts support
    • -r/--rpc_endpoint
    • RPC_ENDPOINT environment variable
  • snapshots can be downloaded from a validator/rpc or check the instructions using snapshot finder here

About

To create a compression dictionary for account data from solana snapshot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 87.4%
  • Shell 12.6%