Skip to content

utxorpc/haskell-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UTxO RPC SDK

SDKs for clients and services of the UTxO RPC specification.

The goal of this SDK is to reduce boilerplate and increase ease of use of the UTxO RPC (u5c) spec. This project contains two packages: SDKs for clients and services. Both build on code generated by proto-lens-protoc from the u5c specification and provide more convenient interfaces than the raw generated code. In addition, both SDKs provide support for automated logging. Please pay close attention to the documentation and types if you are implementing service and client logging, as they differ slightly.

Note

These SDKs depend on package versions that are not on Hackage. Consult stack.yaml or cabal.project for help configuring your project's dependencies.

Users

Please consult the documentation for the client and server packages.

Maintainers

A note about logging implementation

The logged RPC functions (e.g., loggedUnary) replace the library functions (e.g. rawUnary) instead of wrapping them to allow logging to occur at a higher level. E.g., providing an interface such as:

logUnary $ rawUnary ... -- args

would allow logging functions to access lower-level network details (and allow logging of additional events, such as requests to invalid paths), but wouldn't allow logging functions to access fully-formed Message record types.

In addition, the loggedUnary and loggedSStream functions call internal functions that take the relevant network function as an argument. This is to accommodate unit testing where the network function is mocked. This way, the logic of the logging functions can be tested without testing the implementation of the network functions. There are not currently any end-to-end tests for this project.