sync

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataRequestEntryLimit    = 20
	DataRequestNodeLimit     = 3
	DataRequestNodeInterval  = time.Millisecond * 300
	DataRequestRoundInterval = time.Second * 3
)
View Source
const (
	NoError errCode = iota
	ErrTimeExpired
	ErrNoData
)

Variables

This section is empty.

Functions

func PeerIDToKey added in v1.2.9

func PeerIDToKey(p module.PeerID) string

Types

type Callback

type Callback interface {
	// contains filtered or unexported methods
}

type Manager

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

func NewSyncManager

func NewSyncManager(db db.Database, nm module.NetworkManager, plt Platform, logger log.Logger) *Manager

func (*Manager) AddRequest added in v1.2.9

func (m *Manager) AddRequest(id db.BucketID, key []byte) error

func (*Manager) NewSyncer

func (m *Manager) NewSyncer(ah, prh, nrh, vh, ed []byte, noBuffer bool) Syncer

func (*Manager) OnJoin

func (m *Manager) OnJoin(id module.PeerID)

func (*Manager) OnLeave

func (m *Manager) OnLeave(id module.PeerID)

func (*Manager) OnReceive

func (m *Manager) OnReceive(pi module.ProtocolInfo, b []byte,
	id module.PeerID) (bool, error)

func (*Manager) SetSyncHandler added in v1.2.9

func (m *Manager) SetSyncHandler(sh SyncerImpl, on bool)

func (*Manager) Start added in v1.2.9

func (m *Manager) Start()

func (*Manager) Term added in v1.2.9

func (m *Manager) Term()

type Platform added in v0.9.1

type Platform interface {
	NewExtensionWithBuilder(builder merkle.Builder, raw []byte) state.ExtensionSnapshot
}

type Result

type Result struct {
	Wss            state.WorldSnapshot
	PatchReceipts  module.ReceiptList
	NormalReceipts module.ReceiptList
}

type Syncer

type Syncer interface {
	ForceSync() (*Result, error)
	Stop()
	Finalize() error
}

type SyncerImpl added in v1.2.9

type SyncerImpl interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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