Documentation ¶
Index ¶
- Constants
- Variables
- func AwaitMessageToBeBooked(f func() (*tangle.Message, error), txID ledgerstate.TransactionID, ...) (*tangle.Message, error)
- func ConsensusMechanism() *fcob.ConsensusMechanism
- func ConsensusPlugin() *node.Plugin
- func OpinionGiverFunc() (givers []opinion.OpinionGiver, err error)
- func OpinionRetriever(id string, objectType vote.ObjectType) opinion.Opinion
- func Plugin() *node.Plugin
- func Registry() *statement.Registry
- func SyncBeaconFollowerPlugin() *node.Plugin
- func SyncStatus() (bool, map[ed25519.PublicKey]Status)
- func Tangle() *tangle.Tangle
- func Voter() vote.DRNGRoundBasedVoter
- type OpinionGiver
- type OpinionGivers
- type PeerOpinionGiver
- type Status
Constants ¶
const ( // DefaultAverageNetworkDelay contains the default average time it takes for a network to propagate through gossip. DefaultAverageNetworkDelay = 5 * time.Second )
const (
// SyncBeaconFollowerPluginName is the plugin name of the sync beacon follower plugin.
SyncBeaconFollowerPluginName = "SyncBeaconFollower"
)
Variables ¶
var ( // ErrMessageWasNotBookedInTime is returned if a message did not get booked // within the defined await time. ErrMessageWasNotBookedInTime = errors.New("message could not be booked in time") )
var ( // ErrMissingFollowNodes is returned if the node starts with no follow nodes list ErrMissingFollowNodes = errors.New("follow nodes list is required") )
var FPCParameters = struct { // BindAddress defines on which address the FPC service should listen. BindAddress string `default:"0.0.0.0:10895" usage:"the bind address on which the FPC vote server binds to"` // Listen defines if the FPC service should listen. Listen bool `default:"true" usage:"if the FPC service should listen"` // RoundInterval defines how long a round lasts (in seconds). RoundInterval int64 `default:"10" usage:"FPC round interval [s]"` // QuerySampleSize defines how many nodes will be queried each round. QuerySampleSize int `default:"21" usage:"Size of the voting quorum (k)"` }{}
FPCParameters contains the configuration parameters used by the FPC consensus.
var Parameters = struct { // TangleWidth can be used to specify the number of tips the Tangle tries to maintain. TangleWidth int `default:"0" usage:"the width of the Tangle"` // Snapshot contains snapshots related configuration parameters. Snapshot struct { // File is the path to the snapshot file. File string `default:"./snapshot.bin" usage:"the path to the snapshot file"` GenesisNode string `` /* 140-byte string literal not displayed */ } // FCOB contains parameters related to the fast consensus of barcelona. FCOB struct { AverageNetworkDelay int `default:"5" usage:"the avg. network delay to use for FCoB rules"` } }{}
Parameters contains the configuration parameters used by the message layer.
var StatementParameters = struct { // WaitForStatement is the time in seconds for which the node wait for receiving the new statement. WaitForStatement int `default:"5" usage:"the time in seconds for which the node wait for receiving the new statement"` // WriteStatement defines if the node should write statements. WriteStatement bool `default:"false" usage:"if the node should make statements"` // ManaThreshold defines the Mana threshold to accept/write a statement. ManaThreshold float64 `default:"1" usage:"Mana threshold to accept/write a statement"` // CleanInterval defines the time interval [in minutes] for cleaning the statement registry. CleanInterval int `default:"5" usage:"the time in minutes after which the node cleans the statement registry"` // DeleteAfter defines the time [in minutes] after which older statements are deleted from the registry. DeleteAfter int `default:"5" usage:"the time in minutes after which older statements are deleted from the registry"` }{}
StatementParameters contains the configuration parameters used by the FPC statements in the tangle.
var SyncBeaconFollowerParameters = struct { // FollowNodes defines the list of nodes this node should follow to determine its sync status. FollowNodes []string `` /* 157-byte string literal not displayed */ // MaxTimeWindowSec defines the maximum time window for which a sync payload would be considerable. MaxTimeWindowSec int `default:"10" usage:"the maximum time window for which a sync payload would be considerable"` // MaxTimeOffline defines the maximum time a beacon node can stay without receiving updates. MaxTimeOffline int `default:"70" usage:"the maximum time the node should stay synced without receiving updates"` // CleanupInterval defines the interval that old beacon status are cleaned up. CleanupInterval int `default:"10" usage:"the interval at which cleanups are done"` // SyncPercentage defines the percentage of following nodes that have to be synced. SyncPercentage float64 `default:"0.5" usage:"percentage of nodes being followed that need to be synced in order to consider the node synced"` }{}
SyncBeaconFollowerParameters contains the configuration parameters used by the syncbeacon follower plugin.
Functions ¶
func AwaitMessageToBeBooked ¶ added in v0.4.0
func AwaitMessageToBeBooked(f func() (*tangle.Message, error), txID ledgerstate.TransactionID, maxAwait time.Duration) (*tangle.Message, error)
AwaitMessageToBeBooked awaits maxAwait for the given message to get booked.
func ConsensusMechanism ¶ added in v0.5.0
func ConsensusMechanism() *fcob.ConsensusMechanism
ConsensusMechanism return the FcoB ConsensusMechanism used by the Tangle.
func ConsensusPlugin ¶ added in v0.5.0
ConsensusPlugin returns the consensus plugin.
func OpinionGiverFunc ¶ added in v0.5.0
func OpinionGiverFunc() (givers []opinion.OpinionGiver, err error)
OpinionGiverFunc returns a slice of opinion givers.
func OpinionRetriever ¶ added in v0.5.0
func OpinionRetriever(id string, objectType vote.ObjectType) opinion.Opinion
OpinionRetriever returns the current opinion of the given id.
func SyncBeaconFollowerPlugin ¶ added in v0.5.0
SyncBeaconFollowerPlugin gets the plugin instance.
func SyncStatus ¶ added in v0.5.0
SyncStatus returns the detailed status per beacon node.
func Voter ¶ added in v0.5.0
func Voter() vote.DRNGRoundBasedVoter
Voter returns the DRNGRoundBasedVoter instance used by the FPC plugin.
Types ¶
type OpinionGiver ¶ added in v0.5.0
type OpinionGiver struct {
// contains filtered or unexported fields
}
OpinionGiver is a wrapper for both statements and peers.
func (*OpinionGiver) ID ¶ added in v0.5.0
func (o *OpinionGiver) ID() identity.ID
ID returns the identifier of the underlying Peer.
type OpinionGivers ¶ added in v0.5.0
type OpinionGivers map[identity.ID]OpinionGiver
OpinionGivers is a map of OpinionGiver.
type PeerOpinionGiver ¶ added in v0.5.0
type PeerOpinionGiver struct {
// contains filtered or unexported fields
}
PeerOpinionGiver implements the OpinionGiver interface based on a peer.
func (*PeerOpinionGiver) Address ¶ added in v0.5.0
func (pog *PeerOpinionGiver) Address() string
Address returns the FPC address of the underlying Peer.
func (*PeerOpinionGiver) ID ¶ added in v0.5.0
func (pog *PeerOpinionGiver) ID() identity.ID
ID returns the identifier of the underlying Peer.