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

Proper guide on how to create a custom IPFS repo. #210

Closed
vaultec81 opened this issue Oct 1, 2019 · 6 comments
Closed

Proper guide on how to create a custom IPFS repo. #210

vaultec81 opened this issue Oct 1, 2019 · 6 comments

Comments

@vaultec81
Copy link

Hello, I have been trying to create a custom repo that uses webdav as backend. From what it appears, all tests that I can run successfully pass. I have followed similar code design to that of js-datastore-s3. But regardless of what I do IPFS will not startup. I even used datastore-fs for root in storagebackends but to no success.
I would like to know about the proper way to build a custom IPFS repo before I post any specific issues I am having. Any help with this would be heavily appreciated.

@jacobheun
Copy link
Contributor

@vaultec81 this may be an issue with callback vs async support. Is your datastore using async/await similar to the latest datastore s3? If so, I presume you are using ipfs <= 0.37.x?

If so, if you can upgrade, ipfs 0.38 was released yesterday and it now properly supports the latest async datastore usage internally, so that may fix your issue. If you cannot upgrade ipfs yet, you may need to callbackify your datastore in the interim.

@vaultec81
Copy link
Author

@jacobheun The design is similar to s3 async/await. The version of ipfs is 0.38.0. after doing some debugging it appears that IPFS will not initialize a repo.

@jacobheun
Copy link
Contributor

Do you have code up anywhere, or error logs?

@vaultec81
Copy link
Author

https://github.com/vaultec81/js-datastore-webdav
To produce the results

node src/bin.js
(node:19816) UnhandledPromiseRejectionWarning: Error: repo is not initialized yet
    at IpfsRepo._checkInitialized (\js-datastore-webdav\node_modules\ipfs-repo\src\index.js:1
    at processTicksAndRejections (internal/process/task_queues.js:86:5)

Doing some debugging, it appears IPFS does not attempt to write any initialization/configuration files, but it does attempt to read /config and /version

@jacobheun
Copy link
Contributor

@vaultec81 I was mistaken, IPFS 0.38 is still using the callback version of ipfs-repo (0.26.x), so your datastore won't work as it's async. IPFS 0.39, ipfs/js-ipfs#2489, will include the async repo update. It's already in master, but there aren't any release candidates yet. You could either attempt to leverage the IPFS master branch, or callbackify your api until that release or an RC is out.

@achingbrain
Copy link
Member

js-IPFS@0.41.0 contains the async/await upgrade - @vaultec81 do you still see the same problem with this version?

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

No branches or pull requests

3 participants