blob

package
v0.35.14-crescendo-pre... Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultReprovideInterval is the default interval at which DHT provider entries are refreshed
	DefaultReprovideInterval = 12 * time.Hour
)

Variables

This section is empty.

Functions

func AuthorizedRequester added in v0.28.2

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, error)

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 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 WithParentBlobService added in v0.33.19

func WithParentBlobService(parent network.BlobService) network.BlobServiceOption

WithParentBlobService configures the blob service to use the parent's blockstore

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 added in v0.29.0

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

func NewTracer added in v0.29.0

func NewTracer(logger zerolog.Logger) *Tracer

func (*Tracer) MessageReceived added in v0.29.0

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

func (*Tracer) MessageSent added in v0.29.0

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