Documentation
¶
Index ¶
- func BlockService(lc fx.Lifecycle, fetcher *core.BlockFetcher, store ipld.DAGService, ...) *block.Service
- func DASer(lc fx.Lifecycle, avail share.Availability, service *header.Service) *das.DASer
- func HeaderExchangeP2P(cfg Config) ...
- func HeaderService(lc fx.Lifecycle, syncer *header.Syncer, sub *pubsub.PubSub) (*header.Service, header.Broadcaster)
- func HeaderStore(ds datastore.Batching) (header.Store, error)
- func HeaderSyncer(cfg Config) func(ex header.Exchange, store header.Store) (*header.Syncer, error)
- func LightAvailability(ctx context.Context, lc fx.Lifecycle, dag ipld.DAGService) share.Availability
- func ShareService(lc fx.Lifecycle, dag ipld.DAGService, avail share.Availability) share.Service
- func StartHeaderExchangeP2PServer(lc fx.Lifecycle, host host.Host, store header.Store)
- type Config
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 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 ¶
HeaderStore creates new header.Store.
func HeaderSyncer ¶
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.
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.
Click to show internal directories.
Click to hide internal directories.