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

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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


[Skip to Readme]

Properties

Versions 0.0.1.0, 0.0.1.0, 0.0.1.1, 0.0.2.0
Change log None available
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 Mayhew <dominic.j.mayhew@gmail.com> TxPipe <registrant@txpipe.io>
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-16T03:40:17Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


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 functions for creating a connected UTxO RPC client and for calling each each RPC in the UTxO RPC specification. Automated logging of each event in a gRPC call is also supported.

How to Use

[!NOTE] This SDK depends on package versions that are not on Hackage. Consult stack.yaml or cabal.project for help configuring your project's dependencies.

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 a UtxorpcInfo record.
    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 of functions for each method in UTxO specification, as well as a function to close the connection.

Logging

This SDK supports automated logging through the UtxorpcClientLogger type. It is a record of one user-defined logging function 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 that uses one of the following two logger implementations:
    1. /example/SimpleLogger.hs is a simple logger implementation that prints human-readable output.
    2. /example/KatipLogger.hs is a more involved logger that demonstrates how to use logging functions that run in a transformer stack. Run the example with --katip to use this logger.