Orbit-db: Which IPFS operations does OrbitDB use?

Created on 22 Oct 2017  路  5Comments  路  Source: orbitdb/orbit-db

I'm interested in creating an OrbitDB compatible client, are there any docs detailing its interactions with IPFS, or at least a pointer to where to look in the codebase?

question

Most helpful comment

Hey, thanks - since writing that comment, I'm closely following rust-libp2p and a developing IPFS implementation in Rust (https://github.com/dvc94ch/rust-ipfs). This is a pre-cursor to a Rust implementation of OrbitDB.

All 5 comments

Hi @adamski, that sounds awesome! What kind of a client are planning on implementing? I would be more than happy to help you to get there!

The overarching idea of OrbitDB is that when creating a new instance orbitdb = new OrbitDB(ipfs), we can pass the IPFS object to it. In order to use another Content-Addressed Storage or another IPFS implementation, one would only need to pass in another instance that implements the functions used from IPFS.

Those functions would be:

ipfs.object.put()
ipfs.object.get()
ipfs.pubsub.subscribe()
ipfs.pubsub.publish()

So if you have another CAS system, implementing the above APIs would make it work out of the box (I believe). More specifically though, to take a look how they're used, the IPFS operations are located in:
https://github.com/haadcode/ipfs-log/blob/master/src/entry.js#L63
https://github.com/haadcode/ipfs-log/blob/master/src/entry.js#L80
https://github.com/haadcode/ipfs-log/blob/master/src/log-io.js#L38
https://github.com/haadcode/ipfs-log/blob/master/src/log-io.js#L22

You'll see variables named immutabledb but that's essentially the IPFS instance. My goal is to eventually abstract the CAS system, ie. the APIs mentioned above, to its own layer so that any other CAS system can be used, or any non-CAS system can be made into a CAS system

(Changed the issue name to make a little more descriptive in case anyone else is looking for the same answer)

Thanks for the pointers. I'm thinking of a C++ implementation that can be used for desktop apps to be able to read and write an IPFS-based database. Came across OrbitDB and it seems like a good project to build on. So essentially using the same IPFS calls under hood.

Does OrbitDB used IPNS at all? That is how I was imagining to make "mutable" data using IPFS.

Hi Adamski, a C++ (or even Rust) implementation would be cool. There's a couple projects you should keep on your radar.

  1. orbit-db-api which is a nearly complete HTTP API for OrbitDB. The authors hang out on Gitter if you want to stop by and say hi
  2. The OrbitDB Field Manual which aims to be a one-stop shop for all things OrbitDB.

As for IPNS, no OrbitDB does not use IPFS but since @haadcode replied we've since started using the ipfs.dag.get and ipfs.dag.put commands as well

Hey, thanks - since writing that comment, I'm closely following rust-libp2p and a developing IPFS implementation in Rust (https://github.com/dvc94ch/rust-ipfs). This is a pre-cursor to a Rust implementation of OrbitDB.

Whoa! That's amazing. Please do let us know how things are going! We're active on Gitter :)

Was this page helpful?
0 / 5 - 0 ratings