ipfs / ipfs/kubo

User experience: ipfs get should spawn a daemon if it does not yet exist

Open
#4,654 3 comments 4 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:

0.4.13-cc01b7f

#### Type:

User experience enhancement.

#### Description:

I am trying to use IPFS to share large datasets with some of my fellow researchers. While they might be used to command line, they are not familiar with IPFS. So my hope was that I could tell them that to download a dataset, they can do only:

```
snap install ipfs
ipfs get
```

Sadly, it is not so easy. `init` is missing. The error is pretty clear about that, so I think this is good:

```
Error: no IPFS repo found in /home/user/.ipfs.
please run: 'ipfs init'
```

But after user runs it and retries, the error is completely cryptic:

```
Error: merkledag: not found
```

Once reported to me, I had no idea what this is. I had to ask around. And it looked to me like our seed server maybe went down. So the issue is that daemon is not running. But ideally, there would be an error message saying that if it is so. I mean, command should know that a daemon is not running, or it should work.

So, my basic suggestion would be to improve the error message here. With similar message like "please run: 'ipfs daemon'". But of course the issue is that daemon has to be run in another terminal.

So my real proposal is: if a daemon is not running, maybe commands should start it in the background, in a mode that it would be around for few minutes after the last activity, and then stop itself. That would make it really neat. And for init, that could also happen automatically, or maybe with `ipfs get --init` flag or something.

`git` does this for its garbage collection. I was really surprised the first time but it is reasonable and really works well. So instead of hanging the command line, it just says that it will do garbage collect in the background and then also every command you do it says that there is a background command running. I think ipfs command line could have the same. If daemon is not running, it would say that it started a daemon in the background. And then every next command would say that "autostarted daemon is running in the background and will stop after X minutes of inactivtiy".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.