@hackage utxorpc-client0.0.1.0
An SDK for clients of the UTxO RPC specification.
Categories
License
Apache-2.0
Maintainer
dominic.j.mayhew@gmail.com
Links
Versions
Installation
Dependencies (9)
- base >=4.7 && <5
- bytestring <0.13
- http2-client >=0.10.0.1 && <0.11
- http2-client-grpc <0.9
- http2-grpc-proto-lens <0.2
- http2-grpc-types <0.6 Show all…
Dependents (0)
UTxO RPC Client SDK
An SDK for clients of the UTxO RPC specification.
The goal of this SDK is to reduce boilerplate and increase ease of use of the UTxO RPC spec. This SDK provides convenience methods for creating a connection to a UTxO RPC service and for calling each each method in the UTxO RPC specification. Automated logging of each event in a gRPC call is also supported.
How to Use
Use the SDK through one of the client-creating functions in Utxorpc.Client.
simpleUtxorpcClient-- connect to a service using the bare minimum required information.- See
/quick-start/Main.hs.
- See
utxorpcClient-- connect to a service using the providedUtxorpcInfo.- See
/example/Main.hs
- See
UtxorpcClientWith-- for fine grained control, provide aGrpcClientConfig(fromhttp2-client-grpc)
Each of these functions provides a record type hosting functions for each method in UTxO RPC, as well as a method to close the connection.
Logging
This SDK supports automated logging through the UtxorpcClientLogger type. It is a record hosting user-defined logging functions for each of the following events:
- Request sent.
- Reply received.
- Server stream data received.
- Server stream ended.
For more information, see Utxorpc.Logged and /example.
Examples
There are two provided examples:
/quick-startshows the bare minimum required to make a single unary request./exampleshows a more involved example./example/SimpleLogger.hsis a simple logger implementation that prints human-readable output, and/example/KatipLogger.hsis a more involved logger that demonstrates how to use logging functions that run in a transformer stack.