Orbit-db: Using orbit-db without pubsub

Created on 6 Aug 2018  Â·  5Comments  Â·  Source: orbitdb/orbit-db

Is it possible to use orbit-db with a go-ipfs node that doesn't have pubsub enabled? (My guess is no, not at this point) How hard would it be to make this happen?

The use case I'm considering is the following. User creates a db locally (or connected to a remote go-ipfs node). It then sends the hash of the db to a server which fetches and pins all the objects of the db. When the user goes online with a different computer they can ask the server about the latest hash and fetch the data. This could also be done similarly with multiple users of a db.

question

Most helpful comment

Hmm - my first suggestion would be to pass {replicate: false} as an option when creating

All 5 comments

Doable and shouldn't be too hard — depends more on content discovery (i.e. DHT, etc) working well on IPFS.

The server will need the head entry. Using the head, the server can retrieve the previous entries by following the next pointer and feeding them to Log.fromEntryHash — the entries will need to be available and discoverable on IPFS.

A couple good spots to look under the hood: Store.sync() & Replicator._processOne()

If my understanding is accurate — Pubsub is used to efficiently exchange heads between peers of a given db. Without Pubsub, you'll have to handle the exchange of heads oob but can then feed the heads to Store.sync().

Thanks, sounds like it shouldn't be too hard to implement. My main problem thought is that when creating a db on an ipfs node without pubsub enabled I get this error:

UnhandledPromiseRejectionWarning: Error: experimental pubsub feature not enabled. Run daemon with --enable-pubsub-experiment to use

Hmm - my first suggestion would be to pass {replicate: false} as an option when creating

That worked, thanks! Didn't know it was an option, don't think it's in the API doc :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MirceaKitsune picture MirceaKitsune  Â·  3Comments

crazyrabbitLTC picture crazyrabbitLTC  Â·  6Comments

hugcoday picture hugcoday  Â·  5Comments

Clickative picture Clickative  Â·  5Comments

BartKnucle picture BartKnucle  Â·  4Comments