partitions

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgVerification

type MsgVerification interface {
	IsValid(v crypto.Verifier) error
}

type PartitionConfiguration

type PartitionConfiguration interface {
	GetInfo(id protocol.SystemIdentifier) (*genesis.SystemDescriptionRecord, PartitionTrustBase, error)
}

type PartitionInfo

type PartitionInfo struct {
	// partition system description record,
	SystemDescription *genesis.SystemDescriptionRecord
	// registered nodes and their public key's
	Verifier PartitionTrustBase
}

type PartitionStore

type PartitionStore struct {
	// contains filtered or unexported fields
}

PartitionStore stores partition related information. key of the map is system identifier.

func NewPartitionStoreFromGenesis

func NewPartitionStoreFromGenesis(partitions []*genesis.GenesisPartitionRecord) (*PartitionStore, error)

NewPartitionStoreFromGenesis creates a new partition store from root genesis.

type PartitionTrustBase

type PartitionTrustBase interface {
	GetQuorum() uint64
	GetTotalNodes() uint64
	Verify(nodeId string, req MsgVerification) error
}

func NewPartitionTrustBase

func NewPartitionTrustBase(tb map[string]crypto.Verifier) PartitionTrustBase

type TrustBase

type TrustBase struct {
	PartitionTrustBase map[string]crypto.Verifier
}

func (TrustBase) GetQuorum

func (v TrustBase) GetQuorum() uint64

GetQuorum calculates and returns minimum number of nodes required for a quorum

func (TrustBase) GetTotalNodes

func (v TrustBase) GetTotalNodes() uint64

GetTotalNodes returns total number of registered validator nodes

func (*TrustBase) Verify

func (v *TrustBase) Verify(nodeId string, req MsgVerification) error

Jump to

Keyboard shortcuts

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