Open tomaka opened 1 year ago
This function should be added as a PR to https://github.com/paritytech/json-rpc-interface-spec/
We need to add a few events in established.rs
:
All the JSON-RPC events can then be derived from this.
Then, the events service.rs
need to be updated as well. This part is unfortunately not completely clear to me.
When a notifications out request has successfully negotiated the substream. When a request has successfully negotiated the substream.
Actually, we can just pretend that the substream has opened when we start the opening, so there's no need for these two events.
Then, the events service.rs need to be updated as well. This part is unfortunately not completely clear to me.
The solution (which I feel stupid for not thinking of earlier) is to provide an OpaqueEvent
which can be turned into either a LowLevelEvent
or an optional HighLevelEvent
.
A big difficulty, which I didn't anticipate, is that the connections that the network service opens do not target a chain in particular, but the JSON-RPC function does target a specific chain.
This means that we have to somehow report to the API user only connections that we think might belong to a specific chain. Reporting only some connections might be misleading? Maybe we should report all connections?
https://github.com/paritytech/smoldot/issues/2245