Documentation ¶
Index ¶
- Constants
- func InitSnapshotManager(stateDB dbm.DB, txIndexDB dbm.DB, blockStore *blockchain.BlockStore, ...)
- func RegisterSnapshotMessages(cdc *amino.Codec)
- type BlockchainStateMessage
- type SnapshotManager
- func (mgr *SnapshotManager) Delete() error
- func (mgr *SnapshotManager) Finalize() error
- func (mgr *SnapshotManager) GetBlockStore() *blockchain.BlockStore
- func (mgr *SnapshotManager) GetStateDB() dbm.DB
- func (mgr *SnapshotManager) GetTxDB() dbm.DB
- func (mgr *SnapshotManager) IsFinalized() bool
- func (mgr *SnapshotManager) SelfFinalize(numKeys []int64) error
- func (mgr *SnapshotManager) WriteAppStateChunk(chunk *abci.AppStateChunk) error
- func (mgr *SnapshotManager) WriteManifest(hash abci.SHA256Sum, manifest *abci.Manifest) error
- type SnapshotRequest
- type StatePool
- type StateReactor
- func (bcSR *StateReactor) AddPeer(peer p2p.Peer)
- func (bcSR *StateReactor) BroadcastStateStatusRequest()
- func (_ *StateReactor) GetChannels() []*p2p.ChannelDescriptor
- func (bcSR *StateReactor) OnStart() error
- func (bcSR *StateReactor) OnStop()
- func (bcSR *StateReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)
- func (bcSR *StateReactor) RemovePeer(peer p2p.Peer, reason interface{})
- func (bcSR *StateReactor) SetLogger(l log.Logger)
Constants ¶
const ( // StateSyncChannel is a channel for state and status updates (`StateStore` height) // First implementation (range request) of state sync is 0x35 StateSyncChannel = byte(0x36) )
Variables ¶
This section is empty.
Functions ¶
func InitSnapshotManager ¶
func InitSnapshotManager( stateDB dbm.DB, txIndexDB dbm.DB, blockStore *blockchain.BlockStore, dbDir string, logger log.Logger)
func RegisterSnapshotMessages ¶
func RegisterSnapshotMessages(cdc *amino.Codec)
Types ¶
type BlockchainStateMessage ¶
type BlockchainStateMessage interface{}
BlockchainStateMessage is a generic message for this reactor.
type SnapshotManager ¶
type SnapshotManager struct { RestorationManifest *abci.Manifest Reader abci.SnapshotReader Writer abci.SnapshotWriter // contains filtered or unexported fields }
application should only interact with this manager (not internal Reader/Writer) but we have to expose reader/writer to make tendermint state sync reactor manipulate low level data
func Manager ¶
func Manager() *SnapshotManager
func ManagerAt ¶
func ManagerAt(height int64) *SnapshotManager
func (*SnapshotManager) Delete ¶
func (mgr *SnapshotManager) Delete() error
func (*SnapshotManager) Finalize ¶
func (mgr *SnapshotManager) Finalize() error
finalize snapshot we synced from peer
func (*SnapshotManager) GetBlockStore ¶
func (mgr *SnapshotManager) GetBlockStore() *blockchain.BlockStore
func (*SnapshotManager) GetStateDB ¶
func (mgr *SnapshotManager) GetStateDB() dbm.DB
func (*SnapshotManager) GetTxDB ¶
func (mgr *SnapshotManager) GetTxDB() dbm.DB
func (*SnapshotManager) IsFinalized ¶
func (mgr *SnapshotManager) IsFinalized() bool
func (*SnapshotManager) SelfFinalize ¶
func (mgr *SnapshotManager) SelfFinalize(numKeys []int64) error
finalize snapshot we generated by ourselves
func (*SnapshotManager) WriteAppStateChunk ¶
func (mgr *SnapshotManager) WriteAppStateChunk(chunk *abci.AppStateChunk) error
func (*SnapshotManager) WriteManifest ¶
type SnapshotRequest ¶
func (SnapshotRequest) String ¶
func (req SnapshotRequest) String() string
type StatePool ¶
type StatePool struct { cmn.BaseService // contains filtered or unexported fields }
func NewStatePool ¶
func NewStatePool(app proxy.AppConnState, requestsCh chan<- SnapshotRequest, errorsCh chan<- peerError, stateDB dbm.DB) *StatePool
type StateReactor ¶
type StateReactor struct { p2p.BaseReactor // contains filtered or unexported fields }
StateReactor handles initial state syncing. User manual: https://docs.binance.org/fullnode.html#state-sync
func NewStateReactor ¶
func NewStateReactor(stateDB dbm.DB, app proxy.AppConnState, config *cfg.Config) *StateReactor
NewStateReactor returns new reactor instance.
func (*StateReactor) AddPeer ¶
func (bcSR *StateReactor) AddPeer(peer p2p.Peer)
AddPeer implements Reactor by sending our state to peer.
func (*StateReactor) BroadcastStateStatusRequest ¶
func (bcSR *StateReactor) BroadcastStateStatusRequest()
BroadcastStatusRequest broadcasts `StateStore` height.
func (*StateReactor) GetChannels ¶
func (_ *StateReactor) GetChannels() []*p2p.ChannelDescriptor
GetChannels implements Reactor
func (*StateReactor) OnStart ¶
func (bcSR *StateReactor) OnStart() error
OnStart implements cmn.Service.
func (*StateReactor) Receive ¶
func (bcSR *StateReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)
Receive implements Reactor by handling 4 types of messages (see below).
func (*StateReactor) RemovePeer ¶
func (bcSR *StateReactor) RemovePeer(peer p2p.Peer, reason interface{})
RemovePeer implements Reactor by removing peer from the pool.
func (*StateReactor) SetLogger ¶
func (bcSR *StateReactor) SetLogger(l log.Logger)
SetLogger implements cmn.Service by setting the logger on reactor and pool.