genesis

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEncryptionPubKeyIsNil = errors.New("encryption public key is nil")
View Source
var ErrSignerIsNil = errors.New("signer is nil")

Functions

func MergeRootGenesisFiles

func MergeRootGenesisFiles(rootGenesis []*genesis.RootGenesis) (*genesis.RootGenesis, []*genesis.PartitionGenesis, error)

func NewPartitionRecordFromNodes

func NewPartitionRecordFromNodes(nodes []*genesis.PartitionNode) ([]*genesis.PartitionRecord, error)

func NewRootGenesis

func NewRootGenesis(id string, s crypto.Signer, encPubKey []byte, partitions []*genesis.PartitionRecord,
	opts ...Option) (*genesis.RootGenesis, []*genesis.PartitionGenesis, error)

func RootGenesisAddSignature

func RootGenesisAddSignature(rootGenesis *genesis.RootGenesis, id string, s crypto.Signer, encPubKey []byte) (*genesis.RootGenesis, error)

Types

type Option

type Option func(c *rootGenesisConf)

func WithBlockRate

func WithBlockRate(rate uint32) Option

func WithConsensusTimeout

func WithConsensusTimeout(timeoutMs uint32) Option

func WithHashAlgorithm

func WithHashAlgorithm(hashAlgorithm gocrypto.Hash) Option

WithHashAlgorithm set custom hash algorithm (unused for now, remove?)

func WithQuorumThreshold

func WithQuorumThreshold(threshold uint32) Option

func WithTotalNodes

func WithTotalNodes(rootValidators uint32) Option

type UnicitySealFunc

type UnicitySealFunc func(rootHash []byte) (*types.UnicitySeal, error)

Jump to

Keyboard shortcuts

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