Interface IDeltaHub
For lack of a better name, this IDeltaHub is meant to be the service used to publish new candidate deltas, favourite deltas, or publish newly elected deltas on the Dfs, etc. It is basically the outbound interface between the node and the rest of the network, through which all delta building related messages should be broadcast.
Namespace: Catalyst.Abstractions.Consensus.Deltas
Assembly: Catalyst.Abstractions.dll
Syntax
public interface IDeltaHub
Methods
| Improve this Doc View SourceBroadcastCandidate(CandidateDeltaBroadcast)
When the node produces a new candidate delta, it should then use this method to trigger the gossiping of the candidate through the network. This should only be called once, after a new candidate has been created, the gossiping functionality is then handled by network specific classes.
Declaration
void BroadcastCandidate(CandidateDeltaBroadcast candidate)
Parameters
Type | Name | Description |
---|---|---|
CandidateDeltaBroadcast | candidate | The newly produced candidate. |
BroadcastFavouriteCandidateDelta(FavouriteDeltaBroadcast)
When the election of the best delta for a given cycle ends, each producer is required to submit its favourite candidate to the rest of the participants in order for consensus to emerge. This function should be called to trigger the broadcasting of the elected best candidate delta for a given cycle.
Declaration
void BroadcastFavouriteCandidateDelta(FavouriteDeltaBroadcast favourite)
Parameters
Type | Name | Description |
---|---|---|
FavouriteDeltaBroadcast | favourite | The favourite delta, as produced by this node. |
PublishDeltaToDfsAndBroadcastAddressAsync(Delta, CancellationToken)
Once a delta has been elected, if the node possesses the full content for the elected delta, it should then post it on the DFS (if it can't find it there already) so that the rest of the network can retrieve and apply it.
Declaration
Task<Cid> PublishDeltaToDfsAndBroadcastAddressAsync(Delta delta, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Delta | delta | The delta which has been elected for this cycle. |
System.Threading.CancellationToken | cancellationToken | A cancellation token allowing to abort the tasks. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Cid> |