blob

package
v0.29.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizedRequester

func AuthorizedRequester(
	allowedNodes map[flow.Identifier]bool,
	identityProvider module.IdentityProvider,
	logger zerolog.Logger,
) func(peer.ID, cid.Cid) bool

AuthorizedRequester returns a callback function used by bitswap to authorize block requests A request is authorized if the peer is * known by the identity provider * not ejected * an Access node * in the allowedNodes list (if non-empty)

func NewBlobService

func NewBlobService(
	host host.Host,
	r routing.ContentRouting,
	prefix string,
	ds datastore.Batching,
	metrics module.BitswapMetrics,
	logger zerolog.Logger,
	opts ...network.BlobServiceOption,
) *blobService

NewBlobService creates a new BlobService.

func WithBitswapOptions

func WithBitswapOptions(opts ...bitswap.Option) network.BlobServiceOption

WithBitswapOptions sets additional options for Bitswap exchange

func WithHashOnRead

func WithHashOnRead(enabled bool) network.BlobServiceOption

WithHashOnRead sets whether or not the blobstore will rehash the blob data on read When set, calls to GetBlob will fail with an error if the hash of the data in storage does not match its CID

func WithRateLimit

func WithRateLimit(r float64, b int) network.BlobServiceOption

WithRateLimit sets a rate limit on reads from the underlying datastore that allows up to r bytes per second and permits bursts of at most b bytes. Note that b should be set to at least the max blob size, otherwise blobs larger than b cannot be read from the blobstore.

func WithReprovideInterval

func WithReprovideInterval(d time.Duration) network.BlobServiceOption

WithReprovideInterval sets the interval at which DHT provider entries are refreshed

Types

type BlobServiceConfig

type BlobServiceConfig struct {
	ReprovideInterval time.Duration    // the interval at which the DHT provider entries are refreshed
	BitswapOptions    []bitswap.Option // options to pass to the Bitswap service
}

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

func NewTracer

func NewTracer(logger zerolog.Logger) *Tracer

func (*Tracer) MessageReceived

func (t *Tracer) MessageReceived(pid peer.ID, msg bsmsg.BitSwapMessage)

func (*Tracer) MessageSent

func (t *Tracer) MessageSent(pid peer.ID, msg bsmsg.BitSwapMessage)

Jump to

Keyboard shortcuts

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