Giter VIP home page Giter VIP logo

Comments (5)

christroutner avatar christroutner commented on June 15, 2024 7

I ran into this same problem, trying to get a DB to replicate across IPFS nodes running the node.js implementation of js-IPFS and Orbit-DB. I was trying to get a locally running node.js app (Node A) to talk with another peer running in a Virtual Machine (VM) (Node B). They did not appear to be communicating and the DB was not getting replicated. Here is how I went about debugging.

I started by adding an console.log alert whenever the replication event fired:

db.events.on('replicated', () => {
  console.log(`replication event fired`)
})

Running the software again, I could see that the replication event never fired.

I set up a third node on a Digital Ocean Droplet cloud server (Node C). After running the software I could also see the replication event was not firing. I copied the multiaddr for Node C and added it to the first two nodes with this code:

ipfs.bootstrap.add('/ip4/162.243.158.213/tcp/4002/ipfs/QmQLcCWKuxsMkRt5DJkcSw361iNLikjEBMEj6ovR6pwAb5')

I was able to ensure that Node C was in the bootstrap list with this command:

const list = await ipfs.bootstrap.list()
console.log(`list: ${util.inspect(list)}`)

As soon as I added the bootstrap.add code to the other two nodes and started them all, the replication event immediately started firing and the DB started getting replicated across the nodes.

from field-manual.

christroutner avatar christroutner commented on June 15, 2024 3

To help myself understand the intricacies of libp2p and orbit-db replication, I created this db-replication directory in a repo I created for such things:
https://github.com/christroutner/orbit-tests/tree/master/db-replication

Check out the README in that folder. It describes the various network configurations. The code is currently replicating the example database across firewalled peers.

from field-manual.

melroy89 avatar melroy89 commented on June 15, 2024 1

Can the answer be updated already on https://github.com/orbitdb/orbit-db/blob/master/FAQ.md#database-replication-is-not-working-why?

from field-manual.

aphelionz avatar aphelionz commented on June 15, 2024

@christroutner That is super cool - do you want to add that repo to the https://github.com/orbitdb/awesome-orbitdb repo in the Tools section?

from field-manual.

aphelionz avatar aphelionz commented on June 15, 2024

Moving this to the Field Manual Repo

from field-manual.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.