membership

package
v0.0.0-...-7cd50c7 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ID of this peer. Initialized by the main program.
	// OwnID is only used by peers, not clients.
	// There is only one global OwnID, but potentially several clients that can run in one process.
	OwnID int32 = -1

	// Peer own private key
	// TODO convert this to interface{} so it is decode form bytes only once on peer registration
	// TODO and not all the time
	OwnPrivKey []byte

	// Peer own private threshold BLS key share
	TBLSPrivKeyShare *crypto.TBLSPrivKeyShare

	// Public key of the BLS threshold cryptosystem
	TBLSPublicKey *crypto.TBLSPubKey

	// Peer own private threshold BLS key share
	BLSPrivKeyShares []*crypto.BLSPrivKeyShare

	// Peer own all the public BLS key share
	BLSPubKeyShares [][]*crypto.BLSPubKeyShare

	// Public key of the BLS threshold cryptosystem
	BLSPublicKey *crypto.BLSPubKey

	// Public key of the BLS threshold cryptosystem
	BLSIds []*crypto.BLSId

	SimulatedCrashes map[int32]*pb.NodeIdentity

	SimulatedStraggler map[int32]int32
)

Functions

func AllNodeIDs

func AllNodeIDs() []int32

Return an ordered list of IDs of all known nodes. Every node has a consistent view of this. (At least for now. This might change if we start experimenting with dynamic membership.)

func ClientPubKey

func ClientPubKey(clID int32) interface{}

TODO: Implement proper client public keys, instead of this hard-coded one.

func CorrectPeers

func CorrectPeers() []int32

func Faults

func Faults() int

Returns the the maximum number of faults

func Init

func Init()

Initializes the Client key (to be changed at some point). Cannot be part of the init() function, as the configuration file is not yet loaded when init() is executed.

func InitNodeIdentities

func InitNodeIdentities(identities []*pb.NodeIdentity)

Initializes the known node identities.

func NodeIdentity

func NodeIdentity(nodeID int32) *pb.NodeIdentity

Return full node identity

func NumNodes

func NumNodes() int

Returns the total number of nodes.

func Quorum

func Quorum() int

func SimulatesCrash

func SimulatesCrash(peerID int32) bool

func WeakQuorum

func WeakQuorum() int

Types

This section is empty.

Jump to

Keyboard shortcuts

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