sync

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 19 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"`
	HeartBeatTimer  time.Duration    `toml:"heartbeat_timer"`
	SessionTimeout  time.Duration    `toml:"session_timeout"`
	MaxOpenSessions int              `toml:"max_open_sessions"`
	BlockPerMessage uint32           `toml:"block_per_message"`
	CacheSize       int              `toml:"cache_size"`
	NodeNetwork     bool             `toml:"node_network"`
	Firewall        *firewall.Config `toml:"firewall"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) SanityCheck

func (conf *Config) SanityCheck() error

SanityCheck performs basic checks on the configuration.

type MockSync

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

func MockingSync

func MockingSync() *MockSync

func (*MockSync) Fingerprint

func (m *MockSync) Fingerprint() string

func (*MockSync) Moniker

func (m *MockSync) Moniker() string

func (*MockSync) Peers

func (m *MockSync) Peers() []peerset.Peer

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
	Peers() []peerset.Peer
	Fingerprint() string
}

func NewSynchronizer

func NewSynchronizer(
	conf *Config,
	signers []crypto.Signer,
	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