Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mechanism ¶
type Mechanism interface {
// Opinion retrieves the opinion of the given branches.
Opinion(branchIDs ledgerstate.BranchIDs) (liked, disliked ledgerstate.BranchIDs, err error)
// LikedInstead returns the liked branch out of the conflict set of the given branch.
LikedInstead(branchID ledgerstate.BranchID) (opinionTuple []OpinionTuple, err error)
}
Mechanism is a generic interface allowing to use different methods to reach consensus.
type OpinionTuple ¶
type OpinionTuple struct {
// Liked is the liked branch out of a conflict set.
Liked ledgerstate.BranchID
// Disliked is the disliked branch out of a conflict set.
Disliked ledgerstate.BranchID
}
OpinionTuple expresses the root of an opinion in the BranchDAG.
func (OpinionTuple) String ¶
func (ot OpinionTuple) String() string
String returns a human-readable version of the OpinionTuple.
type WeightFunc ¶
type WeightFunc func(branchID ledgerstate.BranchID) (weight float64)
WeightFunc returns the approval weight for the given branch.
Click to show internal directories.
Click to hide internal directories.