consensus

package
v2.10.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMembers = []string{
	"vite_2ad661b3b5fa90af7703936ba36f8093ef4260aaaeb5f15cf8",
	"vite_1cb2ab2738cd913654658e879bef8115eb1aa61a9be9d15c3a",
	"vite_2ad1b8f936f015fc80a2a5857dffb84b39f7675ab69ae31fc8",
	"vite_85e8adb768aed85f2445eb1d71b933370d2980916baa3c1f3c",
	"vite_93dd41694edd756512da7c4af429f3e875c374a53bfd217e00",
}

Functions

This section is empty.

Types

type AccountsConsensus

type AccountsConsensus interface {
}

type Committee

type Committee struct {
	common.LifecycleStatus
	// contains filtered or unexported fields
}

update committee result

func NewCommittee

func NewCommittee(genesisTime time.Time, interval int32, memberCnt int32) *Committee

func (*Committee) Authorize

func (cm *Committee) Authorize(signer common.Address, fn SignerFn)

func (*Committee) Init

func (cm *Committee) Init()

func (*Committee) Seal

func (cm *Committee) Seal() error

func (*Committee) Start

func (cm *Committee) Start()

func (*Committee) Stop

func (cm *Committee) Stop()

func (*Committee) Subscribe

func (cm *Committee) Subscribe(subscribeMem *SubscribeMem)

func (*Committee) Verify

func (cm *Committee) Verify(reader SnapshotReader, header *common.SnapshotBlock) (bool, error)

type Consensus

type Consensus interface {
	ConsensusVerifier
	Seal

	Subscribe(subscribeMem *SubscribeMem)
	Init()
	Start()
	Stop()
}

func NewConsensus

func NewConsensus(genesisTime time.Time, cfg *config.Consensus) Consensus

type ConsensusVerifier

type ConsensusVerifier interface {
	Verify(reader SnapshotReader, block *common.SnapshotBlock) (bool, error)
}

type Seal

type Seal interface {
	Seal() error
}

type SignerFn

type SignerFn func(a common.Address, data []byte) (signedData, pubkey []byte, err error)

SignerFn is a signer callback function to request a hash to be signed by a backing account.

type SnapshotHeader

type SnapshotHeader struct {
	Timestamp uint64
	Producer  common.Address
}

type SnapshotReader

type SnapshotReader interface {
}

type SubscribeMem

type SubscribeMem struct {
	Mem    common.Address
	Notify chan time.Time
}

Jump to

Keyboard shortcuts

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