-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Compilation error setting up dag-jose ipld format in newest js-ipfs #3586
Comments
I think you need to add additional methods in your shim to meet the Format definition - looks like the resolver methods are missing. |
Ah, thank you @achingbrain! Are there any examples or documentation of what those resolver methods are supposed to do/look like? They don't show up in the example for adding a custom IPLD format |
Nevermind, I found https://github.com/ipld/interface-ipld-format#local-resolver-methods for docs and https://github.com/ipld/js-ipld-dag-cbor/blob/master/src/resolver.js as an example implementation. I can probably use those to get started. @oed looks like we probably want to add these new resolver functions directly to https://github.com/ceramicnetwork/js-dag-jose |
@oed and I synced up and we think that
When we compile this we get the error:
I tried suppressing the compilation error with |
So to give a final update here, we were able to successfully complete the IPFS upgrade and everything seems to be working. We did, however, have to disable the compilation warning I posted above by adding |
This may be the root cause of the problem here. The type IPFS is expecting is here but it looks like The next js-IPFS release will use the types from interface-ipld-format among other things which may make the above error go away, but it will also be a lot stricter so it may expose other incompatibilities. |
I've opened multiformats/js-multiformats#67 to cover the conversion to the correct legacy IPLD format type. Closing this as that will fix the issue for the next js-IPFS release without the need for the |
Version:
ipfs-core
: "^0.5.2"Platform:
Linux Sonny 5.8.0-43-generic config #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Subsystem:
ipld
Severity:
High
Description:
I'm trying to upgrade our code from using ipfs-core 0.3.0 to 0.5.2, but I'm having compilation failure when trying to instantiate a new IPFS instance with the dagJose IPLD format.
The original version of our code that worked before the upgrade was:
After the upgrade, that code started failing to compile with an error:
So I went to the ipfs docs and found this page on how to use a custom ipld format. So I tried to mimic that approach to setting the format. My new code looks like:
Trying to compile that, however, I get the similar error message:
Any suggestions on what I can do to get this to compile again?
The text was updated successfully, but these errors were encountered: