Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which IPFS operations does OrbitDB use? #242

Closed
adamski opened this issue Oct 22, 2017 · 5 comments
Closed

Which IPFS operations does OrbitDB use? #242

adamski opened this issue Oct 22, 2017 · 5 comments
Labels

Comments

@adamski
Copy link

adamski commented Oct 22, 2017

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?

@haadcode
Copy link
Member

haadcode commented Oct 23, 2017

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)

@haadcode haadcode changed the title IPFS operations Which IPFS operations does OrbitDB use? Oct 23, 2017
@adamski
Copy link
Author

adamski commented Oct 23, 2017

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.

@aphelionz
Copy link
Member

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

@adamski
Copy link
Author

adamski commented Apr 16, 2019

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.

@aphelionz
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants