zcash / lightwalletd

Lightwalletd is a backend service that provides a bandwidth-efficient interface to the Zcash blockchain
MIT License
84 stars 86 forks source link

Support gRPC over websocket to allow direct access from browsers #450

Open arya2 opened 1 year ago

arya2 commented 1 year ago

Motivation

Using lightwalletd from the browser currently requires a proxy server to provide an http/1.1 transport. or gRPC over websocket.

Integrating gRPC over websocket support will offer web developers the direct access to lightwalletd that native developers currently enjoy.

LarryRuane commented 1 year ago

I asked chatGPT about this -- did I ask the question correctly? https://chat.openai.com/share/02a1ba5b-217f-42a4-986d-d191f70866c3

It seems to suggest supporting websocket but maybe not http/1.1. Is that acceptable? (I really don't understand this area very well.)

LarryRuane commented 1 year ago

Can you provide some motivation for this? I would have to justify spending time on this (if possible), thanks.

arya2 commented 1 year ago

It seems to suggest supporting websocket but maybe not http/1.1. Is that acceptable? (I really don't understand this area very well.)

That would be ideal, I'm not sure if http/1.1 would support the streams, and websockets offer more flexibility / lower latency.

borngraced commented 1 year ago

Hey @LarryRuane how is this going?

LarryRuane commented 1 year ago

I'm just getting around to this finally, sorry for the delay, I'll try to get this done within the next week or so.

arya2 commented 1 year ago

It seems to suggest supporting websocket but maybe not http/1.1. Is that acceptable? (I really don't understand this area very well.)

That would be ideal, I'm not sure if http/1.1 would support the streams, and websockets offer more flexibility / lower latency.

@LarryRuane There may also be interest in calling these RPCs from a serverless environment where websockets don't work well, so adding regular http/1.1 REST endpoints would be valuable too.

teor2345 commented 1 year ago

I asked chatGPT about this -- did I ask the question correctly? chat.openai.com/share/02a1ba5b-217f-42a4-986d-d191f70866c3

It seems to suggest supporting websocket but maybe not http/1.1. Is that acceptable? (I really don't understand this area very well.)

ChatGPT prioritises giving confident answers over correct answers, so I'd encourage you to check those answers with StackOverflow or the Go library reference, and test that all the RPCs work.

Here's some background on ChatGPT's lack of reliability - a study found that ChatGPT got code questions wrong 52% of the time: https://www.theregister.com/2023/08/07/chatgpt_stack_overflow_ai/

ec2 commented 2 months ago

Is this still being worked on? @LarryRuane