services

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockService

func BlockService(
	lc fx.Lifecycle,
	fetcher *core.BlockFetcher,
	store ipld.DAGService,
	broadcaster header.Broadcaster,
) *block.Service

BlockService constructs new block.Service.

func DASer

func DASer(lc fx.Lifecycle, avail share.Availability, service *header.Service) *das.DASer

DASer constructs a new Data Availability Sampler.

func HeaderExchangeP2P

func HeaderExchangeP2P(cfg Config) func(
	lc fx.Lifecycle,
	host host.Host,
	store header.Store,
) (header.Exchange, error)

HeaderExchangeP2P constructs new P2PExchange for headers.

func HeaderService

func HeaderService(lc fx.Lifecycle, syncer *header.Syncer, sub *pubsub.PubSub) (*header.Service, header.Broadcaster)

HeaderService creates a new header.Service.

func HeaderStore

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

HeaderStore creates new header.Store.

func HeaderSyncer

func HeaderSyncer(cfg Config) func(ex header.Exchange, store header.Store) (*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 ShareService

func ShareService(lc fx.Lifecycle, dag ipld.DAGService, avail share.Availability) share.Service

ShareService constructs new share.Service.

func StartHeaderExchangeP2PServer

func StartHeaderExchangeP2PServer(lc fx.Lifecycle, host host.Host, store header.Store)

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
	// TrustedPeer is the peer 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.
	TrustedPeer 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