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

Bet communication -- The problem to address #285

Open
sg777 opened this issue Oct 7, 2021 · 1 comment
Open

Bet communication -- The problem to address #285

sg777 opened this issue Oct 7, 2021 · 1 comment
Assignees

Comments

@sg777
Copy link
Collaborator

sg777 commented Oct 7, 2021

Before we jump into the problem, lets see how the communication is happening in bet.

The entire communication in bet is broadly divided into two parts.

  1. The communication among the backend nodes.
  2. The communication between backend nodes to the GUI.

The first part of the communication is described here. Since we have been using sockets to communicate over n/w we have been using public IP.

W.r.t second part of communication, for any backend node that is running a GUI is attached to it to provide the ease of use. Players use this GUI interface to play the game and now this communication is happening via websockets. The frontend websocket code is in js while the backend a webserver is running on the port 9000 using libwebsockets library. The GUI connects to the backend by providing the public IP on which the backend is running on.

###The problem which we are addressing here is
So in both parts of the communication, there is dependency on the public IP which we aim to remove. Right now we focus on working on removing the depencay of the public IP on the backend part of communication, Since I've been developing the text based interface as an alternative to the GUI so one can use it meanwhile until we have the solution for the GUI communication part also.

The issues related to it.

#234
chips-blockchain/pangea-poker#495

The possibilities we are looking into

Some possibilities we come across are the DHT(Distributed Hash Table), using which we can have identity the end point with a key that is created using PKCS and that basically solve the dependency on the IP.
I see openDHT and libp2p has the DHT implementation, but we are also looking into the topic subscription mechanism also since our backend communication are on pub/sub model. I see libp2p has a support for pubsub implementation in golang and RUST, we either have to write c binder on top of them to integrate into bet repo(since its written in C).

The other way around is use the openDHT implementation and simulate the backend pub/sub communication model.

@sg777 sg777 self-assigned this Oct 7, 2021
@sg777
Copy link
Collaborator Author

sg777 commented Dec 3, 2021

The summary of discussion with @satindergrewal is as follows:

In our case, we can either go to the route of directly using Js libp2p, or find some dev who can also help using the same Rust based libp2p wrapper for not just for C, but also for Js too.

Some useful links:
Libp2p JS implementation
https://github.com/libp2p/js-libp2p
Js implimentation of pubsub
https://github.com/libp2p/js-libp2p-floodsub
Rust Libp2p
https://github.com/libp2p/rust-libp2p/tree/master/protocols/floodsub
Demo pubsub: https://github.com/libp2p/demo-multi-lang#demo-2--pubsub
It has both Js and Rust example!!
https://github.com/libp2p/demo-multi-lang/tree/master/pubsub

As we see the libp2p has the implementation in both JS and RUST which can cover the backend and GUI side usecases, so we stick to replace nng with libp2p.

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

No branches or pull requests

1 participant