Open sivachandran opened 8 years ago
You could use a content-addressed btree. I implemented one at: https://github.com/ianopolous/merkle-btree Or there's a version specifically adapted to IPFS (using the Java HTTP API) at: https://github.com/ianopolous/Peergos/tree/master/src/peergos/server/merklebtree
Then you just need to pin the root of the btree.
Here are some summarized items from @jbenet when I chatted with him recently about arbitrary kvpairs on the IPFS DHT:
In comparison to Mainline (bittorrent), which many nodes will let you know arbitrary data on:
I basically want to store key-value pairs in the distributed network and later retrieve value for a specific key. A related topic is already discussed here https://github.com/ipfs/notes/issues/4 but I am not sure about the current implementation status of it.
I understand IPFS stores the hash to object/block mapping in DHT using this package https://github.com/ipfs/go-ipfs/blob/master/routing/dht/dht.go. So I am wondering whether I can use the same DHT package to store my own key-value pairs. But my keys won't be hash of the value that I store in the DHT. As this is contrary to how IPFS uses the DHT I am not sure whether I can do this or will it create any problem in how IPFS functions.
So can someone tell me whether I can use the IPFS DHT to store arbitrary key-value pairs or is there a better way to do.