Help us shape the future of Go! Take the 2026 Go Developer Survey

syncer

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: GPL-3.0, LGPL-3.0, BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is the collection of synchronization service APIs for debugging the protocol.

func NewAPI

func NewAPI(s *Syncer) *API

NewAPI creates a new debug API instance.

func (*API) Sync

func (api *API) Sync(target common.Hash) error

Sync initiates a full sync to the target block hash.

type Syncer

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

Syncer is an auxiliary service that allows Geth to perform full sync alone without consensus-layer attached. Users must specify a valid block hash as the sync target.

This tool can be applied to different networks, no matter it's pre-merge or post-merge, but only for full-sync.

func Register

func Register(stack *node.Node, backend *eth.Ethereum, target common.Hash, exitWhenSynced bool) (*Syncer, error)

Register registers the synchronization override service into the node stack for launching and stopping the service controlled by node.

func (*Syncer) APIs

func (s *Syncer) APIs() []rpc.API

APIs return the collection of RPC services the ethereum package offers. NOTE, some of these services probably need to be moved to somewhere else.

func (*Syncer) Start

func (s *Syncer) Start() error

Start launches the synchronization service.

func (*Syncer) Stop

func (s *Syncer) Stop() error

Stop terminates the synchronization service and stop all background activities. This function can only be called for one time.

func (*Syncer) Sync

func (s *Syncer) Sync(hash common.Hash) error

Sync sets the synchronization target. Notably, setting a target lower than the previous one is not allowed, as backward synchronization is not supported.

Jump to

Keyboard shortcuts

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