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 name publish --allow-offline=true
doesn't work when offline
#6458
Comments
@khinsen this is definitely a bit confusing. I think this offline is referring to a daemon instance that has been started with the --offline flag: It's meant to allow the publishing of the name record to the local instance only, not optionally. Although your interpretation is also a completely valid feature. |
@eingenito Thanks for your comments, which provide some enlightenment and some additional confusion. I didn't know about the Looking at this from the application developer's point of view, I see three situations:
The configuration of the daemon is outside of the application developer's influence, so I'd expect the daemon to listen to what I want and either do it or raise an error, depending on its configuration and environment. From that point of view, the current behavior of |
@khinsen - I totally get your assertion, and it makes sense. That said the current But I think there's a valid case to be made for a feature that ignores the success or failure of writing a new ipns name to the DHT. It too would get picked up by the reprovider system and published once the daemon had managed to connect to other IPFS hosts. Such a feature could obviate the need for the current flag. People are probably using I'm going to guess that it's not on any of the core team's roadmap but you're welcome to submit a PR for it. It might be tricky tho. You said that you wanted this for unit tests; is it worth exploring that angle? A unit test for adding an ipns name that actually makes a call to a running IPFS instance is obviously more of an integration test (which is fine). If you want to assert on IPFS behavior there are lots of examples of such tests in the IPFS repo and lots of them actually bring up more than one IPFS node: https://github.com/ipfs/go-ipfs/tree/f9e9f2854b98eb8397360372b997690a79e5b60d/test/sharness Don't know if that's helpful. |
@eingenito Thanks again for your reply! Don't count on me for a PR or anything like that - I am neither a systems programmer nor a Go programmer. I come from the application developer's side, trying to use the HTTP API for my purposes, which come down to using IPNS as a namespace for storing datasets. This also explains why publishing a piece of data is a unit test and not an integration test from my point of view: it's just two calls to the HTTP API (publish, then get and compare). It also explains why "offline" for me means "no network connection", whatever the cause. I don't know (and I think I cannot even find out) which options were given to the daemon I am connecting to. All I care about it whether I can publish something IPFS-wide or only locally. For now, it looks like my best option is to pass |
go-ipfs version: 0.4.21-
Repo version: 7
System version: amd64/darwin
Golang version: go1.12.5
Steps to reproduce (on a computer without internet connection):
ipfs daemon
ipfs name publish --key=<name-of-an-existing-key> --allow-offline=true <some-ipfs-path>
Result:
The command (2) succeeds if any of the following conditions hold:
I have hesitated between labeling this issue as a bug or as misleading documentation, since the observed behavior could well be intentional, with "offline" meaning "no daemon" rather than "no network connection" (as #4442 suggests). But I don't see a use case where this makes sense.
Note: my own use case for
--allow-offline
is unit tests that I don't want to fail for lack of a network.The text was updated successfully, but these errors were encountered: