pub trait DbWriter: Send + Sync {
    fn get_state_snapshot_receiver(
        &self,
        version: Version,
        expected_root_hash: HashValue
    ) -> Result<Box<dyn StateSnapshotReceiver<StateKey, StateKeyAndValue>>> { ... } fn finalize_state_snapshot(
        &self,
        version: Version,
        output_with_proof: TransactionOutputListWithProof
    ) -> Result<()> { ... } fn save_ledger_infos(
        &self,
        ledger_infos: &[LedgerInfoWithSignatures]
    ) -> Result<()> { ... } fn save_transactions(
        &self,
        txns_to_commit: &[TransactionToCommit],
        first_version: Version,
        ledger_info_with_sigs: Option<&LedgerInfoWithSignatures>
    ) -> Result<()> { ... } fn delete_genesis(&self) -> Result<()> { ... } }
Expand description

Trait that is implemented by a DB that supports certain public (to client) write APIs expected of an Aptos DB. This adds write APIs to DbReader.

Provided Methods

Get a (stateful) state snapshot receiver.

Chunk of accounts need to be added via add_chunk() before finishing up with finish_box()

Finalizes a state snapshot that has already been restored to the database through a state snapshot receiver. This is required to bootstrap the transaction accumulator and populate transaction and event information.

Note: this assumes that the output with proof has already been verified and that the state snapshot was restored at the same version.

Persists the specified ledger infos.

Note: this assumes that the ledger infos have already been verified.

Persist transactions. Called by the executor module when either syncing nodes or committing blocks during normal operation. See AptosDB::save_transactions.

Deletes transaction data associated with the genesis transaction. This is useful for cleaning up the database after a node has bootstrapped all accounts through state sync.

TODO(joshlind): find a cleaner (long term) solution to avoid us having to expose this…

Implementors