sync

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Moniker           string           `toml:"moniker"`
	SessionTimeoutStr string           `toml:"session_timeout"`
	Firewall          *firewall.Config `toml:"firewall"`

	// Private configs
	MaxSessions         int              `toml:"-"`
	BlockPerSession     uint32           `toml:"-"`
	BlockPerMessage     uint32           `toml:"-"`
	PruneWindow         uint32           `toml:"-"`
	LatestSupportingVer version.Version  `toml:"-"`
	Services            service.Services `toml:"-"`
}

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.

func (*Config) CacheSize

func (conf *Config) CacheSize() int

func (*Config) SessionTimeout

func (conf *Config) SessionTimeout() time.Duration

type MockSync

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

func MockingSync

func MockingSync(ts *testsuite.TestSuite) *MockSync

func (*MockSync) ClockOffset added in v1.3.0

func (*MockSync) ClockOffset() (time.Duration, error)

func (*MockSync) IsClockOutOfSync added in v1.3.0

func (*MockSync) IsClockOutOfSync() bool

func (*MockSync) Moniker

func (*MockSync) Moniker() string

func (*MockSync) PeerSet

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

func (*MockSync) SelfID

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

func (*MockSync) Services added in v0.19.0

func (m *MockSync) Services() service.Services

func (*MockSync) Start

func (*MockSync) Start() error

func (*MockSync) Stop

func (*MockSync) Stop()

type Synchronizer

type Synchronizer interface {
	Start() error
	Stop()
	Moniker() string
	SelfID() peer.ID
	PeerSet() *peerset.PeerSet
	Services() service.Services
	ClockOffset() (time.Duration, error)
	IsClockOutOfSync() bool
}

func NewSynchronizer

func NewSynchronizer(
	conf *Config,
	valKeys []*bls.ValidatorKey,
	state state.Facade,
	consMgr consensus.Manager,
	network 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