statechannels / SCBridge-Wallet

MIT License
2 stars 3 forks source link

Figure out how the clients will exchange messages #18

Closed geoknee closed 1 year ago

geoknee commented 1 year ago

Let's maybe hold off on this until we have something working with "manual message passing in a script" approach.

When that is ready, we could implement something with http.

geoknee commented 1 year ago

Leftfield idea: webRTC? (to be discussed). Or some kind of local storage communication like what Colin did for his speedrun thing.

NiloCK commented 1 year ago

Here is a demo of the API I used for speedrun. It could actually be pretty quick and easy to set up for our purposes - three (or whatever) local browsers running in-browser clients who need data pipes between them.

Each BroadcastChannel is bidirectional and is named. So Alice-Irene can have one pipe, Irene-Bob another, etc.

BroadcastChannels work among browser windows that are hosted in the same origin - eg, https://github.com/, https:/statechannels.org/, localhost.

Screencast from 2023-10-13 10:11:16 PM.webm

geoknee commented 1 year ago

In order to make this work, I think we will need to have a single server for all the frontends. BroadcastChannels need a consistent origin (so we cannot change the port number, for example).

NiloCK commented 1 year ago

BroadcastChannels were implemented and merged in #38. Closing this issue in so far as the hackathon is concerned - to be revisited if this code base will live further than a demonstration.