Add check for already running daemon and custom ports for own daemon #92
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Siderus/Orion!92
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/95-existing-ipfs-daemon"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed?
This PR allows orion to connect to an existing IPFS Api (if available at
http://localhost:5001)https://dev.siderus.team/issues/95
https://github.com/Siderus/Orion/issues/89
@ -16,0 +84,4 @@* Repo: '6',* System: 'amd64/linux',* Golang: 'go1.10'* }We should probably move this into its own function to avoid repeating code.
Shouldn't we change the default ports to the new ones only if the standard ones are taken?
What do you say?
@koalalorenzo this is ready for review 😄
@ -7,4 +6,3 @@import { app, dialog } from 'electron'import pjson from '../package.json'import { get as getAppRoot } from 'app-root-dir'Add some documentation to this method at least, as it will run cmd :D
@ -76,2 +154,3 @@const ipfsProcess = spawnIPFSCommand('init')// Prepare temporary file for logging:const tmpLog = tmpFileSync({keep: true})const tmpLog = tmpFileSync({ keep: true })Add few lines about
ensureAddressesConfigured, why this should be called? what does it do?@ -141,3 +217,3 @@return exec(`${binaryPath} bootstrap add ${strMultiddr}`)return executeIPFSCommand('bootstrap', 'add', `${strMultiddr}`)}add docs here as well :)
@ -34,0 +58,4 @@if (apiVersion !== pjson.ipfsVersion) {alertMessage += `\n\nPlease note: Orion was design with IPFS ${pjson.ipfsVersion} in mind, `alertMessage += `while the available API is running ${apiVersion}.`}Nice :) well done with this!
Why don't we move this in another function with a promise returning true/false based on the answer of the user?
I made quite a few changes as now it works also on macOS:
https://github.com/Siderus/Orion/pull/92/files/8cd37a292e563af9078376fd046c9cef17e7474e..54b7481aca57ed023cd06f2699753148f352bc49
What changed:
index.jspromised-exec(no longer maintained)@0x6431346e tell me what you think!
@ -70,11 +151,9 @@ export function ensuresIPFSInitialised () {if (isIPFSInitialised()) return Promise.resolve()Why do we pass
--api=${global.IPFS_MULTIADDR_API}here and when starting the daemon? since we callensureDaemonConfiguredbeforehand, shouldn't it be set?I'm not sure if this will work, we need to test the app after building it.
EDIT: seems to be ok
@ -56,20 +96,59 @@ app.on('ready', () => {})// Set up crash reports.// Set up the needed stuff as the app launches.ensureDaemonConfiguredis already called on136, do we need it again?@ -56,20 +96,59 @@ app.on('ready', () => {})// Set up crash reports.// Set up the needed stuff as the app launches.One is for the daemon that starts, the other one is to ensure that the configuration is correct for the already running one, but for the configuration there is no live reload AFAIK.
You might be right! I think we need to re-introduce
app-root-dirLooks ready to merge 👍