header

package
v0.4.6-dirty Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitStore added in v0.6.2

func InitStore(ctx context.Context, cfg Config, net params.Network, s header.Store, ex header.Exchange) error

InitStore initializes the store.

func Module

func Module(tp node.Type, cfg *Config) fx.Option

func P2PExchange

func P2PExchange(cfg Config) func(params.Bootstrappers, host.Host) (header.Exchange, error)

P2PExchange constructs new Exchange for headers.

func WithMetrics added in v0.7.0

func WithMetrics(enable bool) fx.Option

TODO: Eventually we should have a per-module metrics option. WithMetrics enables metrics exporting for the node.

Types

type Config

type Config struct {
	// TrustedHash is the Block/Header hash that Nodes use as starting point for header synchronization.
	// Only affects the node once on initial sync.
	TrustedHash string
	// TrustedPeers are the peers we trust to fetch headers from.
	// Note: The trusted does *not* imply Headers are not verified, but trusted as reliable to fetch headers
	// at any moment.
	TrustedPeers []string
}

Config contains configuration parameters for header retrieval and management.

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (cfg *Config) Validate() error

Validate performs basic validation of the config.

Jump to

Keyboard shortcuts

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