consensus

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2021 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: 0

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL