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

Ideas for demos for orbit-db #148

Closed
haadcode opened this issue Nov 29, 2016 · 12 comments
Closed

Ideas for demos for orbit-db #148

haadcode opened this issue Nov 29, 2016 · 12 comments

Comments

@haadcode
Copy link
Member

orbit-db starts to be in a shape that it's usable on various platforms and for various use cases. In order to show what orbit-db can do, we should have a bunch of cool demos that display orbit-db's capabilities and features.

One of them is Orbit, but I would like to see more and more varied ones. Another demo I made at some point (the code might not run anymore) is a twitter-like feed app https://github.com/haadcode/planet-express, but it was a hack and I haven't had the time to continue.

I would like to reach out to the community to source ideas as to what we could build to demo orbit-db?

What would you like to see? What do you propose to showcase the technology in a cool way? These could be either Node.js or in the browser.

@haadcode
Copy link
Member Author

haadcode commented Nov 29, 2016

I would like to see someone take the idea of planet-express (ie. twitter) and build it from scratch. In order to build a twitter-like app, one needs to use several different orbit-db databases (feed, eventlog, counters, kvstore) and as such, this is a good and varied demo.

I would love to see a "playlist" or generic collection demo where you can add/remove items to collections. This kind of component could be used in file managers, music players, chat apps. etc.

It would be cool to see a graphical interface for the key value store. Functionality wise it wouldn't need to be anything more than what you can do with the kvstore, but we could do something cool with the UI (eg. an "oldschool terminal" styled interface in the browser, or perhaps a WebGL-based UI)?

A game using orbit-db would be really cool.

Another cool demo would be to hook #ipfs IRC channel with a bot to an orbit-db which then can be viewed in the browser, much like botbot.me.

If we want to show off some very complex but extremely cool stuff, we could build a publishing platform demo: user profiles, several news feeds, items to purchase, personal/private collections. Think something like Steam or Spotify.

Hopes this gets you started with ideas!

@victorb
Copy link
Member

victorb commented Nov 29, 2016

I would love to see something like HackMD or Etherpad using orbit-db in the background.

@Kubuxu
Copy link
Contributor

Kubuxu commented Nov 29, 2016

It should be possible by sending creating OrbitDB transport for Cryptpad.

@haadcode
Copy link
Member Author

I would love to see something like HackMD or Etherpad using orbit-db in the background.
It should be possible by sending creating OrbitDB transport for Cryptpad.

Me too! 👍 There's a bit more work to a collaborative editor as it'd a specific type of db/CRDT that's not yet implemented in orbit-db. If someone wants to try to make this happen, I'd be more than happy to help.

@ghost
Copy link

ghost commented Nov 29, 2016

I'd love to see a chat bot which I can highlight and which will then log the line I wrote somewhere.

<lgierth> logbot: i'm doing something right now and i'm telling you so everyone else knows and it's searchable
<logbot> lgierth: ok -- new head: ipfs.io/ipfs/Qmfoobar

This would be the writing end pushing stuff into some standard-ish data structure, and the reading part would be a web UI with search and all.

@fdietze
Copy link

fdietze commented Nov 29, 2016

What about a todo-app where lists can be shared with other users?

@jbenet
Copy link

jbenet commented Nov 29, 2016

Here are much simpler suggestions, for demos of the technology:


I'm working on designing a visualization that will capture:

  • orbit-db log (with inspection of message)
  • pubsub stream (with inspection of message)
  • connectivity
  • adding/removing more peers
  • opening/closing connections
  • (bonus pts) adding/removing connectivity barriers

@cristiano-belloni
Copy link

cristiano-belloni commented Nov 19, 2017

@haadcode: I would like to build a twitter-like demo. But I guess that it would be worth to wait for #240 to be completed - as far as I can understand, with authenticated writes users won't be able to

  1. modify other users' content and
  2. prove they "own" a particular entry in the database, although they WON'T be able to
  3. dynamically get a write permission

(but I guess they will be able to do 1 and 2 with the wildcard permissions, am I correct?)

@haadcode
Copy link
Member Author

@cristiano-belloni a twitter-like demo would be awesome! :) And indeed, with #240 which we can hopefully release this week, there'll be a way to have per-user feeds (1) as well as multi-user (or anyone-can-write) feeds.

Let us know if you start building it, I'd be happy to help!

@cristiano-belloni
Copy link

cristiano-belloni commented Nov 21, 2017

@haadcode So I'm coding around this Twitter demo thing and I decided to start with the per-user feeds. As you put it in the docs:

For example, in a twitter-like application, tweets would not be saved in a global "tweets" database to which millions of users write concurretnly, but rather, each user would have their own database for their tweets. To follow a user, a peer would subscribe to a user's feed, ie. replicate their feed database.

So I'm trying to just have a key-value private database for user details (username or handle, first name, last name). I'll copy paste a bit of snippets here, if we want to move the discussion elsewhere it's ok.

What I do when the thing starts is:

ipfs.on('ready', async () => {
      if (!orbitdb) orbitdb = new OrbitDB(ipfs)
      if (!access) access = {
        // Give write access to ourselves
        write: [orbitdb.key.getPublic('hex')]
      }
      res()
})

Then I open my user db and load:

  if (!orbitdb) await init()
  if (!userDb) userDb = await orbitdb.kvstore('user-db', access)
  await userDb.load()

The userDb is empty at this point and I prompt the user to enter username, first name, last name. Then I set them:

Promise.all([
    userDb.put('userName', userName),
    userDb.put('firstName', firstName),
    userDb.put('lastName', lastName),
  ])

Everything works ok, but if I reload the page and go through the same cycle, I would expect the values to be gettable. Instead, when I do:

return {
    userName: userDb.get('userName'),
    firstName: userDb.get('firstName'),
    lastName: userDb.get('lastName')
  }

The values will be all undefined. What am I missing? The userDb.address.toString() is always the same, and I assumed that await userDb.load() loads all the data previously put in the userDb. It doesn't seem the case.

@cristiano-belloni
Copy link

cristiano-belloni commented Nov 21, 2017

Mystery solved. This:

Promise.all([
    userDb.put('userName', userName),
    userDb.put('firstName', firstName),
    userDb.put('lastName', lastName),
  ])

will update only LastName, while this:

  await userDb.put('userName', userName)
  await userDb.put('firstName', firstName)
  await userDb.put('lastName', lastName)

will update all three. It seems that running the three promises in parallel doesn't work, but running them serially does? Is it expected? Or I'm missing something obvious?

@aphelionz
Copy link
Member

@cristiano-belloni each entry on a single node will need to know about all the previous entries from that node to set the clock value - I'm guessing you've got some sort of race condition going on between the write and the concurrent read/reduction of the oplog.

I'm going to close this ticket for now, and refer people to the OrbitDB Field Manual for discussion about project ideas and questions like "What Can I Use Orbit For?

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

No branches or pull requests

7 participants