如果我频繁的更新ipns对应值(例如每秒3次,甚至突然更多),会出现什么情况?
What happens if I frequently update the IPNS corresponding value (for example, 3 times per second, or even more suddenly)?
如果我频繁的更新ipns对应值(例如每秒3次,甚至突然更多),会出现什么情况?
What happens if I frequently update the IPNS corresponding value (for example, 3 times per second, or even more suddenly)?
A new IPNS record take some time to propagate on the network ~1-2 minutes.
You might want to open a pubsub channel and send updates that way instead of using IPNS.
谢谢你的帮助,但是我还有下面两个疑惑关于pubsub
1)有人长时间不在线,突然上线订阅主题,会收到最后一条消息吗?
2)如何才能做到只能我发布消息,其他人无法发布消息?目前有这样的机制吗?
Thanks for your help, but I have the following two questions about pubsub
补充一点,这个主题有可能几个小时不更新,在某些情况可能更新频繁
To add, this topic may not be updated for several hours, and may be updated frequently in some cases
I don’t think they’re suggesting you use pubsub directly but IPNS can operate in a mode where it uses pubsub to send updates. It’s experimental and you need to enable it in your config. I think that would require that people resolving your frequent updates also enable IPNS pubsub or you’re back to resolving from the DHT.
I’m not quite sure what happens if someone is offline and doesn’t receive pubsub updates when they go back online. I can guess that it tries to resolve from the DHT then reconnect to the pubsub channel. If that’s the case there could be lost updates.
Yeah exactly, the newest record will exist in the DHT, so you still shouldn’t be able to miss an update if you’re offline (because you can just check the DHT). Then you can go back to getting rapid updates from PubSub.
Linking the experimental flag here for convenience: kubo/experimental-features.md at master · ipfs/kubo · GitHub
You can also subscribe to the pubsub topic used by IPNS to be notified when updates happen.