Documentation ¶
Index ¶
- Constants
- func AuthorizedRequester(allowedNodes map[flow.Identifier]bool, ...) func(peer.ID, cid.Cid) bool
- func NewBlobService(host host.Host, r routing.ContentRouting, prefix string, ds datastore.Batching, ...) (*blobService, error)
- func WithBitswapOptions(opts ...bitswap.Option) network.BlobServiceOption
- func WithHashOnRead(enabled bool) network.BlobServiceOption
- func WithParentBlobService(parent network.BlobService) network.BlobServiceOption
- func WithRateLimit(r float64, b int) network.BlobServiceOption
- func WithReprovideInterval(d time.Duration) network.BlobServiceOption
- type BlobServiceConfig
- type Tracer
Constants ¶
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 Tracer ¶ added in v0.29.0
type Tracer struct {
// contains filtered or unexported fields
}
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)