-
Notifications
You must be signed in to change notification settings - Fork 204
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
Add codecs for IPFS Cluster #118
Conversation
It would be useful for Cluster to have our own block codes so that we can identify ownership of blocks from their CIDs.
Are these IPLD codecs? |
@Stebalien if you mean that CIDs with these codecs will refer to blocks that decode to |
As in, will you be registering a new IPLD format? |
@Stebalien not yet. Right now, we're going to use existing cbor and protobuf and this would just work as aliases. But we might replace them in the future. Also, @lanzafame thought that being able to decide if a block in the ipfs datastore belongs to IPFS cluster (by using our own codecs) might be very useful when doing disaster recovery. Is it a problem to reserve codecs like this and we should stick to |
So, "codec" part of a CID isn't really supposed to be used as a "type" in this way. It's supposed to tell you how to interpret the target data as a structured IPLD object, not how to interpret the resulting IPLD object. They exist for interoperability with existing systems and to allow us to introduce new serialization formats with new features. The drawback to adding new codecs like this is that everyone will need to completely understand that new codec to do anything useful with the data (e.g., follow a link). Let's say you're building a webapp and add a custom IPLD format + codec. Now you ask go-ipfs to resolve |
I fully understand your point. For the sake of the argument, normally the node's data is opaque anyway, so the only useful thing for go-ipfs is Cid() and Link-related operations (ipld.Node). In the case of other apps, they still need to manually register the cbor or the protobuf codec along with the right decoder to work with these formats. In that light, It does not seem completely out of place to register the cluster codecbytes+decoder to understand nodes created by cluster for cluster, even if the underlying format happens to be That said, it is in our interest that go-ipfs understands our blocks and I don't think my arguments are strong enough to support adding our aliases to go-ipfs codebase for what is already a supported format in the end. Would reserving codecs for future use (in case we do create our own formats) be ok (I'd rename accordingly)? Or would you rather let this sit until that moment happens? |
Could you create a special reference type? Something like:
Honestly, this is the "right" way to do this from IPLD's standpoint. |
@hsanjuan I think 5 years later we just do either dag-pb or dag-cbor, and don't need these? |
Yep. |
It would be useful for Cluster to have our own block codes so that
we can identify ownership of blocks from their CIDs.
cc. @lanzafame