Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs: remove wrapping blockservice and add ToBlockServiceBlocker helper #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jorropo
Copy link

@Jorropo Jorropo commented Jan 15, 2024

Fixes #34

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
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
Author

Jorropo commented Jan 15, 2024

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

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
1 participant