[][src]Struct solana_ledger::blockstore::Blockstore

pub struct Blockstore {
    pub new_shreds_signals: Vec<SyncSender<bool>>,
    pub completed_slots_senders: Vec<SyncSender<Vec<Slot>>>,
    pub lowest_cleanup_slot: Arc<RwLock<u64>>,
    // some fields omitted
}

Fields

new_shreds_signals: Vec<SyncSender<bool>>completed_slots_senders: Vec<SyncSender<Vec<Slot>>>lowest_cleanup_slot: Arc<RwLock<u64>>

Methods

impl Blockstore[src]

pub fn db(self) -> Arc<Database>[src]

pub fn open(ledger_path: &Path) -> Result<Blockstore, BlockstoreError>[src]

Opens a Ledger in directory, provides "infinite" window of shreds

pub fn open_with_signal(
    ledger_path: &Path
) -> Result<(Self, Receiver<bool>, CompletedSlotsReceiver), BlockstoreError>
[src]

pub fn destroy(ledger_path: &Path) -> Result<(), BlockstoreError>[src]

pub fn meta(&self, slot: Slot) -> Result<Option<SlotMeta>, BlockstoreError>[src]

pub fn is_full(&self, slot: Slot) -> bool[src]

pub fn purge_slots(&self, from_slot: Slot, to_slot: Option<Slot>)[src]

Silently deletes all blockstore column families starting at the given slot until the to slot Dangerous; Use with care: Does not check for integrity and does not update slot metas that refer to deleted slots Modifies multiple column families simultaneously

pub fn compact_storage(
    &self,
    from_slot: Slot,
    to_slot: Slot
) -> Result<bool, BlockstoreError>
[src]

pub fn erasure_meta(
    &self,
    slot: Slot,
    set_index: u64
) -> Result<Option<ErasureMeta>, BlockstoreError>
[src]

pub fn orphan(&self, slot: Slot) -> Result<Option<bool>, BlockstoreError>[src]

pub fn slot_meta_iterator<'a>(
    &'a self,
    slot: Slot
) -> Result<impl Iterator<Item = (u64, SlotMeta)> + 'a, BlockstoreError>
[src]

pub fn live_slots_iterator<'a>(
    &'a self,
    root: Slot
) -> impl Iterator<Item = (Slot, SlotMeta)> + 'a
[src]

pub fn slot_data_iterator<'a>(
    &'a self,
    slot: Slot
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + 'a, BlockstoreError>
[src]

pub fn slot_coding_iterator<'a>(
    &'a self,
    slot: Slot
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + 'a, BlockstoreError>
[src]

pub fn rooted_slot_iterator<'a>(
    &'a self,
    slot: Slot
) -> Result<impl Iterator<Item = u64> + 'a, BlockstoreError>
[src]

pub fn insert_shreds_handle_duplicate<F>(
    &self,
    shreds: Vec<Shred>,
    leader_schedule: Option<&Arc<LeaderScheduleCache>>,
    is_trusted: bool,
    handle_duplicate: &F
) -> Result<BlockstoreInsertionMetrics, BlockstoreError> where
    F: Fn(Shred), 
[src]

pub fn insert_shreds(
    &self,
    shreds: Vec<Shred>,
    leader_schedule: Option<&Arc<LeaderScheduleCache>>,
    is_trusted: bool
) -> Result<BlockstoreInsertionMetrics, BlockstoreError>
[src]

pub fn get_data_shred(
    &self,
    slot: Slot,
    index: u64
) -> Result<Option<Vec<u8>>, BlockstoreError>
[src]

pub fn get_data_shreds(
    &self,
    slot: Slot,
    from_index: u64,
    to_index: u64,
    buffer: &mut [u8]
) -> Result<(u64, usize), BlockstoreError>
[src]

pub fn get_coding_shred(
    &self,
    slot: Slot,
    index: u64
) -> Result<Option<Vec<u8>>, BlockstoreError>
[src]

pub fn write_entries(
    &self,
    start_slot: Slot,
    num_ticks_in_start_slot: u64,
    start_index: u32,
    ticks_per_slot: u64,
    parent: Option<u64>,
    is_full_slot: bool,
    keypair: &Arc<Keypair>,
    entries: Vec<Entry>,
    version: u16
) -> Result<usize, BlockstoreError>
[src]

pub fn get_index(&self, slot: Slot) -> Result<Option<Index>, BlockstoreError>[src]

pub fn put_meta_bytes(
    &self,
    slot: Slot,
    bytes: &[u8]
) -> Result<(), BlockstoreError>
[src]

Manually update the meta for a slot. Can interfere with automatic meta update and potentially break chaining. Dangerous. Use with care.

pub fn find_missing_data_indexes(
    &self,
    slot: Slot,
    first_timestamp: u64,
    start_index: u64,
    end_index: u64,
    max_missing: usize
) -> Vec<u64>
[src]

pub fn get_block_time(
    &self,
    slot: Slot,
    slot_duration: Duration,
    stakes: &HashMap<Pubkey, (u64, Account)>
) -> Result<Option<UnixTimestamp>, BlockstoreError>
[src]

pub fn get_confirmed_block(
    &self,
    slot: Slot,
    encoding: Option<RpcTransactionEncoding>
) -> Result<RpcConfirmedBlock, BlockstoreError>
[src]

pub fn write_transaction_status(
    &self,
    index: (Slot, Signature),
    status: &RpcTransactionStatus
) -> Result<(), BlockstoreError>
[src]

pub fn write_rewards(
    &self,
    index: Slot,
    rewards: RpcRewards
) -> Result<(), BlockstoreError>
[src]

pub fn get_slot_entries(
    &self,
    slot: Slot,
    shred_start_index: u64,
    _max_entries: Option<u64>
) -> Result<Vec<Entry>, BlockstoreError>
[src]

Returns the entry vector for the slot starting with shred_start_index

pub fn get_slot_entries_with_shred_info(
    &self,
    slot: Slot,
    start_index: u64
) -> Result<(Vec<Entry>, u64, bool), BlockstoreError>
[src]

Returns the entry vector for the slot starting with shred_start_index, the number of shreds that comprise the entry vector, and whether the slot is full (consumed all shreds).

pub fn get_slots_since(
    &self,
    slots: &[u64]
) -> Result<HashMap<u64, Vec<u64>>, BlockstoreError>
[src]

pub fn is_root(&self, slot: Slot) -> bool[src]

pub fn set_roots(&self, rooted_slots: &[u64]) -> Result<(), BlockstoreError>[src]

pub fn is_dead(&self, slot: Slot) -> bool[src]

pub fn set_dead_slot(&self, slot: Slot) -> Result<(), BlockstoreError>[src]

pub fn store_duplicate_slot(
    &self,
    slot: Slot,
    shred1: Vec<u8>,
    shred2: Vec<u8>
) -> Result<(), BlockstoreError>
[src]

pub fn get_duplicate_slot(&self, slot: u64) -> Option<DuplicateSlotProof>[src]

pub fn is_shred_duplicate(
    &self,
    slot: u64,
    index: u32,
    new_shred: &[u8]
) -> Option<Vec<u8>>
[src]

pub fn has_duplicate_shreds_in_slot(&self, slot: Slot) -> bool[src]

pub fn orphans_iterator<'a>(
    &'a self,
    slot: Slot
) -> Result<impl Iterator<Item = u64> + 'a, BlockstoreError>
[src]

pub fn prune(&self, target_slot: Slot)[src]

Prune blockstore such that slots higher than target_slot are deleted and all references to higher slots are removed

pub fn last_root(&self) -> Slot[src]

pub fn lowest_slot(&self) -> Slot[src]

pub fn storage_size(&self) -> Result<u64, BlockstoreError>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,