This commit updates the networking stack to use asynchronous I/O for improved performance and concurrency. We have replaced synchronous I/O calls with their asynchronous counterparts and refactored the code to use async/await and Tokio runtime.
* WIP
* Fix compilation on windows machines
* Make TxBody generic
Technically we should be generic over TxBody for arbitrary ouroboros implementations; however, that makes things awkward. So, we introduce GenericClient and GenericServer, with concrete types that instantiate them to Cardano specific types. We could have done this with default type arguments, but this pushes the type system to it's limits and it often can't infer the correct type
* More examples tweaks; clippy and fmt
* Remove unneccesary defaults
* Tag 24 is no longer mysterious
It means raw CBOR
* Cargo fmt
One day I'll configure vscode to do this on safe
feat!: Return the socket address when accepting a connection
BREAKING CHANGE: The signature for Bearer.accept_tcp now returns the bearer, and the address that connected.
This can, for example, be used to implement allow and deny lists for accepting or rejecting incoming connections.
* Return the remote address from accept_unix
* cargo fmt
* Fix comment formatting
feat: Add server-side handshake client
* Implement server-side handshake client
* fmt and clippy
* Implement decode for handshake propose messages
* Small cleanup
* cargo fmt
* Log out the full message we're sending to the server, for debugging
* Make txsubmission TxId parametric
You might expect this to just be 32bytes; technically, however, in the spec it's unspecified, and on the wire it's an array, with an era number and then a 32byte hash. This leaves us flexible to that encoding changing in the future
* Add a TODO comment for the future
* Rename methods, format + clippy
The goal here is to make the use of channels when interfacing with nodes less of a black box; the 0x8000 bit flip is a very surprising behavior if you're not already familiar with it.
* Add constants for known miniprotocols
Now consumers of the crate don't have to memorize what channel number means what
* Add myself to the crate authors
* feat(miniprotocols): Implement tx submission client
* Match CDDL specs
* Fix build errors
* Add server implementation for txsubmission
Also includes some documentation for how to use both the client and the server
* cargo fmt
* clippy suggestions
clippy pls
* Fail explicitly on missing n2c unix socket
---------
Co-authored-by: Pi Lanningham <pi@sundaeswap.finance>