Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

No entries visible for remotely connected orbitdb #2

Open
ohager opened this issue Jun 7, 2020 · 3 comments
Open

No entries visible for remotely connected orbitdb #2

ohager opened this issue Jun 7, 2020 · 3 comments

Comments

@ohager
Copy link

ohager commented Jun 7, 2020

Context

I have an application with OrbitDB using a remote IPFS daemon (actually, all running on the same machine).

I changed your code a bit such that I can connect to that local IPFS peer, because I wasn't able to
open my databases using your demoed web version.

import IpfsClient from 'ipfs-http-client'

// ...

// Start OrbitDB
export const initOrbitDB = async () => {
  orbitdb = await OrbitDB.createInstance(IpfsClient('http://localhost:5001'))
  return orbitdb
}

I configured CORS for my IPFS peer, such that it works without issues

Actual Behavior

After these changes I was able to open the database, and as you can see they are correctly detected.

image

The issue is that, even having douments stored, no entries are shown, when added programmatically in my application.

image

Expected Behavior

When adding documents to the OrbitDB, they should appear in the Control Center


I'm not sure that this is an issue with your useful viewer, or something I forgot to do on my apps side. In my innocent understanding, I expect an implicit replication of the data. Maybe you can help me on this.

Thanks in advance

@haadcode
Copy link
Member

haadcode commented Jun 8, 2020

Thanks @ohager for opening the issue! 👍

I don't think the replication updates are hooked up to the UI. That is, even if your peers are syncing / have synced the database, the UI doen't update. It may work if you "let it run for a while" once the peers are connected, and then refresh the UI. It may be some other bug, too.

Would graldly accept a PR that adds/fixes that.

@ohager
Copy link
Author

ohager commented Jun 8, 2020

Understood. Locally, I added the replicated event, but it wasn't triggered. @phillmac gave me some hints how to work on the peer discovery. Probably, I'll look into that issue tonight evening. Once I made the replication work, I'll see if I can make it work in the control-center. I'll let you know.

@haadcode
Copy link
Member

haadcode commented Jun 8, 2020

Sounds good. Btw. the event on local peer (writer) is write, and replicated on the remote peer (the one replicating). See if that triggers correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants