I have explicit need to have ipfs daemon running all the time on OS X. Specifically I need to be ablt to access http api on 127.0.0.1:5001
For this I have included ipfs dist and LaunchAgent plist into installation, but I have encountered few issues:
Explicit need to init the daemon before running it makes it harder for OS to keep track of the process since Iām forced to use script in which ipfs init && ipfs daemon are scripted. I canāt just feed launch agent the āipfs daemonā because it will fail if not init-ed. How to avoid it?
After some time users have problems accessing http api because ipfs requres explicit permission to escalate DB version which cannot be done (as I run launchagent as root) by user and he doesnāt know about it. process fails on start
In general: whatās the best way to keep daemon alive (maybe use js version?), I just need persistent access to http api and users donāt care that daemon is failing, they only see my program not working and they wonāt manage ipfs themselves
You can start the daemon with --init, that way IPFS would run ipfs init for you, if necessary.
The repo wonāt update by itself, only when you run ipfs init with a new repository version OR when using https://github.com/ipfs/fs-repo-migrations. If you keep using the same IPFS version, the repository will continue to work with that version.
I guess you could add some utility command that would compare a new IPFS version with the current one, and run fs-repo-migrations if different, then download and install the new version.
Another question: is there a good way to install IPFS as a service on Windows? I tried to do it, but IPFS doesnāt release launch frame when started (not return value), thus making windows believe service is still starting up. It waits for it for like 2 minutes and terminates as failure. Is there any workaround?
When i start it using ānssm ipfs startā (need to start it as Administrator), my files was missing in localhost:5001 / Files page
But when i start it using āipfs daemon --initā my files are back there in
localhost:5001 / Files page
i installed nssm service using advised command ānssm install ipfs ipfs daemon --initā, i hope i did it via Administrator command window. Not sure what is the problem, why files are different/missing. :-/
you need set IPFS_PATH as system variableļ¼if you set IPFS_PATH as user variableļ¼ipfs will start with config file in a place like āC:\Windows\System32\config\systemprofile.ipfs\configā,it may not your want config file and storge.