[−][src]Struct snarkos_network::server::miner_instance::MinerInstance
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]
miner_address: AccountAddress<Components>,
consensus: ConsensusParameters,
parameters: PublicParameters<Components>,
storage: Arc<MerkleTreeLedger>,
memory_pool_lock: Arc<Mutex<MemoryPool<Tx>>>,
server_context: Arc<Context>
) -> Self
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
impl !RefUnwindSafe for MinerInstance
impl Send for MinerInstance
impl Sync for MinerInstance
impl Unpin for MinerInstance
impl !UnwindSafe for MinerInstance
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,