Hi Ed! Lots of excellent questions. I'll do my best to answer. :)
> So: is it possible, under the current implementation, to mutably map
>
> (IPFS public-key hash, key) -> value [IPFS content hash]
Yes, you can do this today using IPNS[1]. Since IPNS already maps your
public key to an IPFS address (mutably), the idea is you'd create an
ipfs merkle object that has the link names of the keys you'd like. Say
you wanted a map that had keys 'foo' and 'bar':
# define an ipfs object (as a merkle dag)
$ cat > map.json
{
"Data": "",
"Links": [
{
"Name": "foo",
"Hash": "QmR6gieKLuNgqKZs6TRgRujmNoKfYtGtviZVvthM9NSy8g",
"Size": 20
},
{
"Name": "bar",
"Hash": "QmUfn33WZcMaGwwE5zBz7LAuHL16tQfxTeqbGrKpL362dr",
"Size": 20
}
]
}
^D
# add it to ipfs as an object
$ ipfs object put map.json
added QmQTw7kK7LdDG5xRjQLhAPiJdxm36ob3ngdrPr1NwTcRYr
# examine it to ensure it maps correctly
$ ipfs ls QmQTw7kK7LdDG5xRjQLhAPiJdxm36ob3ngdrPr1NwTcRYr
QmUfn33WZcMaGwwE5zBz7LAuHL16tQfxTeqbGrKpL362dr 20 bar
QmR6gieKLuNgqKZs6TRgRujmNoKfYtGtviZVvthM9NSy8g 20 foo
$ ipfs cat QmQTw7kK7LdDG5xRjQLhAPiJdxm36ob3ngdrPr1NwTcRYr/foo
foo's value
Nice! Now to make our node's IPNS entry point to it:
$ ipfs name publish QmQTw7kK7LdDG5xRjQLhAPiJdxm36ob3ngdrPr1NwTcRYr
Published to QmRc5iJERYKMjFsJ57jsxJhUjf86HL1WyqrQBTJrCCAnKN: QmQTw7kK7LdDG5xRjQLhAPiJdxm36ob3ngdrPr1NwTcRYr
Now we can lookup values using 'ipfs cat
QmQTw7kK7LdDG5xRjQLhAPiJdxm36ob3ngdrPr1NwTcRYr/foo' or even by querying
the public gateway:
http://ipfs.io/ipfs/QmQTw7kK7LdDG5xRjQLhAPiJdxm36ob3ngdrPr1NwTcRYr/foo
(if you've had 'ipfs daemon' running)
> I also see that you're talking about a general-purpose
> publish-and-subscribe system—how are things going on that front? If you had
> a mutable key-value store, it would be possible to do a dumb pubsub at the
> application layer on top of that. If the underlying key-value map scaled
> well, maybe that's all you would need?
Yep, you're exactly right! There's been a lot of thinking on this:
https://github.com/ipfs/notes/issues/64
and even an app-layer overlay network proposal:
https://github.com/ipfs/notes/issues/108
---
Hope this answers your questions! Thanks for writing: please feel free
to chime on any of these issues if you have any thoughts.
//noffle
[1]
https://github.com/ipfs/examples/tree/master/examples/ipns
> --
> You received this message because you are subscribed to the Google Groups "ipfs-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
ipfs-users+...@googlegroups.com.
> To post to this group, send email to
ipfs-...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ipfs-users/1a51a18a-4373-474c-985c-878e982f77d5%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.