This Bisq branch shows how to embed a Ratpack
https://ratpack.io webapp in a Bisq Daemon.
$ ./gradlew clean build -x test
$ ./bisq-daemon --apiPassword=xyz
Ratpack can support many types of HTTP clients, including REST clients, e.g.,
The same CoreApi
instance used by the Bisq Daemon is injected into the Ratpack
webapp.
Note: The Ratpack
webapp is embedded in bisq.daemon.app.BisqDaemonMain
for demo purposes only. The gRPC server and web server would be decoupled in a production app, but both servers could use the same the CoreApi
instance.
The branch also contains some Ratpack
web demos, including unidirectional and bidirectional streaming examples.
RatpackStreamingObserverApp
demonstrates web streaming with a java.net.http.HttpClient
Unidirectional and bidirectional streaming between gRPC server and a gRPC CLI is demonstrated in https://github.com/ghubstan/bisq/blob/grpc-streaming-examples/README.md.
Web clients could also send streaming requests to a gRPC server via a Ratpack webapp: CLIENT <-> WEBAPP <-> gRPC Server.
The WEBAPP in the middle is not ideal, but it would not restrict clients to grpc-web
compatible (node-js/HTTP2) clients only.
This investigation was put aside before I implemented a CLIENT <-> WEBAPP <-> gRPC Server streaming example.