Comments (5)
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.
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.
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.
@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.
Moving this to the Field Manual Repo
from field-manual.
Related Issues (20)
- How does OrbitDB update the heads (tails?) (oplog?) on immutable IPFS HOT 3
- Error: No resolver found for codec "undefined" HOT 3
- Update Code Snippets to latest js-IPFS HOT 1
- Publishing Options
- Chapter on customizing OrbitDB HOT 2
- Ipfs.node.dag.get fails in Chapter 2 of the tutorial HOT 9
- TypeError: Cannot read property 'length' of undefined HOT 2
- 01_Basics.md: why do you use window.something for a nodeJS code? HOT 3
- [01_Tutorial/02_Managing_Data.md]: using await in node REPL HOT 2
- In `04_P2P_Part_1`, `NPP.connectToPeer` got `Error: Circuit relay dial failed as addresses did not have peer id` HOT 6
- field-manual/1-Basics outdated? HOT 6
- In 01_Tutorial I have some confusion
- Code example in 02 Managing Data errors
- IPFS Codecs issue HOT 1
- Outdated Tutorial [Chapter 1 & 2]
- Replication when 2 orbitdb apps connected to a single node IPFS does not work HOT 2
- Scaling database is not clear from the manual
- Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in package.json HOT 2
- Database is not replicating in browser, Error(PublishError.InsufficientPeers)
- SQL standards
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from field-manual.