I do this just now with what I would say is the cheapest IPNS rip off ever. I sidestepped using IPNS because it wasn’t clear how to get IPNS events, by rolling my own with pubsub this was trivial.
I set up a system where each node regularly broadcasts its root hash (the stat of the root of its MFS, I used MFS rather than working with IPLD nodes directly because I thought it would be easier, I wish I hadn’t, but it works!), directly analogous to an IPNS publish.
Nodes which are interested in mutable state from other nodes check each incoming root hash, if it comes from a node they care about they inspect the tree to see if any of the files under paths they care about have been updated, and if they have the node will add that to their own mutable root.
Specifically just now I use this to share “jobs” units which describe fully a task that a node should carry out. When a node wants another node to do something they create the job spec and send a message to the target node saying “Check out this job at this path in my mutable state”
Once this message is processed now the target and host nodes are both watching for updates on that job via each others regularly published root hashes. The target will add a file with a signature, either “.accepted” or “.rejected” in the job directory to accept or reject the job. If accepted, the target will then process the job, adding any produced artifacts to the job directory and finally signing a “.finished” file to say they have completed work on the job. I use a (currently not enforced) set of rules on the valid states of a job directory to avoid conflict, the files each node is allows to create in the directory are defined such as only the target being able to do “.accepted”, “.rejected”, “.finished” and only the host being allowed to do “.released”
I’d love to hear if someone has already implemented a pattern like this, I have it all running but I wasn’t intending to invent “public mutable state based job distribution” it’s just a thing I needed!
The thing of note, this is an almost decentralised system right now which allows any network participant to ask any other network participant to do anything in an auditable way (you cannot issue a job without anyone on the network being able to prove you issued the job) - the only weakness right now is the bootstrap nodes. It’s worth noting I use a private network just now but this is not my ultimate goal, I went with pnet because it’s a lot easier to manage during development, I found I had to do quite a bit of configuration on the main net to stop routers where the nodes are from blowing up and maintaining connections to nodes that care about the pubsub channels wasn’t reliable either. I believe when I switch to using the main net and the IPFS bootstrap nodes the system will be “as decentralised as is useful”
it’s worth noting, I’m pretty new to P2P systems, I’d love any feedback on my approach here, or to know of tools that can better do some of the steps I have already implemented, less code makes better days!