field-manual icon indicating copy to clipboard operation
field-manual copied to clipboard

How does OrbitDB update the heads (tails?) (oplog?) on immutable IPFS

Open filoozom opened this issue 3 years ago • 3 comments

Hi,

I've tried looking a bit at the code and in this repo, but I'm struggling to find out how OrbitDB is able to keep a constant address on IPFS, which should be immutable.

How can you append to /orbitdb/cid/db? I didn't find any reference to IPNS, but I'm assuming there has to be something like that somewhere?

Thanks!

filoozom avatar Feb 10 '21 21:02 filoozom

OrbitDB uses PubSub channels to communicate the CIDs of tail objects. These objects then reference those objects before them.

The name of the PubSub channel is stored or derived from the manifest.

An example manifest looks like this:

{
  value: {
    name: 'abc',
    type: 'eventlog',
    accessController: '/ipfs/zdpuAyXXyGF4wDnpoV1hnQAT3HrBdnNh27aW9tYzJk1w1pL9B'
  },
  remainderPath: ''
}

And the AC Object then looks like this:

{
  value: {
    type: 'ipfs',
    params: { address: 'zdpuAsngiZH1NMErdZKjrC5DGEb78yvHvGwxe76YiUXTbNE96' }
  },
  remainderPath: ''
}

CSDUMMI avatar Sep 15 '21 16:09 CSDUMMI

Actually the stringified address of the database is used as the PubSub Channel name.

CSDUMMI avatar Sep 16 '21 16:09 CSDUMMI

This explains the topic, but does not tell how we can rely on this PubSub mechanics on real production system.

astudnev avatar Jun 08 '22 08:06 astudnev