decentraland / MANA-community-fund-learning-content

Offer bounties in MANA to developers that create educational content: tutorials & scene samples
11 stars 8 forks source link

Decentraland scene synced by RESTful API #26

Closed nearnshaw closed 2 years ago

nearnshaw commented 6 years ago

Create a node server implementing a RESTful API to handle and store scene state data for a Decentraland scene.

Create a Decentraland scene that calls the API your server exposes to obtain and update the scene state as users interact with it. This should enable multiplayer interaction with the scene, as all users render their scenes based on a consistent state stored in this server.

The server where the scene is hosted must be built from scratch, using widely recognized tools to store and handle data, like Redis, Postgres or Memcache.

Host the server and the scene/s that use it on a hosting service like https://zeit.co/now.

You can refer to this blogpost for help sending API requests from scenes.

Extra points if a single server is used to handle the states of multiple separate multiplayer scenes.

You can base the scenes off the sample scenes provided by Decentraland, but extra points if you create custom interactive scenes that make use of a shared state between users. You're free to use your creativity and imagine a scene that illustrates the objectives in an interesting and engaging way.

Your code must be clear and clean, as it must serve as an example for other developers trying to achieve the same kind of result.

An attached Readme.md file must list the steps required to create the project, as a lightweight tutorial.

The full code for the scene and the server you create must be delivered to us. We will share this code, perhaps in documentation and blogposts. Decentraland developers will be free to use and remix this code on their own scenes without any restriction.

gitcoinbot commented 6 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 10000.0 MANA (736.8 USD @ $0.07/MANA) attached to it.

tcrowe commented 6 years ago

Good day @nearnshaw :wave:

IMO these should be combined: https://github.com/decentraland/MANA-community-fund-learning-content/issues/25

The reasoning is that in node the HTTP, JSON-RPC, WebSocket are all one server calling the same methods.

gitcoinbot commented 6 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 9 months, 3 weeks from now. Please review their action plans below:

1) tcrowe has been approved to start work.

Hi!

I'll spool up a node Express server with WebSockets included. So the client can talk to HTTP or WebSockets from the same server.

I'll try to interface with all of the databases you mentioned. Like a setting. Perhaps we can do a "provider" function that allows any database.

Learn more on the Gitcoin Issue Details page.

2) websoftwares has applied to start work _(Funders only: approve worker | reject worker)_.

Hello I would like to apply for this project as I think I am a good fit with my experience and background.

The plan would be:

greetings Boris

Learn more on the Gitcoin Issue Details page.

tcrowe commented 6 years ago

Since you mentioned zeit now they have an option that works with socket.io https://github.com/zeit/micro/blob/069f31fa506086cdbf0ce3364d16ab972e8cc200/examples/socket.io-chat-app/index.js

tcrowe commented 6 years ago

Synchronize redis across all socket.io clients https://github.com/socketio/socket.io-redis

gitcoinbot commented 6 years ago

@tcrowe Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 6 years ago

@tcrowe Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

tcrowe commented 6 years ago

So far so good. 👍🏼 I expect a few more days before I want to start putting the demo out on the cloud.

gitcoinbot commented 6 years ago

@tcrowe Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 6 years ago

@tcrowe Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

tcrowe commented 6 years ago

It's still going well. There's nothing blocking me. There's some learning involved about the APIs. 👍🏼

tcrowe commented 6 years ago

I got most of the other one. This one is wrapping up next.

https://github.com/decentraland/MANA-community-fund-learning-content/issues/25#issuecomment-426501945

tcrowe commented 6 years ago

I was blocked on the websockets sync for a while and didn't make progress on this HTTP sync scene. I discovered some limitations so that I cannot use textboxes in the scene right now which is what I was going to use for this.

Nico helped get me on track. You can see the websockets scene update here: https://github.com/decentraland/MANA-community-fund-learning-content/issues/25#issuecomment-429513197

I'll get back with you soon on this.

tcrowe commented 5 years ago

Alright! I'm almost done. I was at first using Postgres SQL but I got stuck, raged, and swapped it out for MongoDB. That's more popular with nodejs so I thought it would be cool. If you want a specific DB you can let me know and I'll be happy to change it.

I'll get pics and a repo for you to see today or tomorrow.

Thanks for your patience, @nearnshaw

nearnshaw commented 5 years ago

Awesome, thanks Tony! MongoDB sounds like a good pic, although I don't think we have any specific preferences there, whatever is well known and works :)

tcrowe commented 5 years ago

I got it working with some screens here:

https://github.com/tcrowe/sample-sync-rest

The concept is to demonstrate REST by:

For me using MongoDB was really easy. I just installed it, ran the app, and it's working.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 10000.0 MANA (900.03 USD @ $0.09/MANA) has been submitted by:

  1. @tcrowe

@nearnshaw please take a look at the submitted work:


tcrowe commented 5 years ago

I added polling each one second and some explanations to the code: https://github.com/tcrowe/sample-sync-rest

I'm moving to close out the bounty now but I am happy to keep tweaking until it's just right!

gitcoinbot commented 5 years ago

⚡️ A tip worth 2000.00000 MANA (133.59 USD @ $0.07/MANA) has been granted to @tcrowe for this issue from @nearnshaw. ⚡️

Nice work @tcrowe! Your tip has automatically been deposited in the ETH address we have on file.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 10000.0 MANA (667.94 USD @ $0.07/MANA) attached to this issue has been approved & issued to @tcrowe.

Additional Tips for this Bounty:


gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 10000.0 MANA (667.94 USD @ $0.07/MANA) attached to this issue has been approved & issued to @tcrowe.

Additional Tips for this Bounty: