Orbit-db: Debugging in browser

Created on 31 Jan 2019  路  4Comments  路  Source: orbitdb/orbit-db

Hi everyone,
I have a problem on Windows (I know it is still not supported but that's the point ;)).
If I load 3 ipfs instance (2 browsers and 1 nodejs) the sync does not work (It work on linux...)
Can someone explain me how I can activate Orbit-Db debugging browser side (I figured it out on nodejs side)
A little explanation on how the sync process work and what I have to look for?
Thank you! ;)

Windows bug

All 4 comments

Ok, I found the for browser debugging. Juste added window.LOG = "debug" into the html code

I'm still trying to understand what is still not working under windows.
Here are the logs client side. The setup is 2 js-ipfs instances well connected on Web sockets.
This setup work well under linux.
It seems that the exchange heads never appended and the callback of direct connection does not trigger.

2019-02-05T10:56:21.653Z [DEBUG] orbit-db: open() vendors.app.js:192612 2019-02-05T10:56:21.655Z [DEBUG] orbit-db: Open database '/orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM' vendors.app.js:192612 2019-02-05T10:56:21.656Z [DEBUG] orbit-db: Look from './orbitdb' vendors.app.js:192612 2019-02-05T10:56:21.659Z [DEBUG] cache: load, database: /orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM vendors.app.js:192612 2019-02-05T10:56:21.660Z [DEBUG] cache: open orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM vendors.app.js:328410 info: Unsubscribed from: SWARM vendors.app.js:192612 2019-02-05T10:56:21.670Z [DEBUG] orbit-db: Didn't find database '/orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM' vendors.app.js:192612 2019-02-05T10:56:21.671Z [DEBUG] orbit-db: Loading Manifest for '/orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM' vendors.app.js:192612 2019-02-05T10:56:22.087Z [DEBUG] orbit-db: Manifest for '/orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM':{ "name": "SWARM", "type": "docstore", "accessController": "\\ipfs\\QmYASSwDK8yu1TDvmCmuUAVyNMaNz2pMkoZyPk2oUZLcW7"} vendors.app.js:192612 2019-02-05T10:56:22.088Z [DEBUG] cache: load, database: /orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM vendors.app.js:192612 2019-02-05T10:56:22.093Z [DEBUG] orbit-db: Saved manifest to IPFS as 'QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd' vendors.app.js:192612 2019-02-05T10:56:22.564Z [DEBUG] cache: load, database: /orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM vendors.app.js:192612 2019-02-05T10:56:22.570Z [DEBUG] pubsub: Topics open: 2 app.js:4063 Database ready vendors.app.js:328410 info: Loading DB: /orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM vendors.app.js:192612 2019-02-05T10:56:23.573Z [DEBUG] pubsub: Peer joined /orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM: vendors.app.js:192612 2019-02-05T10:56:23.575Z [DEBUG] pubsub: QmUVY1gtKHUWA3LnnLJPeZaMusEVYEZjRnZXa39JhZi14n vendors.app.js:192612 2019-02-05T10:56:23.577Z [DEBUG] orbit-db: New peer 'QmUVY1gtKHUWA3LnnLJPeZaMusEVYEZjRnZXa39JhZi14n' connected to '/orbitdb/QmZ3oCa5Lr2XVDkmhusHKkXyjw441bYpynyZYgLHwDcuLd/SWARM' vendors.app.js:192612 2019-02-05T10:56:23.579Z [DEBUG] exchange-heads: Create a channel to QmUVY1gtKHUWA3LnnLJPeZaMusEVYEZjRnZXa39JhZi14n vendors.app.js:192612 2019-02-05T10:56:23.585Z [DEBUG] exchange-heads: Channel created to QmUVY1gtKHUWA3LnnLJPeZaMusEVYEZjRnZXa39JhZi14n

After furthers tests, when I enable Webrtc discovery on the browser side and launch 2 browsers, the sync is ok. So it's just between the node instance of js-ipfs and the browsers. The browsers connects to this instance with ws.

Connection problem solve with this PR
https://github.com/ipfs-shipyard/ipfs-pubsub-1on1/pull/6

Found a diff in the hash on browser and windows solved with this PR
https://github.com/orbitdb/orbit-db/pull/558

All is working as expeted now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hugcoday picture hugcoday  路  5Comments

varcario picture varcario  路  5Comments

oskarpyke picture oskarpyke  路  6Comments

shd101wyy picture shd101wyy  路  5Comments

oed picture oed  路  5Comments