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

Chat on orbit-db #354

Closed
nezzard opened this issue Apr 3, 2018 · 2 comments
Closed

Chat on orbit-db #354

nezzard opened this issue Apr 3, 2018 · 2 comments
Labels

Comments

@nezzard
Copy link

nezzard commented Apr 3, 2018

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?

@haadcode
Copy link
Member

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! 😄❤️

@aphelionz
Copy link
Member

@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.

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