Skip to content

Commit

Permalink
get snapshot via gpa compressed
Browse files Browse the repository at this point in the history
  • Loading branch information
grooviegermanikus committed Aug 12, 2024
1 parent 0686386 commit b7da727
Show file tree
Hide file tree
Showing 6 changed files with 630 additions and 32 deletions.
18 changes: 18 additions & 0 deletions chaindata_standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ anyhow = { workspace = true }
itertools = { workspace = true }
futures = { workspace = true }

serde = { workspace = true }
serde_json = { workspace = true }
serde_derive = { workspace = true }

lz4 = "1.24.0"
base64 = "0.21.7"


bincode = "1.3.3"
async-channel = { workspace = true }
async-trait = { workspace = true }

Expand All @@ -26,4 +35,13 @@ geyser-grpc-connector = { tag = "v0.10.6+yellowstone.1.13+solana.1.17.28", git =
yellowstone-grpc-proto = "1.13.0"
#yellowstone-grpc-client = "1.14.0"

jsonrpc-core = "18.0.0"
jsonrpc-core-client = { version = "18.0.0", features = ["ws", "http", "tls"] }
jsonrpc-derive = "18.0.0"
jsonrpc-pubsub = "18.0.0"

solana-sdk = { workspace = true }
solana-client = { workspace = true }
solana-rpc-client-api = "1.17"
solana-account-decoder = "1.17"

40 changes: 40 additions & 0 deletions chaindata_standalone/src/account_write.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use serde_derive::{Deserialize, Serialize};
use solana_sdk::account::Account;
use solana_sdk::pubkey::Pubkey;

pub fn account_write_from(
pubkey: Pubkey,
slot: u64,
write_version: u64,
account: Account,
) -> AccountWrite {
AccountWrite {
pubkey,
slot,
write_version,
lamports: account.lamports,
owner: account.owner,
executable: account.executable,
rent_epoch: account.rent_epoch,
data: account.data,
}
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct AccountWrite {
pub pubkey: Pubkey,
pub slot: u64,
pub write_version: u64,
pub lamports: u64,
pub owner: Pubkey,
pub executable: bool,
pub rent_epoch: u64,
pub data: Vec<u8>,
// is_selected < removed
}

#[derive(Debug)]
pub enum AccountOrSnapshotUpdate {
AccountUpdate(AccountWrite),
SnapshotUpdate(Vec<AccountWrite>),
}
Loading

0 comments on commit b7da727

Please sign in to comment.