services

package
v0.3.1-dirty Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DASer

func DASer(
	lc fx.Lifecycle,
	avail share.Availability,
	sub header.Subscriber,
	hstore header.Store,
	ds datastore.Batching,
) *das.DASer

DASer constructs a new Data Availability Sampler.

func FullAvailability added in v0.2.0

func FullAvailability(bServ blockservice.BlockService) share.Availability

func HeaderExchangeP2P

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

HeaderExchangeP2P constructs new Exchange for headers.

func HeaderP2PExchangeServer added in v0.2.0

func HeaderP2PExchangeServer(lc fx.Lifecycle, host host.Host, store header.Store) *p2p.ExchangeServer

HeaderP2PExchangeServer creates a new header/p2p.ExchangeServer.

func HeaderService

func HeaderService(
	syncer *sync.Syncer,
	sub header.Subscriber,
	p2pServer *p2p.ExchangeServer,
	ex header.Exchange,
	store header.Store,
) *headerservice.Service

HeaderService creates a new header.Service.

func HeaderStore

func HeaderStore(lc fx.Lifecycle, ds datastore.Batching) (header.Store, error)

HeaderStore creates and initializes new header.Store.

func HeaderStoreInit added in v0.2.0

func HeaderStoreInit(cfg *Config) func(context.Context, params.Network, header.Store, header.Exchange) error

HeaderStoreInit initializes the store.

func HeaderSyncer

func HeaderSyncer(
	lc fx.Lifecycle,
	ex header.Exchange,
	store header.Store,
	sub header.Subscriber,
) (*sync.Syncer, error)

HeaderSyncer creates a new Syncer.

func LightAvailability

func LightAvailability(ctx context.Context, lc fx.Lifecycle, bServ blockservice.BlockService) share.Availability

LightAvailability constructs light share availability.

func P2PSubscriber added in v0.2.0

func P2PSubscriber(lc fx.Lifecycle, sub *pubsub.PubSub) (*p2p.Subscriber, *p2p.Subscriber)

P2PSubscriber creates a new p2p.Subscriber.

func ShareService

func ShareService(lc fx.Lifecycle, bServ blockservice.BlockService, avail share.Availability) *share.Service

ShareService constructs new share.Service.

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
}

func DefaultConfig

func DefaultConfig() Config

Jump to

Keyboard shortcuts

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