services

package
v0.3.0-rc2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DASer

func DASer(
	ctx context.Context,
	lc fx.Lifecycle,
	avail share.Availability,
	sub header.Subscriber,
	hstore header.Store,
	ds datastore.Batching,
	fservice fraud.Service,
) *das.DASer

DASer constructs a new Data Availability Sampler.

func FraudService added in v0.3.0

func FraudService(sub *pubsub.PubSub, hstore header.Store) (fraud.Service, fraud.Service, error)

FraudService constructs fraud proof service for bad encoding fraud proofs (BEFPs).

func FullAvailability added in v0.2.0

func FullAvailability(lc fx.Lifecycle, bServ blockservice.BlockService, ds datastore.Batching) share.Availability

FullAvailability constructs full share availability wrapped in cache 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(
	ctx context.Context,
	lc fx.Lifecycle,
	ex header.Exchange,
	store header.Store,
	sub header.Subscriber,
	fsub fraud.Subscriber,
) (*sync.Syncer, error)

HeaderSyncer creates a new Syncer.

func LightAvailability

func LightAvailability(
	lc fx.Lifecycle,
	bServ blockservice.BlockService,
	ds datastore.Batching,
) share.Availability

LightAvailability constructs light share availability wrapped in cache 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