aragon / aragon-cli

CLI for creating and publishing Aragon apps
GNU General Public License v3.0
91 stars 79 forks source link

IPFS init: checking whether .ipfs exists is brittle (e.g. when IPFS is installed via SNAP) #744

Open Quazia opened 5 years ago

Quazia commented 5 years ago

🐛 Bug Report

Currently when checking if IPFS has been initaited the check is whether .ipfs exists at the home directory, depending on how IPFS is installed this might not be the correct location to check in order to know if IPFS has been installed. As a work-around you can just touch ~/.ipfs and everything works fine but this doesn't seem like a good long term solution.

Have you read the Contributing Guidelines on issues?

Yes

Context

Mainnet or testnet?

Testnet

Organization

Autark

Environment

To Reproduce

Install IPFS using SNAP Run aragon ipfs

Expected behavior

IPFS would run without trying to re-initialize

Actual Behavior

  ⠸ Start IPFS
    → Starting IPFS at port: 5001
    Add local files
(node:29116) UnhandledPromiseRejectionWarning: Error: Command failed: /snap/bin/ipfs init
Error: ipfs configuration file already exists!
Reinitializing would overwrite your keys.

initializing IPFS node at /home/q/snap/ipfs/1170/.ipfs

    at makeError (/home/q/.nvm/versions/node/v10.11.0/lib/node_modules/@aragon/cli/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/home/q/.nvm/versions/node/v10.11.0/lib/node_modules/@aragon/cli/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  ✖ Start IPFS
    → Starting IPFS timed out:
    Add local files
✖ Starting IPFS timed out:
sohkai commented 5 years ago

@0x6431346e @0xGabi Wondering if we should change the IPFS check to do a which ipfs instead of the config file?

0xGabi commented 4 years ago

@dapplion you consider is this solution still useful or should we look to solve #744 other way?

dapplion commented 4 years ago

The intention is to use https://github.com/ipfs/js-ipfsd-ctl which handles all the configuration in a disposable way and therefore this should not be a problem

sohkai commented 4 years ago

Just wondering on the above; I'm not sure if we would be able to rely entirely on a disposable IPFS instance since we need the IPFS content generated by the publishing process to be long-lived somewhere.