-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
ipns resolving when not connected to the internet #2178
Comments
yes. |
(though when online, it should still check-- there may be two nodes
publishing to the same name. in the future not all names will be the same
as the peer-id)
|
yeah, this is tricky for the reason @jbenet mentions in his second comment. If your node is 'online', meaning the daemon is running and you could potentially connect to peers (even if just on your LAN), your node will try to find the most up to date version of the record. When we allow multiple peers to publish to the same namespace, this will be very important to have. Cases like this need to be well thought out |
@whyrusleeping My use is of using ipns as a local storage for the state of my webapp. But if getting that data back always search to see if other nodes have a more up to date version of the record then am I stuck with this 1~2 second wait? Or will there be an other way to do this? @fazo96 aren't you on a similar situation? What is your take on this? |
I think in case of IPNS two stage cache would be beneficial. This way user won't feel that cache expired (you can feel it for example on my site) which happens from time to time even though you are reloading site all the time. Also local IPNS entries could reside in 2nd stage (local entry will be updated in case that newer is found). One disadvantage is that user might get older than he suspects entry but IMHO it is better than ~10s delay (it is better in 0.4 but still really noticeable). |
@Faleidel yes I've encountered this problem, for now my app doesn't have a solution but I plan on resolving the local IPNS name to the hash of an object contained in MFS (the Files API) at the application level and then keeping it published automatically. This assumes only one entity publishing to an address of course. This problem is very tricky to solve right: on one hand it's better to resolve to an old record than nothing at all, on the other hand this hurts some use cases where having the latest data is more important. There could be a flag in the resolve command that tells IPFS to find a record as fast as it can without checking wether it's outdated. Then we can use this at the application level to return some data knowing that it might be old, while we try to get the latest at the same time. |
And this is why the creator (will be able to) chooses the type of record. you should be able to do either without ambiguity.
opposed to that, we need to be very strict about what constitutes an expired entry. if it's expired it MUST NOT be used-- this is critical for security, and for a solid, reliable UX. (imagine if you update your domain's DNS but some rogue dns servers are returning old records because they feel like it, and browsers decide to use them knowing they're old...!!!). records with different semantics will be possible, but the creator needs to be explicit about that. |
@jbenet what you said makes a lot of sense 👍 Sounds like letting the creator choose the rules for its own records is a lot better than having the clients decide what to do. |
Resolving now works offline, when online we still check the network |
Trying to resolve your own ipns id when not connected to the internet does not work.
Shouldn't your ipfs node retrieve the record from cache or understand that its trying to resolve itself?
Similar to #2078
The text was updated successfully, but these errors were encountered: