[−][src]Struct hbbft::queueing_honey_badger::QueueingHoneyBadger
A Honey Badger instance that can handle adding and removing nodes and manages a transaction queue.
Methods
impl<T, N, Q> QueueingHoneyBadger<T, N, Q> where
T: Contribution + Serialize + DeserializeOwned + Clone,
N: NodeIdT + Serialize + DeserializeOwned,
Q: TransactionQueue<T>,
Standard: Distribution<N>,
[src]
T: Contribution + Serialize + DeserializeOwned + Clone,
N: NodeIdT + Serialize + DeserializeOwned,
Q: TransactionQueue<T>,
Standard: Distribution<N>,
pub fn builder(
dyn_hb: DynamicHoneyBadger<Vec<T>, N>
) -> QueueingHoneyBadgerBuilder<T, N, Q>
[src]
dyn_hb: DynamicHoneyBadger<Vec<T>, N>
) -> QueueingHoneyBadgerBuilder<T, N, Q>
Returns a new QueueingHoneyBadgerBuilder
configured to use the node IDs and cryptographic
keys specified by netinfo
.
pub fn builder_joining<R: Rng>(
our_id: N,
secret_key: SecretKey,
join_plan: JoinPlan<N>,
rng: &mut R
) -> Result<QueueingHoneyBadgerBuilder<T, N, Q>>
[src]
our_id: N,
secret_key: SecretKey,
join_plan: JoinPlan<N>,
rng: &mut R
) -> Result<QueueingHoneyBadgerBuilder<T, N, Q>>
Creates a new QueueingHoneyBadgerBuilder
for joining the network specified in the
JoinPlan
.
Returns a QueueingHoneyBadgerBuilder
or an error if creation of the managed
DynamicHoneyBadger
instance has failed.
pub fn push_transaction<R: Rng>(
&mut self,
tx: T,
rng: &mut R
) -> Result<Step<T, N>>
[src]
&mut self,
tx: T,
rng: &mut R
) -> Result<Step<T, N>>
Adds a transaction to the queue.
This can be called at any time to append to the transaction queue. The new transaction will be proposed in some future epoch.
If no proposal has yet been made for the current epoch, this may trigger one. In this case, a nonempty step will returned, with the corresponding messages. (Or, if we are the only validator, even with the completed batch as an output.)
pub fn vote_for<R: Rng>(
&mut self,
change: Change<N>,
rng: &mut R
) -> Result<Step<T, N>>
[src]
&mut self,
change: Change<N>,
rng: &mut R
) -> Result<Step<T, N>>
Casts a vote to change the set of validators.
This stores a pending vote for the change. It will be included in some future batch, and once enough validators have been voted for the same change, it will take effect.
pub fn vote_to_add<R: Rng>(
&mut self,
node_id: N,
pub_key: PublicKey,
rng: &mut R
) -> Result<Step<T, N>>
[src]
&mut self,
node_id: N,
pub_key: PublicKey,
rng: &mut R
) -> Result<Step<T, N>>
Casts a vote to add a node as a validator.
This stores a pending vote for the change. It will be included in some future batch, and once enough validators have been voted for the same change, it will take effect.
pub fn vote_to_remove<R: Rng>(
&mut self,
node_id: &N,
rng: &mut R
) -> Result<Step<T, N>>
[src]
&mut self,
node_id: &N,
rng: &mut R
) -> Result<Step<T, N>>
Casts a vote to demote a validator to observer.
This stores a pending vote for the change. It will be included in some future batch, and once enough validators have been voted for the same change, it will take effect.
pub fn handle_message<R: Rng>(
&mut self,
sender_id: &N,
message: Message<N>,
rng: &mut R
) -> Result<Step<T, N>>
[src]
&mut self,
sender_id: &N,
message: Message<N>,
rng: &mut R
) -> Result<Step<T, N>>
Handles a message received from sender_id
.
This must be called with every message we receive from another node.
pub fn dyn_hb(&self) -> &DynamicHoneyBadger<Vec<T>, N>
[src]
Returns a reference to the internal managed DynamicHoneyBadger
instance.
pub fn netinfo(&self) -> &NetworkInfo<N>
[src]
Returns the information about the node IDs in the network, and the cryptographic keys.
pub fn queue(&self) -> &Q
[src]
Returns the current queue of the QueueingHoneyBadger
.
pub fn next_epoch(&self) -> u64
[src]
Returns the epoch of the next batch that will be output.
Trait Implementations
impl<T, N, Q> Epoched for QueueingHoneyBadger<T, N, Q> where
T: Contribution + Serialize + DeserializeOwned + Clone,
N: NodeIdT + Serialize + DeserializeOwned,
Q: TransactionQueue<T>,
Standard: Distribution<N>,
[src]
T: Contribution + Serialize + DeserializeOwned + Clone,
N: NodeIdT + Serialize + DeserializeOwned,
Q: TransactionQueue<T>,
Standard: Distribution<N>,
impl<T, N, Q> ConsensusProtocol for QueueingHoneyBadger<T, N, Q> where
T: Contribution + Serialize + DeserializeOwned + Clone,
N: NodeIdT + Serialize + DeserializeOwned,
Q: TransactionQueue<T>,
Standard: Distribution<N>,
[src]
T: Contribution + Serialize + DeserializeOwned + Clone,
N: NodeIdT + Serialize + DeserializeOwned,
Q: TransactionQueue<T>,
Standard: Distribution<N>,
type NodeId = N
Unique node identifier.
type Input = Input<T, N>
The input provided by the user.
type Output = Batch<T, N>
The output type. Some algorithms return an output exactly once, others return multiple times. Read more
type Message = Message<N>
The messages that need to be exchanged between the instances in the participating nodes.
type Error = Error
The errors that can occur during execution.
type FaultKind = FaultKind
The kinds of message faults that can be detected during execution.
fn handle_input<R: Rng>(
&mut self,
input: Self::Input,
rng: &mut R
) -> Result<Step<T, N>>
[src]
&mut self,
input: Self::Input,
rng: &mut R
) -> Result<Step<T, N>>
fn handle_message<R: Rng>(
&mut self,
sender_id: &N,
message: Self::Message,
rng: &mut R
) -> Result<Step<T, N>>
[src]
&mut self,
sender_id: &N,
message: Self::Message,
rng: &mut R
) -> Result<Step<T, N>>
fn terminated(&self) -> bool
[src]
fn our_id(&self) -> &N
[src]
impl<T, N, Q> SenderQueueableConsensusProtocol for QueueingHoneyBadger<T, N, Q> where
T: Contribution + Serialize + DeserializeOwned + Clone,
N: NodeIdT + Serialize + DeserializeOwned,
Q: TransactionQueue<T>,
Standard: Distribution<N>,
[src]
T: Contribution + Serialize + DeserializeOwned + Clone,
N: NodeIdT + Serialize + DeserializeOwned,
Q: TransactionQueue<T>,
Standard: Distribution<N>,
fn max_future_epochs(&self) -> u64
[src]
impl<T, N: Ord, Q> Debug for QueueingHoneyBadger<T, N, Q> where
T: Debug,
N: Debug,
Q: Debug,
[src]
T: Debug,
N: Debug,
Q: Debug,
Auto Trait Implementations
impl<T, N, Q> Send for QueueingHoneyBadger<T, N, Q> where
N: Send + Sync,
Q: Send,
T: Send,
N: Send + Sync,
Q: Send,
T: Send,
impl<T, N, Q> Sync for QueueingHoneyBadger<T, N, Q> where
N: Send + Sync,
Q: Sync,
T: Sync,
N: Send + Sync,
Q: Sync,
T: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,