WIP: Feat/toggle ipfs implementation #726
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Seeking feedback. Working on enabling toggling between IPFS implementations.
I'm running into an issue. Essentially, after experimenting with a select component for the toggle in the WebUI settings page, but realized that it would add too much code for something that is essentially just a toggle. So, instead of a select, I went with the checkbox which allowed me to just reuse most of the existing logic and just add a new hook. Now the code I wrote (in src/hooks/implementation.js) executes on startup - it doesn't seem to have 'go' as a default, and I'm having trouble sorting out how to prevent it from trying to start the daemon a second time. At least I think that's what this error means:
(node:26947) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5001 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14) (node:26947)
Here are a few more things that I know I'm seeking feedback on, but of course I'm open to any feedback.
What should I do with the flags in the daemon creator? I found that I needed to disable them to get the JS node to spawn, but I'm not sure what they do. Obviously, I'll want to re-enable those flags whenever go is enabled for the final commit, but what should I do when js is enabled?
Re: dependencies: I've got both ipfs and js-ipfs added as dependencies. Are both necessary or are they redundant? If so, should i pick one over the other?
Not in this PR but as far as the webui: is a checkbox sufficient for this or is the select preferable?
Obviously need to do some housekeeping: squash commits, rollback the change of apiAddress in webui/index.js , remove the logger in src/utils/daemon.js. What other similar tasks jump out to you right away? I'm unfamiliar with package-lock files, and not sure what I did to change this one, but is this something that should go in my git-ignore? globally?