Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    anders
    @tabcat00:matrix.org
    [m]
    this should link all the changes made to replication since then orbitdb/orbit-db#933
    the change affecting the chunking of replicated events was probably part of orbitdb/orbit-db-store#117
    anders
    @tabcat00:matrix.org
    [m]
    ill finish orbitdb/orbit-db#937 today and see if haad wants to help me get replication chunking again. i dont want you guys to have to dig through that code and fix it yourselves.
    breadhunter
    @EmiM
    Thank you :)
    haad
    @haad:matrix.org
    [m]
    hey, thanks for the pings. regarding the replicated event: indeed, this is now sent only when the db has been (fully) replicated. in fact, the previous behaviour wasn't intended (replicated events "chunked"). however, if I understand the need described above, you want to be able to "know when some progress of replication has been made" and the replicate.progress event will give you that (see https://github.com/orbitdb/orbit-db-store/blob/main/src/Store.js#L100 for the callback signature and params). it's emitted for each replicated db log entry. with that, you can eg. show a nice progress bar, or hook to it to show the replicated data to the user. note though that when replicate.progress is fired, the DB index hasn't been updated yet with the replicated data.
    Holmes Wilson
    @holmesworcester:matrix.org
    [m]
    Thanks! @EmiM is this what we need?
    Holmes Wilson
    @holmesworcester:matrix.org
    [m]
    haad: we were also wondering about expected improvements in sync time. do you have any tests that show improvements in sync time in orbitdb 0.28.0? we'll prepare more detailed data on this but our tests show little or no change.
    So I'm wondering if perhaps there's some remaining bottleneck or bug that is resulting in expected performance gains not being achieved in practice.
    And thanks so much for your work on this!
    breadhunter
    @EmiM
    Thank you @haad:matrix.org for clearing this up. Yeah, we were relying on replicated instead of replicate.progress exactly for the reason (db index not being updated) but maybe we can switch to replicate.progress.
    Holmes Wilson
    @holmesworcester:matrix.org
    [m]
    Will there be a way to display an entry before sync is complete?
    anders
    @tabcat00:matrix.org
    [m]
    yes but its probably still best to just wait for the sync to complete in most cases. in real world scenario you would get smaller updates compared to 1000+ entries at once unless coming back from being offline for a while.
    i kind of agree with haad's expectated behavior now
    Holmes Wilson
    @holmesworcester:matrix.org
    [m]
    We created an issue for sync performance just to track it. Should we be seeing performance increases? Does 20-150 seconds for 1000 entries seem reasonable? Does it make sense that there hasn't been any improvement after the performance related changes in 0.28.0? orbitdb/orbit-db#938
    vinkabuki
    @vinkabuki
    Hello, I have an issue with closing orbitdb - it hangs (not always and only for one instance) or throws error and hangs (always for more than one instance). I've created a minimal repo, so you can see it yourself. It doesn't throw en error if you don't initialize keyvaluestore - sometghing with ipfs pubsub I guess, but maybe there is something wrong with mu setup, I was trying to close and even drop those kvstores, but it didn't work - https://github.com/vinkabuki/closeorbitdb
    Qi Li
    @aaronli:matrix.org
    [m]
    Hi guys. I am playing around with the OrbidDB field-manuel, and I am stuck in this section (https://github.com/orbitdb/field-manual/blob/main/01_Tutorial/04_P2P_Part_1.md#getting-a-list-of-connected-peers). The problem is when I print my node's swarm list, it doesn't show any /p2p-circuit/ipfs/xxxxx swarm. It only shows the ip4/ip_address/tcp/port_number. In this case, I am not able to use the defined function connectToPeer() to connect this peer.
    Does anyone come across this issue?
    Rafael Kazuo Sato Simião
    @dntxos
    GM guys. Im trying to test orbitDB with current demos. But never connect peers... And not sync with another remote machina that i was testing... even on orbitdb control center i cant sync with
    James
    @u007
    hi, how do i connect to orbitdb db from frontend? ive pointed to the same orbitdb ipsfs path, but im not getting any data from my frontend even thou ive data on my nodejs
    Rafael Kazuo Sato Simião
    @dntxos
    image.png
    James
    @u007
    seems like its such a common question
    Rafael Kazuo Sato Simião
    @dntxos
    when i open another browser window (brave this time)... dont sync ... :-(
    James
    @u007
    ive enabled ipfs on port 5001, but curl at that port does not work
    Qi Li
    @aaronli:matrix.org
    [m]
    Hi guys. From the official guide I knew that we can get the public key of an OrbitDB instance by command "orbitdb.identity.id". Then what is its corresponding secret key?
    Holmes Wilson
    @holmesworcester:matrix.org
    [m]
    I don't know the answer offhand, and I'm not part of the project, but it seems like it'd be helpful to file these as issues against the documentation.
    Just so that, when anders or aphelionz responds, that also gets added to the docs.
    this probably isn't helpful at all! but it seems like they've been away over the weekend and i think there's a risk of questions like these getting lost in the shuffle here in gitter/matrix.
    @vinkabuki: do you know the answer offhand?
    Qi Li
    @aaronli:matrix.org
    [m]
    Okay got it. Thank you. And one more further question, if my orbitdb node runs in the browser, after I refresh the page, does my instance identity change?
    James
    @u007
    @aaronli:matrix.org i think it remain the same, at least tested on node backend
    guys, how do i connect to my nodejs orbitdb peers from reactjs frontend?
    how do i setup the ipfs to point to the same db?
    fig_jam
    @fig_jam:matrix.org
    [m]
    Hi all. I've been attempting to add a DB to the Orbit Control Center: "/orbitdb/zdpuAtdcsSVoaXrDxr32FTkXYhcXD9sF14hhzXsR1u2HfXQCi/Users". When I click add it never appears on the ui. Am I doing something wrong?
    vinkabuki
    @vinkabuki
    @u007 What you mean by connecting peers from frontend? If you could share your code, I might help you with that.
    James
    @u007

    @u007 What you mean by connecting peers from frontend? If you could share your code, I might help you with that.

    @vinkabuki here is my nodejs code with orbitdb

    const initIPFSInstance = async () => {
      return await IPFS.create({
        host: '0.0.0.0',
        port: '5001',
        protocol: 'http',
        repo: './ipfs',
        EXPERIMENTAL: { pubsub: true },
      });
    };
    
    initIPFSInstance().then(async (ipfs) => {
      const identity = await Identities.createIdentity({ id: '_cherry' });
      console.log('myidentity', identity);
      const orbitdb = await OrbitDB.createInstance(ipfs, { identity: identity });
    
      const db = await orbitdb.docs('orbit.users.home.coins', {
        accessController: {
          write: [orbitdb.identity.id],
          read: [
            '*'
          ],
        },
      });
    });

    and ive gotten my db address to /orbitdb/zdpuB1GzckVfwJfAZuVr9MwvYdGLk2jDd4jXgLvb4Memgnsip/orbit.users.home.coins

    how do i connect via react? i tried

    Ipfs.create({
        preload: { enabled: false },
        repo: './ipfs',
    
        EXPERIMENTAL: { pubsub: true },
        config: {
          Bootstrap: [],
          Addresses: { Swarm: ['localhost'] }
        }
      })

    but i got some error on localhost

    vinkabuki
    @vinkabuki

    @u007 I think I've figured it out, but I'm short in time so you must figure out the last step. Make sure that port is correct (Mine was 5002 instead 5001). What I got is some problem with CORS, you must find a way how to add it and u should be fine.

    const { HttpApi } = require('ipfs-http-server')
    const { HttpGateway } = require('ipfs-http-gateway')
    
      const initIPFSInstance = async () => {
        return await IPFS.create({
          host: '0.0.0.0',
          port: '5001',
          protocol: 'http',
          repo: './ipfs',
          EXPERIMENTAL: { pubsub: true },
          API: {}
        });
      };
    
      initIPFSInstance().then(async (ipfs) => {
    
        const httpApi = new HttpApi(ipfs)
        await httpApi.start()
    
        const httpGateway = new HttpGateway(ipfs)
        await httpGateway.start()
    
        const orbitdb = await OrbitDB.createInstance(ipfs);
    
        const db = await orbitdb.docs('orbit.users.home.coins', {
          accessController: {
            write: ['*'],
            read: [
              '*'
            ],
          },
        });
      });

    and on frontend:

    import { create } from "ipfs-http-client";
    
    const client = create("http://0.0.0.0:5002/api/v0");
    
    const created = await client.add(file);

    That's what the do in ipfs deamon - https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs-daemon/src/index.js#L50-L51
    And the react part - https://blog.logrocket.com/decentralized-data-storage-using-ipfs-and-react-a-tutorial-with-examples/

    lmk if that worked

    1 reply
    anders
    @tabcat00:matrix.org
    [m]
    also orbitdb should be ran on the client
    vinkabuki
    @vinkabuki
    I've completely omitted orbitdb part in this actually, the problem was ipfs itself
    anders
    @tabcat00:matrix.org
    [m]
    yes 👍️ your ipfs stuff looks fine
    i just wanted james to know he should give the ipfs-http-client instance to create the orbitdb instance on the client, if his plan was for the client to use orbitdb
    2 replies
    vinkabuki
    @vinkabuki
    yeah, that's complete answer to his question :), also I've encountered issue myself, which I posted above on 02 December, maybe you know what is wrong @tabcat00:matrix.org ?
    anders
    @tabcat00:matrix.org
    [m]
    its likely a bug
    vinkabuki
    @vinkabuki
    Should I create an issue for this?
    anders
    @tabcat00:matrix.org
    [m]
    if you could send me the output of something like https://www.npmjs.com/package/why-is-node-running first that would be great
    but feel free to just open one if not
    vinkabuki
    @vinkabuki
    sure, thanks :)
    vinkabuki
    @vinkabuki
    https://justpaste.it/8dk53 - I think the last 3 logs are pointing at the real problem, while I was trying to debug this - I've ended in those files
    anders
    @tabcat00:matrix.org
    [m]
    its likely the timeouts in our pubsub package
    anders
    @tabcat00:matrix.org
    [m]
    you can open that issue if you still feel up to it, in orbit-db repo is fine for now