Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Chris Troutner
    @christroutner

    Here is my custom ACL. I only changed the canAppend() function. I'm wondering if there is something here that I'm missing. Some bug that might be failing to add content and instead is only adding info about the ACL.

    https://github.com/Permissionless-Software-Foundation/ipfs-p2wdb-service/blob/master/src/lib/orbitdb-lib/pay-to-write-access-controller.js#L89

    aphelionz
    @aphelionz:matrix.org
    [m]
    what is db._index ?
    Chris Troutner
    @christroutner
    db._index: KeyValueIndex { _index: { write: [ '*' ] } }
    aphelionz
    @aphelionz:matrix.org
    [m]
    O_o
    Chris Troutner
    @christroutner

    I'm starting to think the best way for me to approach this is to try and recreate the issue with a much simpler code base. That will help me determine if the issue is in my code, or if it's native to this key-value store.

    If it's native to the key-value store, I can try to solve it with a different type of store.

    If it's in my code, then I'll be better positioned to debug it.

    aphelionz
    @aphelionz:matrix.org
    [m]
    ok great! that will be useful either way
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    In an Index class, do I have to store everything in this._index variable or can I do this differently?

    Could I for example store some more variables?
    Do both of these work:

    this._index = {
               users: 0,
               proposals: {},
               votes: {},
               participants: {}
    }

    Is this possible too:

    this.users = 0
    this.proposals = {}
    this.votes = {}
    this.participants = {}
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    I did this in the Field Manual too, but never checked. aphelionz
    aphelionz
    @aphelionz:matrix.org
    [m]
    the _index is meant to be the complete and raw database state but IIUC that's just convention. Your store can define its properties however it want/needs to
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    Thanks. That was very helpful. It's simpler not to do this with _index in my Application.
    pyc
    @xphorm:matrix.org
    [m]
    CSDUMMI: From that snippet... "And you cannot revoke the write restriction once put in place"... Can't do it like that, I need some records to be editable again....
    1 reply
    pyc
    @xphorm:matrix.org
    [m]
    I just gotta throw this outta myself here.... https://github.com/orbitdb/field-manual/blob/main/01_Tutorial/04_P2P_Part_1.md is pure confusion.
    even some sentences are meaningless
    "If you don't want to blow away your data, then you can manually restore the default values by running a few commands on the application layer."
    "However, since we purposefully started with an empty list of bootstrap peers and they won't be restored by simply removing the config values. "
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    True.
    pyc
    @xphorm:matrix.org
    [m]
    thanks for suggestion, but first I need to make browser replicate orbitdb instance... will think about access rights a bit later
    it's a bit more important for me right now to understand if orbitdb databases are automatically replicated to interested peers. really not sure if that's the case
    it says so in one document, but from all others i'm getting impression we have to maintain the list of connected peers manually? i was really thinking that is automatized
    maze
    @maze:strahlungsfrei.de
    [m]
    At least if all peers are configured to use the same webrtc-star instance, then it should work seamlessly even with browser peers. And you need to make sure all your stores are opened so they can be synchronized. That's my experience so far
    They will start to replicate automatically when load()ing a store
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    Do the Stores have an EventEmitter?
    Chris Troutner
    @christroutner

    @aphelionz:matrix.org I wanted to follow up on our discussion yesterday. I created this repository to explore the issues I was having with replicating data between DBs with a custom ACL:
    https://github.com/christroutner/kv-orbit-rep-bug

    It turned out the issue was the custom ACL. I had followed the IPFS ACL template instead of the OrbitDB ACL template, and that was the source of the error.

    Basically, I had to copy the OrbitDB ACL exactly, and verified that it was replicating. Then I was able to customize the canAppend() method for my own custom rules.

    1 reply
    If anyone else has an issue implementing a custom ACL, that code repo might be a good place for them to start their debugging.
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]

    Hey, I wanted to ask you for a bit of feedback.
    I'm implementing a voting application that uses OrbitDB as a database.

    I'm doing this, because OrbitDB is easy to use and doesn't require any complex setup. But I'm not connecting the IPFS instance to the network.

    I just wanted to ask you for feedback for my custom store:
    https://gitlab.com/demnet/democracy-bot/-/blob/master/src/Community.js

    2 replies
    koo5
    @koo5
    Error: No content this.routers available
    any idea why i could be getting this ... with the same Dockerfile that doesnt exhibit this on my other machines
    anders
    @tabcat:matrix.org
    [m]
    looks like an ipfs/libp2p issue; not sure
    koo5
    @koo5
    seems like deleting ipfs/ and orbitdb/ helped
    maze
    @maze:strahlungsfrei.de
    [m]

    Another question concerning access control. because I am quite puzzled about this: Imagine someone writes to my store without having write permission in my app (using his own manipulated code). The canAppend call of the access controller in my local app will return false, which in turn makes ipfs-log throw an error (Could not append entry). AFAICS that means any further evaluation of the log is canceled.

    What is the failure handling in the app supposed to be? Does it need to catch and parse that error and then somehow remove the bogus log entry from ipfs? Is there a way of skipping / ignoring those faulty oplog entries? Otherwise this would be a simple way of DoSing any store.

    Still learning...

    phillmac
    @phillmac
    Ipfs garbage collection will eventually clean it up
    But yes if you spam invalid entries you could perform a DoS of sorts
    koo5
    @koo5
    i think maze was pointing to the fact that the exception seems to abort the orbitdb thread (or what is it), so your app would be stuck until it does clean up
    phillmac
    @phillmac
    It would abort that replication attempt
    but other replications can still happen if they are valid
    but if someone malicious is spamming bad head announcements you'd overload ipfs eventually
    koo5
    @koo5
    ah
    koo5
    @koo5
    my bad
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    I was wondering, would it be possible to implement a relational database on top of OrbitDB? Perhaps even SQL?
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    And would this be pracitical? I could imagine that such an OrbitSQL could aid in moving from centralized to decentralized DBs.
    aphelionz: Could we perhaps make the orbitdb instance available to an Index constructor ?
    This might make it possible to create databases that are based on multiple databases under the hood.
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]

    Of course, database have to be careful to not create a circular dependency graph.

    (Store A needs a Store B, which needs another Store A, ...)

    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]

    :point_up: Edit: Of course, database devs have to be careful to not create a circular dependency graph.

    (Store A needs a Store B, which needs another Store A, ...)

    constant_d
    @constant_d:matrix.org
    [m]

    Hello,

    I'm trying to get my hands on orbitDB and I managed to make it work between two node.js app but do I have to do some special stuffs to make it work between a nodejs app and a browser ? I've found this issue https://github.com/ipfs/js-ipfs/blob/bf92fb321a66651a63a8b9cc81112f149573826a/examples/custom-libp2p/index.js but I don't fully understand it, so I wanted to be sure if that's what I need to do or if you have any more easy-to-use examples.

    Thanks :)

    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    aphelionz: Maybe there should be a FAQ of OrbitDB?
    And the existing FAQ should be more visible.
    And extended.
    CSDUMMI
    @joris.gutjahr:matrix.org
    [m]
    I'm trying to write a new version of an FAQ for OrbitDB, here: https://hackmd.io/@csdummi/BySxuvGs_