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

Sync db between multiple peers in a network #471

Closed
subhasisbanik opened this issue Oct 1, 2018 · 2 comments
Closed

Sync db between multiple peers in a network #471

subhasisbanik opened this issue Oct 1, 2018 · 2 comments
Labels

Comments

@subhasisbanik
Copy link

I have used orbitdb js to create a db and retrieve the data back for a single peer with both IPFS daemon as well as ipfs-js.
Now in a truly decentralized environment, what I plan to do is to create cluster of IPFS peers with orbitdb running on top of it.
I have clustered ipfs with ipfs-cluster-service and ipfs-cluster-ctl but it seems it has no way I am able to insert data from 1 orbitdb peer and get it back from another peer.
I have made another setup which peers ipfs daemon with "ipfs swarm peers" but still it isn't serving the thing I want, connecting orbitdb to add and get it back in a network).
Maybe adding this as an issue would be wrong because maybe orbitdb isn't designed that way, but I believe there should be atleast 1 solution to this problem.
Please help!!

@Azaeres
Copy link

Azaeres commented Oct 16, 2018

it seems it has no way I am able to insert data from 1 orbitdb peer and get it back from another peer

Looks like I'm running into this too. I added data to a key-value store, then tried to retrieve that data using a different peer, but just got undefined. Is this kind of thing not supported? Or is there a way to do this?

@aphelionz
Copy link
Member

Hi @RyanCBarry and @subhasisbanik.

In order for the peers to replicate databases two underlying IPFS links need to be in place:

  1. The peers must be connected direclty via an ipfs.swarm.peers call. js-ipfs has made a TON of headway on this but for now it's still best to explicitly connect.
  2. Once connected, the peers must be able to pubsub with each other.

Also, I wanted to let you know about the OrbitDB Field Manual which aims to answer all of these questions via a tutorial and other sections. Feel free to open issues or PRs there if something doesnt make sense or if you have more questions.

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

4 participants