Versions in this module Expand all Collapse all v0 v0.0.1 May 23, 2023 Changes in this version + const SyncPeerClientLoggerName + var ErrBlockNotFound = errors.New("block not found") + type Blockchain interface + GetBlockByNumber func(uint64, bool) (*types.Block, bool) + Header func() *types.Header + SubscribeEvents func() blockchain.Subscription + VerifyFinalizedBlock func(block *types.Block) (*types.FullBlock, error) + WriteBlock func(*types.Block, string) error + WriteFullBlock func(*types.FullBlock, string) error + type Network interface + AddrInfo func() *peer.AddrInfo + CloseProtocolStream func(protocol string, peerID peer.ID) error + GetPeerDistance func(peer.ID) *big.Int + IsConnected func(peerID peer.ID) bool + NewProtoConnection func(protocol string, peerID peer.ID) (*rawGrpc.ClientConn, error) + NewTopic func(protoID string, obj proto.Message) (*network.Topic, error) + Peers func() []*network.PeerConnInfo + RegisterProtocol func(string, network.Protocol) + SaveProtocolStream func(protocol string, stream *rawGrpc.ClientConn, peerID peer.ID) + SubscribeCh func(context.Context) (<-chan *event.PeerEvent, error) + type NoForkPeer struct + Distance *big.Int + ID peer.ID + Number uint64 + func (p *NoForkPeer) IsBetter(t *NoForkPeer) bool + type PeerMap struct + func NewPeerMap(peers []*NoForkPeer) *PeerMap + func (m *PeerMap) BestPeer(skipMap map[peer.ID]bool) *NoForkPeer + func (m *PeerMap) Put(peers ...*NoForkPeer) + func (m *PeerMap) Remove(peerID peer.ID) + type Progression interface + GetProgression func() *progress.Progression + StartProgression func(startingBlock uint64, subscription blockchain.Subscription) + StopProgression func() + UpdateHighestProgression func(highestBlock uint64) + type SyncPeerClient interface + Close func() + CloseStream func(peerID peer.ID) error + DisablePublishingPeerStatus func() + EnablePublishingPeerStatus func() + GetBlocks func(peer.ID, uint64, time.Duration) (<-chan *types.Block, error) + GetConnectedPeerStatuses func() []*NoForkPeer + GetPeerConnectionUpdateEventCh func() <-chan *event.PeerEvent + GetPeerStatus func(id peer.ID) (*NoForkPeer, error) + GetPeerStatusUpdateCh func() <-chan *NoForkPeer + Start func() error + func NewSyncPeerClient(logger hclog.Logger, network Network, blockchain Blockchain) SyncPeerClient + type SyncPeerService interface + Close func() error + Start func() + func NewSyncPeerService(network Network, blockchain Blockchain) SyncPeerService + type Syncer interface + Close func() error + GetSyncProgression func() *progress.Progression + HasSyncPeer func() bool + Start func() error + Sync func(func(*types.FullBlock) bool) error + func NewSyncer(logger hclog.Logger, network Network, blockchain Blockchain, ...) Syncer