Struct mainnet_lib::InMemoryNode
source · pub struct InMemoryNode {
block_notifier: SharedPharos<Block>,
ledger: Arc<RwLock<Ledger>>,
leadership_process: JoinHandle<()>,
}
Expand description
In memory cardano node implementation. Basic design contains read write lock over ledger struct as well as background task for updating ledger
Fields§
§block_notifier: SharedPharos<Block>
§ledger: Arc<RwLock<Ledger>>
§leadership_process: JoinHandle<()>
Implementations§
source§impl InMemoryNode
impl InMemoryNode
sourcepub fn settings(
&self
) -> Result<Settings, PoisonError<RwLockReadGuard<'_, Ledger>>>
pub fn settings( &self ) -> Result<Settings, PoisonError<RwLockReadGuard<'_, Ledger>>>
sourcepub fn push_transaction(&mut self, transaction: Transaction)
pub fn push_transaction(&mut self, transaction: Transaction)
sourcepub fn push_transactions(&mut self, transaction: Vec<Transaction>)
pub fn push_transactions(&mut self, transaction: Vec<Transaction>)
sourcepub fn wait_for_txs_to_be_in_block(&self)
pub fn wait_for_txs_to_be_in_block(&self)
Waits for all transactions from mempool to be included in block
Panics
On accessing shard ledger state
sourcepub fn start_from_ledger(ledger: Ledger) -> Self
pub fn start_from_ledger(ledger: Ledger) -> Self
Trait Implementations§
source§impl Drop for InMemoryNode
impl Drop for InMemoryNode
source§impl Observable<Block> for InMemoryNode
impl Observable<Block> for InMemoryNode
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryNode
impl Send for InMemoryNode
impl Sync for InMemoryNode
impl Unpin for InMemoryNode
impl !UnwindSafe for InMemoryNode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request