Skip to content

ipfs: remove wrapping blockservice and add ToBlockServiceBlocker helper#35

Closed
Jorropo wants to merge 1 commit intoipfs-shipyard:masterfrom
Jorropo:new-blockservice-blocker
Closed

ipfs: remove wrapping blockservice and add ToBlockServiceBlocker helper#35
Jorropo wants to merge 1 commit intoipfs-shipyard:masterfrom
Jorropo:new-blockservice-blocker

Conversation

@Jorropo
Copy link
Copy Markdown

@Jorropo Jorropo commented Jan 15, 2024

Fixes #34

Comment thread ipfs/blockservice.go
return nbs.bs.DeleteBlock(ctx, o)
// Deprecated: Use [ToBlockServiceBlocker] and pass [blockservice.WithContentBlocker] option when constructing your blockservice.
func WrapBlockService(bs blockservice.BlockService, blocker *nopfs.Blocker) blockservice.BlockService {
return blockservice.New(bs.Blockstore(), bs.Exchange(), blockservice.WithContentBlocker(ToBlockServiceBlocker(blocker)))
Copy link
Copy Markdown
Author

@Jorropo Jorropo Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loose other options passed in like WriteThrough or custom allowlist. Might be worth fully breaking the API. Outside of Rainbow and Kubo I don't know of nopfs consumers.

@Jorropo
Copy link
Copy Markdown
Author

Jorropo commented Jan 15, 2024

Depends on ipfs/boxo#556 (go.mod should be updated with in main SHA once merged)

@Jorropo Jorropo force-pushed the new-blockservice-blocker branch from 41a0028 to 7358813 Compare January 15, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ipfs blockservice is incompatible with sessions

2 participants