[][src]Struct snarkos_network::server::miner_instance::MinerInstance

pub struct MinerInstance { /* fields omitted */ }

Parameters for spawning a miner that runs proof of work to find a block.

Implementations

impl MinerInstance[src]

pub fn new(
    miner_address: AccountAddress<Components>,
    consensus: ConsensusParameters,
    parameters: PublicParameters<Components>,
    storage: Arc<MerkleTreeLedger>,
    memory_pool_lock: Arc<Mutex<MemoryPool<Tx>>>,
    server_context: Arc<Context>
) -> Self
[src]

Creates a new MinerInstance for spawning miners.

pub fn spawn(self)[src]

Spawns a new miner on a new thread using MinerInstance parameters. Once a block is found, A block message is sent to all peers. Calling this function multiple times will spawn additional listeners on separate threads. Miner threads are asynchronous so the only way to stop them is to kill the runtime they were started in. This may be changed in the future.

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>,