Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPFS 0.5.0-rc4: ipfs daemon ignoring --routing switch #7220

Closed
pataquets opened this issue Apr 27, 2020 · 3 comments
Closed

IPFS 0.5.0-rc4: ipfs daemon ignoring --routing switch #7220

pataquets opened this issue Apr 27, 2020 · 3 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@pataquets
Copy link
Contributor

Version information:

$ docker pull ipfs/go-ipfs
Using default tag: latest
latest: Pulling from ipfs/go-ipfs
Digest: sha256:9000b64a8e4cb5970ba4c2f75b7ab0c324a6e3604300dca6fdb7fe06dd800066
Status: Image is up to date for ipfs/go-ipfs:latest

$ docker run --rm -it --name=ipfs --net=host ipfs/go-ipfs --version --all
Changing user to ipfs
ipfs version 0.5.0-rc4
initializing IPFS node at /data/ipfs
generating 2048-bit RSA keypair...done
peer identity: QmVbYKyF3GoTtB7c2dydRcq8gzGwxN1NaruArgYoD8S6kz
to get started, enter:

	ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme

go-ipfs version: 0.5.0-rc4-116999a
Repo version: 9
System version: amd64/linux
Golang version: go1.13.10

Since I'm using :latest image tag, I've included the docker pull image digest.

Description:

Starting an IPFS container overriding the config file DHT setting by using the daemon command --routing switch, as per daemon --help:

$ docker run --rm -it --name=ipfs --net=host ipfs/go-ipfs daemon --migrate=true --routing=dhtclient
Changing user to ipfs
ipfs version 0.5.0-rc4
initializing IPFS node at /data/ipfs
generating 2048-bit RSA keypair...done
peer identity: QmPx1uFqwCRxq5cHvzFQEy9RKqVEVBK6UVyLnCW7QXodrn
to get started, enter:

	ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme

Initializing daemon...
go-ipfs version: 0.5.0-rc4-116999a
Repo version: 9
System version: amd64/linux
Golang version: go1.13.10
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/172.17.0.1/tcp/4001
Swarm listening on /ip4/172.18.0.1/tcp/4001
Swarm listening on /ip4/REDACTED_LAN_IP/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/172.17.0.1/tcp/4001
Swarm announcing /ip4/172.18.0.1/tcp/4001
Swarm announcing /ip4/REDACTED_WAN_IP/tcp/4001
Swarm announcing /ip4/REDACTED_LAN_IP/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/0.0.0.0/tcp/5001
WebUI: http://0.0.0.0:5001/webui
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
Daemon is ready

Daemon keeps running OK. From another terminal, I check the configuration value:

$ docker exec -it ipfs ipfs config Routing.Type
dht

Also, a full config show outputs the same.

For completeness, let's check if it gets a manual configuration change:

$ docker exec -it ipfs ipfs config Routing.Type dhtclient

$ docker exec -it ipfs ipfs config Routing.Type
dhtclient

Works OK.

@pataquets pataquets added the kind/bug A bug in existing code (including security flaws) label Apr 27, 2020
@pataquets pataquets mentioned this issue Apr 27, 2020
71 tasks
@Stebalien
Copy link
Member

The --routing flag overrides the Routing.Type config value at runtime but doesn't actually change the config value. ipfs config Routing.Type will return the value in the config file.

@pataquets
Copy link
Contributor Author

OK, I understand. Even if IPFS honors the switch, I see a problem here, at least from the UX standpoint. It kept me puzzled after re-reading the docs and double-checking everything. It even made me file a bug report :)
Initially I looked at the config file and saw "dht". But it was reasonable that, as a temporary override, it might not be persisted. So, I checked it also via ipfs config, afterwards, which I expected to actually return the setting value currently in effect, no matter what the config file says.
I think ipfs config should return the current setting value, but I understand that it might be quite involved. As a stopgap measure, a log message stating that the override is in effect might minimize/avoid some head scratching, meanwhile.

@Stebalien
Copy link
Member

You're right, this is not good from a ux perspective.

Ideally, we'd implement #4180 and fix #8776. That way, we can have a "runtime" config and an "on disk" config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants