1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
use solana_runtime::{accounts_db::SnapshotStorages, bank::BankSlotDelta}; use solana_sdk::clock::Slot; use solana_sdk::hash::Hash; use std::{ path::PathBuf, sync::mpsc::{Receiver, SendError, Sender}, }; use tempfile::TempDir; pub type SnapshotPackageSender = Sender<SnapshotPackage>; pub type SnapshotPackageReceiver = Receiver<SnapshotPackage>; pub type SnapshotPackageSendError = SendError<SnapshotPackage>; #[derive(Debug)] pub struct SnapshotPackage { pub root: Slot, pub slot_deltas: Vec<BankSlotDelta>, pub snapshot_links: TempDir, pub storages: SnapshotStorages, pub tar_output_file: PathBuf, pub hash: Hash, } impl SnapshotPackage { pub fn new( root: Slot, slot_deltas: Vec<BankSlotDelta>, snapshot_links: TempDir, storages: SnapshotStorages, tar_output_file: PathBuf, hash: Hash, ) -> Self { Self { root, slot_deltas, snapshot_links, storages, tar_output_file, hash, } } }