Categorygithub.com/bobg/scp
modulepackage
0.0.0-20200806181904-bd9cd44cb8d3
Repository: https://github.com/bobg/scp.git
Documentation: pkg.go.dev

# README

SCP - A standalone implementation of the Stellar Consensus Protocol

This is an implementation in Go of SCP, the Stellar Consensus Protocol. It allows a leaderless network of participating nodes to reach consensus on proposals.

In an SCP network, time is divided into consecutive slots, each of which produces consensus on a single proposal. In the early stages of a slot, nodes are able to nominate proposals they would like the network to adopt. As the slot progresses, some proposals may be discarded, others may be combined, and by the end, all nodes agree on one. After that, a new slot begins.

In this implementation, proposals are represented by the abstract type Value. Concrete instantiations of this type may include any data that can be serialized and totally ordered. It must also be possible to write a deterministic, commutative Combine operation (reducing two Values to a single one).

A toy demo can be found in cmd/lunch. It takes the name of a TOML file as an argument. The TOML file specifies the network participants and topology. Sample TOML files are in cmd/lunch/toml.

# Packages

No description provided by the author

# Functions

No description provided by the author
NewMsg produces a new message.
NewNode produces a new node.
No description provided by the author
No description provided by the author
VString calls a Value's String method.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

DeferredUpdateInterval determines the delay between arming a deferred-update timer and firing it.
ErrNoPrev occurs when trying to compute a hash (with Node.G) for slot i before the node has externalized a value for slot i-1.
NomRoundInterval determines the duration of a nomination "round." Round N lasts for a duration of (2+N)*NomRoundInterval.
ZeroBallot is the zero ballot.

# Structs

Ballot is an SCP ballot.
CommitTopic is the payload of a COMMIT message in the ballot protocol.
ExtTopic is the payload of an EXTERNALIZE message in the ballot protocol.
Msg is an SCP protocol message.
Node is the type of a participating SCP node.
NomPrepTopic is the combined payload of a NOMINATE and a PREPARE message.
NomTopic is the payload of a nomination protocol message.
PrepTopic is the payload of a PREPARE message in the ballot protocol.
No description provided by the author
No description provided by the author
Slot maintains the state of a node's slot while it is undergoing nomination and balloting.

# Interfaces

No description provided by the author
Topic is the abstract type of the payload of an SCP message (conveyed in an envelope, see type Msg).
Value is the abstract type of values being voted on by the network.

# Type aliases

BallotSet is a set of Ballot, implemented as a sorted slice.
No description provided by the author
NodeIDSet is a set of NodeID, implemented as a sorted slice.
Phase is the type of a slot's phase.
SlotID is the type of a slot ID.
ValueSet is a set of Value, implemented as a sorted slice.