I noticed that there is a framework implementation of the request-response protocol in the library of rust-libp2p
and it is used in Substrate
project. However, there is no corresponding implementation in go-libp2p
.
The multipro example of go-libp2p
is somewhat similar, but very different: it uses two protocol-id
s (one request and one response each) to create two new streams to complete the request and response.
I feel that doing so is neither efficient nor concise. If go-libp2p
can provide a request-response implementation similar to rust-libp2p
, it would be even better. Then, protocols implemented in two languages at the application layer can be seamlessly integrated.
Welcome to any reply, thanks!
Good news, this is an area of active research and development in go-libp2p. Going to link to a related discussion here: Possible to Make a P2PHTTP Request from Browser? - #3 by MarcoPolo