utxorpc-client: An SDK for clients of the UTxO RPC specification.

[ apache, blockchain, cardano, library, network, program ] [ Propose Tags ]

This SDK includes helper functions for creating a UTxO gRPC client, calling UTxO RPC methods, and logging every interaction.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1.0, 0.0.1.1, 0.0.2.0
Dependencies aeson (<2.3), base (>=4.7 && <5), bytestring (<0.13), case-insensitive (<1.3), http2 (<5.2), http2-client (>=0.10.0.1 && <0.11), http2-client-grpc (<0.9), http2-grpc-proto-lens (<0.2), http2-grpc-types (<0.6), katip (<0.9), lens (<5.3), proto-lens (<0.8), safe (<0.4), time (<1.13), transformers (<0.7), unliftio (<0.3), utxorpc (>=0.0.3.0 && <0.1), utxorpc-client, uuid (<1.4) [details]
License Apache-2.0
Author Dominic Mayhew
Maintainer dominic.j.mayhew@gmail.com
Category Network, Blockchain, Cardano
Home page https://github.com/utxorpc/utxorpc-client#readme
Bug tracker https://github.com/utxorpc/utxorpc-client/issues
Source repo head: git clone https://github.com/utxorpc/haskell-sdk
Uploaded by txpipe at 2024-02-16T02:50:48Z
Distributions
Executables client-quick-start, client-example
Downloads 49 total (17 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for utxorpc-client-0.0.1.0

[back to package description]

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.