sync

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LatestBlockInterval = uint32(720) // 720 blocks is about two hours

Functions

This section is empty.

Types

type Config

type Config struct {
	Moniker         string           `toml:"moniker"`
	SessionTimeout  time.Duration    `toml:"session_timeout"`
	BlockPerMessage uint32           `toml:"block_per_message"` // TODO: Does the user need to change it?
	CacheSize       int              `toml:"cache_size"`        // TODO: Does the user need to change it?
	NodeNetwork     bool             `toml:"node_network"`
	Firewall        *firewall.Config `toml:"firewall"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) BasicCheck added in v0.15.0

func (conf *Config) BasicCheck() error

BasicCheck performs basic checks on the configuration.

type MockSync

type MockSync struct {
	TestID      peer.ID
	TestPeerSet *peerset.PeerSet
}

func MockingSync

func MockingSync(ts *testsuite.TestSuite) *MockSync

func (*MockSync) Moniker

func (m *MockSync) Moniker() string

func (*MockSync) PeerSet

func (m *MockSync) PeerSet() *peerset.PeerSet

func (*MockSync) SelfID

func (m *MockSync) SelfID() peer.ID

func (*MockSync) Start

func (m *MockSync) Start() error

func (*MockSync) Stop

func (m *MockSync) Stop()

type Synchronizer

type Synchronizer interface {
	Start() error
	Stop()
	Moniker() string
	SelfID() peer.ID
	PeerSet() *peerset.PeerSet
}

func NewSynchronizer

func NewSynchronizer(
	conf *Config,
	valKeys []*bls.ValidatorKey,
	state state.Facade,
	consMgr consensus.Manager,
	net network.Network,
	broadcastCh <-chan message.Message,
) (Synchronizer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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