Orbit-db: Chat on orbit-db

Created on 3 Apr 2018  路  2Comments  路  Source: orbitdb/orbit-db

Hi, i'm trying to dev. chat on orbit-db, and i have few questions.

  • For example i have db for conversation user A and B, i want to add permissions for this users to remove their msgs from db. For this i found info about it in your documentation. But as i understood, user can delete all db entry, so question is. How to prevent user A from deleting msgs of user B?
  • If first is can't be done in orbit-db, i have second idea, that users add msgs to self db, and frontend will order this msgs from 2 databases by date. But, i dont see any timestamps in entry, only clock, which is not what i'm looking for. So questions, is there any timestamp or else?
question

Most helpful comment

Thanks for the questions @nezzard!

For example i have db for conversation user A and B, i want to add permissions for this users to remove their msgs from db. For this i found info about it in your documentation. But as i understood, user can delete all db entry, so question is. How to prevent user A from deleting msgs of user B?

Correct, the permissions are per-database and it's currently not possible to set permissions such that individual entries in the db have different permissions. How this can be done atm is to separate the messages to different databases as per the permission scheme you want to implement.

We plan to add such fine-grained permissions in the future, but it's not being worked on at this moment.

If first is can't be done in orbit-db, i have second idea, that users add msgs to self db, and frontend will order this msgs from 2 databases by date. But, i dont see any timestamps in entry, only clock, which is not what i'm looking for. So questions, is there any timestamp or else?

There are no wall-clock timestamps in the OrbitDB data structures, so this is something you have to handle in application. Time (as in trusted real time) is a non-trivial problem in distributed systems generally and becomes even more non-trivial in trustless systems. Perhaps this discussion at orbit.chat will give you a bit more information. tl;dr: as far as I can tell, if you need a trusted and global wall-clock, you'd have to provide it from a trusted source (that is, an "oracle" server that nodes in the network can trust).

There's a lot of no's here, but hope this helps! 馃槃鉂わ笍

All 2 comments

Thanks for the questions @nezzard!

For example i have db for conversation user A and B, i want to add permissions for this users to remove their msgs from db. For this i found info about it in your documentation. But as i understood, user can delete all db entry, so question is. How to prevent user A from deleting msgs of user B?

Correct, the permissions are per-database and it's currently not possible to set permissions such that individual entries in the db have different permissions. How this can be done atm is to separate the messages to different databases as per the permission scheme you want to implement.

We plan to add such fine-grained permissions in the future, but it's not being worked on at this moment.

If first is can't be done in orbit-db, i have second idea, that users add msgs to self db, and frontend will order this msgs from 2 databases by date. But, i dont see any timestamps in entry, only clock, which is not what i'm looking for. So questions, is there any timestamp or else?

There are no wall-clock timestamps in the OrbitDB data structures, so this is something you have to handle in application. Time (as in trusted real time) is a non-trivial problem in distributed systems generally and becomes even more non-trivial in trustless systems. Perhaps this discussion at orbit.chat will give you a bit more information. tl;dr: as far as I can tell, if you need a trusted and global wall-clock, you'd have to provide it from a trusted source (that is, an "oracle" server that nodes in the network can trust).

There's a lot of no's here, but hope this helps! 馃槃鉂わ笍

@nezzard If you have more questions I'd recommend two other places:

  1. The OrbitDB Field Manual, which has tons of information about how OrbitDB works.
  2. The new Orbit Chat sample app, which is now being actively developed.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

maroodb picture maroodb  路  4Comments

daviddias picture daviddias  路  6Comments

huhsame picture huhsame  路  4Comments

crazyrabbitLTC picture crazyrabbitLTC  路  6Comments

varcario picture varcario  路  5Comments