statemgr

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0, BSD-2-Clause Imports: 22 Imported by: 0

Documentation

Overview

statemgr package implements object which is responsible for the smart contract ledger state to be synchronized and validated

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	store kvstore.KVStore,
	c chain.ChainCore,
	domain *DomainWithFallback,
	nodeconn chain.NodeConnection,
	stateManagerMetrics metrics.StateManagerMetrics,
	wal chain.WAL,
	rawBlocksEnabled bool,
	rawBlocksDir string,
	unitTests bool,
	timersOpt ...StateManagerTimers,
) chain.StateManager

Types

type DomainWithFallback added in v0.2.4

type DomainWithFallback struct {
	// contains filtered or unexported fields
}

DomainWithFallback acts as a peering domain, but maintains 2 sets of peers, one for the normal operation (matches with the chain peers) and other for the fallback mode (include all the trusted peers).

func NewDomainWithFallback added in v0.2.4

func NewDomainWithFallback(peeringID peering.PeeringID, net peering.NetworkProvider, log *logger.Logger) (*DomainWithFallback, error)

func (*DomainWithFallback) Attach added in v0.2.4

func (df *DomainWithFallback) Attach(receiver byte, callback func(recv *peering.PeerMessageIn)) interface{}

func (*DomainWithFallback) Close added in v0.2.4

func (df *DomainWithFallback) Close()

func (*DomainWithFallback) Detach added in v0.2.4

func (df *DomainWithFallback) Detach(attachID interface{})

func (*DomainWithFallback) GetFallbackMode added in v0.2.4

func (df *DomainWithFallback) GetFallbackMode() bool

func (*DomainWithFallback) GetRandomOtherPeers added in v0.2.4

func (df *DomainWithFallback) GetRandomOtherPeers(upToNumPeers int) []*cryptolib.PublicKey

func (*DomainWithFallback) HaveMainPeers added in v0.2.4

func (df *DomainWithFallback) HaveMainPeers() bool

func (*DomainWithFallback) SendMsgByPubKey added in v0.2.4

func (df *DomainWithFallback) SendMsgByPubKey(pubKey *cryptolib.PublicKey, msgReceiver, msgType byte, msgData []byte)

func (*DomainWithFallback) SetFallbackMode added in v0.2.4

func (df *DomainWithFallback) SetFallbackMode(fallback bool)

func (*DomainWithFallback) SetMainPeers added in v0.2.4

func (df *DomainWithFallback) SetMainPeers(peers []*cryptolib.PublicKey)

SetMainPeers updates the peer list as it is reported by the chain. We exclude the self peer here, because we use this to send messages to other nodes.

type StateManagerTimers added in v0.2.0

type StateManagerTimers struct {
	// period of state pull retry
	PullStateRetry time.Duration
	// how long delay state pull after state candidate received
	PullStateAfterStateCandidateDelay time.Duration
	GetBlockRetry                     time.Duration
}

func NewStateManagerTimers added in v0.2.0

func NewStateManagerTimers() StateManagerTimers

Jump to

Keyboard shortcuts

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