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

Does the db sync work for browser? #197

Closed
zabirauf opened this issue Feb 27, 2017 · 9 comments
Closed

Does the db sync work for browser? #197

zabirauf opened this issue Feb 27, 2017 · 9 comments
Labels

Comments

@zabirauf
Copy link

zabirauf commented Feb 27, 2017

I tried running the examples/browser/browser.html with the SignalServer changed to 0.0.0.0:9090 and started the js-libp2p-webrtc-star signaling server locally. But when I run it in two tabs then the data being pushed to eventlog doesn't seem to sync across both of them.

Am I missing something here? Does the data sync work in the browser as the node example seem to work fine.

P.S: I am new to IPFS and ordit-db so my knowledge is limited.

@rkyleg
Copy link

rkyleg commented Mar 8, 2017

I am confused about this as well. I am using the kvstore and data persists while the app is running; however, when I restart the app, the data is gone. I am using the IpfsBrowserDaemon with the signalling server from the browser example.

@zabirauf
Copy link
Author

Following is what I'm seeing, whenever i start in a new incognito window the count starts from beginning i.e. its not syncing.

orbit-db-example-issue

@haadcode
Copy link
Member

Hi everyone and thanks for reporting the bugs! We just released a new version of orbit-db, including updated examples. Would you care to take another try and see if this bug still happens?

As a clarification, as @zabirauf shows in his screenshots, you'll have to open the second peer in an incognito tab, otherwise the peers won't connect as they use the same ipfs repo (ie. they have the same IPFS peer id).

@haadcode haadcode added the bug label Mar 22, 2017
@zabirauf
Copy link
Author

@haadcode When i run the example, i get the following error

TypeError: db.load is not a function
    at IpfsBrowserDaemon.ipfs.on (index.js:100)
    at IpfsBrowserDaemon.EventEmitter.emit (events.js:78)
    at _initDaemon.then.then (ipfs-browser-daemon.js:20)

@haadcode
Copy link
Member

@zabirauf I believe this is due to not updating node_modules after pulling the latest. Make sure you do rm -rf node_modules && npm install after you've pulled from master in order to get the latest modules. Let me know if this helped.

@zabirauf
Copy link
Author

@haadcode Thanks, that solved the issue. I do see the KVStore to be in sync but the log and counter still seem to be unsynced.

orbit-db-example-issue

@haadcode
Copy link
Member

@zabirauf thank for confirming this fixed your issue.

I see that in your video, the "Peers" at the top says 0 for both. This means that the two peers are not connected and as such, can't sync the databases (any of them). We still have some bugs related to the connectivity, so it might be that the peers don't connect every time. To go around this, I usually restart both peers until I see "Peers: 1" in both :) Let me know if this helps!

@zabirauf
Copy link
Author

@haadcode Thanks a lot, it works. Everything syncs now 👍 . Closing the issue now.

@haadcode
Copy link
Member

Great to hear! Please don't hesitate to open new issues if you come across any.

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

3 participants