Documentation ¶
Overview ¶
statemgr package implements object which is responsible for the smart contract ledger state to be synchronized and validated
Index ¶
- func New(store kvstore.KVStore, c chain.ChainCore, domain *DomainWithFallback, ...) chain.StateManager
- type DomainWithFallback
- func (df *DomainWithFallback) Attach(receiver byte, callback func(recv *peering.PeerMessageIn)) interface{}
- func (df *DomainWithFallback) Close()
- func (df *DomainWithFallback) Detach(attachID interface{})
- func (df *DomainWithFallback) GetFallbackMode() bool
- func (df *DomainWithFallback) GetRandomOtherPeers(upToNumPeers int) []*cryptolib.PublicKey
- func (df *DomainWithFallback) HaveMainPeers() bool
- func (df *DomainWithFallback) SendMsgByPubKey(pubKey *cryptolib.PublicKey, msgReceiver, msgType byte, msgData []byte)
- func (df *DomainWithFallback) SetFallbackMode(fallback bool)
- func (df *DomainWithFallback) SetMainPeers(peers []*cryptolib.PublicKey)
- type StateManagerTimers
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
Click to show internal directories.
Click to hide internal directories.