hydra
hydra copied to clipboard
Allow API client and server to negotiate features
Why
Clients might have different requirements about the data they want from our API Server:
- Some might not want to be fed the history of previous messages when they connect
- Some might want to send/receive transactions in JSON or CBOR
What
- Provide a negotiation phase when a client connect to API Server
- Server sends
Greetingmessage as before, possibly with a version - Client sends a
Greetingmessage with options set - Server configures the connection according to the options.
- (optional): Server sends Available options in its initial
Greetingmessage - Then, we want to use this negotiation mechanism in the two example configurations we encountered so far:
- Configurable transaction format
- Configurable latching of history
How
- [ ] Create a negotiation mechanism
- [ ] #371
- [ ] #379
Another idea by @KtorZ is to use the sub-protocol negotiation in the WebSocket standard.