-
Notifications
You must be signed in to change notification settings - Fork 1.2k
custom-ipfs-repo example broken #1557
Comments
So the end error that's showing up here is a bit misleading as it's a result of different errors wrapping each other. Fun stuff! The root issue here is around the work we need to do with adding error codes to all errors. In The reason they break is that since the error isn't properly identified, they go ahead and try to create a cid with the undefined result, https://github.com/ipfs/js-ipfs-mfs/blob/v0.3.2/src/core/utils/with-mfs-root.js#L41, which throws an error, making everyone sad. OptionsI have verified these work with some quick node_module modifications.
@alanshaw @vasco-santos what do you think? I could probably get PRs out for option 2 to all the datastores and possibly releases (provided I have permissions to all of them) tomorrow. |
Also, I was wrong about the error wrapping, they're just two different areas with the same problem. https://github.com/ipfs/js-ipfs/blob/v0.32.0/src/core/ipns/publisher.js#L194 ipns publisher is also only checking for the LevelDown not found. This will need to be updated like mfs. |
I've got an initial implementation of some of the base codes over at interface-datastore#22. There's a link there to the datastore-fs update that includes those. |
@jacobheun 👍 to option 2 |
Thanks for your analyze @jacobheun ! 🙂 I agree with the Option 2! Yes, |
All of the PRs should be open now, we're just blocked on some releases. I updated the package.json of this example locally to test against and didn't hit any errors with a yarn install. "dependencies": {
"datastore-fs": "~0.5.0",
"ipfs": "github:ipfs/js-ipfs#fix/ipns-datastore-get-not-found",
"ipfs-repo": "~0.23.1"
},
"resolutions": {
"interface-datastore": "github:ipfs/interface-datastore#feat/err-codes",
"datastore-fs": "github:ipfs/js-datastore-fs#feat/err-codes",
"ipfs-mfs": "github:ipfs/js-ipfs-mfs#fix/err-code"
} I have also verified the changes against the s3 example, https://github.com/ipfs/js-datastore-s3/tree/master/examples/full-s3-repo |
@jacobheun thanks for being so thorough 🥇 ❤️ |
js-ipfs#1558 PR is ready. After that and js-ipfs-mfs#10 get merged and new I will keep an eye on those PRs and try it once they get merged. |
Once we get the ipfs-mfs version released and bumped in the #1558 PR, I can run through a final test of the custom repo and the s3 datastore example for final validation. |
@vasco-santos @jacobheun could one if you confirm the example is fixed so we can close this one 🙏 |
Sure, on it! |
Updated to the following: "dependencies": {
"datastore-fs": "~0.6.0",
"ipfs": "file:../../",
"ipfs-repo": "~0.24.0"
} I am having a problem with
After debugging it, I managed to find that this problem was caused by js-ipfs#core/mfs-preload.js#L37 @achingbrain any clue on this? |
The code tries to create the MFS root if it doesn't exist. Looks like Does |
@vasco-santos what do you run when you see that error? If I do $ node index.js
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/QmWmadHLZVmt5mQLdWdAq13MDQgQ28aExAqdvHgXgyKfFe
Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/QmWmadHLZVmt5mQLdWdAq13MDQgQ28aExAqdvHgXgyKfFe
Swarm listening on /ip4/192.168.1.13/tcp/4002/ipfs/QmWmadHLZVmt5mQLdWdAq13MDQgQ28aExAqdvHgXgyKfFe
Ready
Version: 0.32.3
Added file: test-data.txt QmZcvUvxNc8P9NebseeCfrDHn4xQwNTmrwWtuY8PDr9c3C
Fetched file content:
We are using a customized repo!
Stopping the node
Check "/tmp/custom-repo/.ipfs" to see what your customized repository looks like on disk. |
I did a clean install of modules from ipfs master with the custom-ipfs-repo package.json matching @vasco-santos 's changes. The example works properly there, I'm seeing what @achingbrain is getting. I also ran the s3 example, using the latest ipfs and ipfs-repo, and it is also working properly. |
Strange, I think I had a clean install. Let me double check. |
Ok, now that I also removed the I will create a PR for bumping the examples version then |
With dependencies upgraded to:
"datastore-fs": "~0.5.0",
"ipfs-repo": "~0.23.1"
The text was updated successfully, but these errors were encountered: