ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.16k stars 3.01k forks source link

"ipfs add -n FILE" should not require "ipfs init" #7990

Open chevdor opened 3 years ago

chevdor commented 3 years ago

Version information:

go-ipfs version: 0.8.0
Repo version: 11
System version: amd64/linux
Golang version: go1.15.8

Description:

When adding a file using -n (--only-hash), there should not be the need to initialize the IPFS repo. Currently, if you install ipfs but don't run ipfs init(or cleanup using rm -rf ~/.ipfs), ipfs add -n FILE will fail with:

Error: no IPFS repo found in /root/.ipfs.
please run: 'ipfs init'

So it is correct that no IPFS repo can be found but that should not be required to only hash.

Stebalien commented 3 years ago

Ideally, we wouldn't require the repo in this case.

Unfortunately, we open the repo long before we process these flags so fixing this is far from trivial and probably won't happen any time soon.

QuAzI commented 2 years ago

Is file hash/ipfs url depends on repo?