services

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockService

func BlockService(
	lc fx.Lifecycle,
	store ipld.DAGService,
) *block.Service

BlockService constructs new block.Service.

func DASer

func DASer(lc fx.Lifecycle, avail share.Availability, sub header.Subscriber) *das.DASer

DASer constructs a new Data Availability Sampler.

func FullAvailability added in v0.2.0

func FullAvailability(ctx context.Context, lc fx.Lifecycle, dag ipld.DAGService) share.Availability

func HeaderExchangeP2P

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

HeaderExchangeP2P constructs new P2PExchange for headers.

func HeaderP2PExchangeServer added in v0.2.0

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

HeaderP2PExchangeServer creates a new header.P2PExchangeServer.

func HeaderService

func HeaderService(
	syncer *header.Syncer,
	sub header.Subscriber,
	p2pServer *header.P2PExchangeServer,
	ex header.Exchange,
) *header.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, 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,
) (*header.Syncer, error)

HeaderSyncer creates a new header.Syncer.

func LightAvailability

func LightAvailability(ctx context.Context, lc fx.Lifecycle, dag ipld.DAGService) share.Availability

LightAvailability constructs light share availability.

func P2PSubscriber added in v0.2.0

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

P2PSubscriber creates a new header.P2PSubscriber.

func ShareService

func ShareService(lc fx.Lifecycle, dag ipld.DAGService, 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

TODO(@Wondertan): We need to hardcode trustedHash hash and one bootstrap peer as trusted.

Jump to

Keyboard shortcuts

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