Comments (5)
Great! Now I see that the await db1.close()
is otherwise called too early.
from orbitdb.
I can add this information from the log trace:
TimeoutError: request timed out
at maybeThrowTimeoutError (file:///home/foobar/Projekte/orbitdbtest/src/node_modules/ipfs-core-utils/src/with-timeout-option.js:41:15)
at file:///home/foobar/Projekte/orbitdbtest/src/node_modules/ipfs-core-utils/src/with-timeout-option.js:97:9
at async Object.get (file:///home/foobar/Projekte/orbitdbtest/src/node_modules/@orbitdb/core/src/storage/ipfs-block.js:62:19)
at async Object.get (file:///home/foobar/Projekte/orbitdbtest/src/node_modules/@orbitdb/core/src/storage/composed.js:52:15)
at async get (file:///home/foobar/Projekte/orbitdbtest/src/node_modules/@orbitdb/core/src/oplog/log.js:128:19)
at async Promise.all (index 0)
at async traverseAndVerify (file:///home/foobar/Projekte/orbitdbtest/src/node_modules/@orbitdb/core/src/oplog/log.js:264:23)
at async Object.joinEntry (file:///home/foobar/Projekte/orbitdbtest/src/node_modules/@orbitdb/core/src/oplog/log.js:289:5)
at async task (file:///home/foobar/Projekte/orbitdbtest/src/node_modules/@orbitdb/core/src/database.js:145:25)
at async file:///home/foobar/Projekte/orbitdbtest/src/node_modules/p-queue/dist/index.js:118:36
Emitted 'error' event at:
at task (file:///home/foobar/Projekte/orbitdbtest/src/node_modules/@orbitdb/core/src/sync.js:227:16)
at async file:///home/foobar/Projekte/orbitdbtest/src/node_modules/p-queue/dist/index.js:118:36 {
code: 'ERR_TIMEOUT'
}
I'm using Node.js v20.11.0
from orbitdb.
Are the two IPFS nodes finding each other? At a preliminary glance it looks like getting blocks from ipfs is timing out.
from orbitdb.
Yes, they do. Example output (I have added a counter compared to the code above):
putting data 0
orbit.js:97putting data 1
orbit.js:97putting data 2
orbit.js:97putting data 3
orbit.js:97putting data 4
orbit.js:97putting data 5
orbit.js:97putting data 6
orbit.js:97putting data 7
orbit.js:97putting data 8
orbit.js:97putting data 9
orbit.js:116new entry 0:
Object {v: 2, id: "/orbitdb/zdpuAsM7GMYLUS4cmdPi5RzQoZ9aYmUXATPxNVmAFNXEgQJ5X", key: "03fc12776196808c19ef5045ddd9d13022dbac7db2db5baf78aeee7ba1306aac23", sig: "3044022010d86740993a29d8dc0423047ce207270a5c86da57…cae4b1c4a4d8803f5d78884a43f1ec4c1cb252de4eae574fc", next: Array(1), ...}
orbit.js:116new entry 1:
Object {v: 2, id: "/orbitdb/zdpuAsM7GMYLUS4cmdPi5RzQoZ9aYmUXATPxNVmAFNXEgQJ5X", key: "03fc12776196808c19ef5045ddd9d13022dbac7db2db5baf78aeee7ba1306aac23", sig: "3045022100cacf844a8bf7dadb044abb95da55ab951c61be41…1381d4cf897a4f66363a6b55336635daf2a156b2c04b55ef7", next: Array(1), ...}
orbit.js:116new entry 2:
Object {v: 2, id: "/orbitdb/zdpuAsM7GMYLUS4cmdPi5RzQoZ9aYmUXATPxNVmAFNXEgQJ5X", key: "03fc12776196808c19ef5045ddd9d13022dbac7db2db5baf78aeee7ba1306aac23", sig: "30440220694c809d5095d460e868c760ce5eb53b53355277cd…bbf7e46e8fd8fbbf046adf4d74c428e39a3113f4b675241cc", next: Array(1), ...}
orbit.js:116new entry 3:
What I can also see is that increasing the IPFSBlockStorage.defaultTimeout
does not solve this. But when increasing the time interval int the promise more nodes are updated before the error is thrown.
from orbitdb.
Indeed, orbitdb2 is trying to fetch items from orbitdb1 after orbitdb1's ipfs connection is closed which causes orbitdb2 to still be fetching records from orbitdb1 even though there is no connection (and, hence, the underlying ipfs block get times out).
Change db2.events.on
to:
db2.events.on('update', async (entry) => {
// Full replication is achieved by explicitly retrieving all records from db1.
// console.log("All current data:\n")
// console.log(await db2.all())
if ((await db2.all()).length == (await db1.all()).length) {
db2Updated = true
}
})
This will ensure db2 is fully in sync with db1 b(in this example) before closing the connection between the two orbitdb instances.
from orbitdb.
Related Issues (20)
- Recover from [AggregateError: All promises were rejected] Error: Want for xyz aborted HOT 4
- Uncaught Error: Could not append entry: although write access is granted HOT 7
- Error: fetching raw block for CID HOT 4
- TS7016: Could not find a declaration file for module @orbitdb/core. HOT 3
- Error: No native build was found for platform=darwin arch=arm64 runtime=node abi=115 uv=1 armv=8 libc=glibc node=20.11.0 webpack=true HOT 1
- Log Entries created on remote/other Peers are not Pinned Locally HOT 5
- database record limits for acceptable lookup performance HOT 7
- Error: Want for bafyreighfb3szinnqrktnuyriifexl2bcgpisbrlbaxfs4kgqp6ocwjbmy aborted HOT 11
- Sync only to N entries. HOT 1
- Issue with GETTING_STARTED.md LevelBlockstore HOT 2
- Issue with GETTING_STARTED.md page HOT 4
- Can't open existing database HOT 6
- When put data, tell me 'PublishError.NoPeersSubscribedToTopic' error. How can i fix this? THX HOT 3
- OrbitDB can't be opened - AggregateError: All promises were rejected HOT 5
- Update config to use `allowPublishToZeroTopicPeers` HOT 2
- Altering protection to prevent changing data of other users HOT 2
- Unable to Index Documents with Custom IPFSBlockStorage (pure browser environment)
- Integration Issue with Helia: Custom Service Configuration Disables Peer Discovery in Browser Environment HOT 3
- Code Sample Issues in OrbitDB Documentation for Access Controllers HOT 2
- issue trying to get multiple nodejs peers to sync HOT 5
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 orbitdb.