@hackage utxorpc-client0.0.1.0

An SDK for clients of the UTxO RPC specification.

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.

  1. simpleUtxorpcClient -- connect to a service using the bare minimum required information.
    1. See /quick-start/Main.hs.
  2. utxorpcClient -- connect to a service using the provided UtxorpcInfo.
    1. See /example/Main.hs
  3. UtxorpcClientWith -- for fine grained control, provide a GrpcClientConfig (from http2-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:

  1. Request sent.
  2. Reply received.
  3. Server stream data received.
  4. Server stream ended.

For more information, see Utxorpc.Logged and /example.

Examples

There are two provided examples:

  1. /quick-start shows the bare minimum required to make a single unary request.
  2. /example shows a more involved example. /example/SimpleLogger.hs is a simple logger implementation that prints human-readable output, and /example/KatipLogger.hs is a more involved logger that demonstrates how to use logging functions that run in a transformer stack.