MyNixOS website logo
Description

Generated code for a gRPC interface for UTxO Blockchains.

UTxO RPC (u5c for short) is an interface tailored for interactions with UTxO-based blockchains, prioritizing performance and developer experience. By providing a common contract, a range of SDKs, and thorough documentation, UTxO RPC aims to facilitate:

  • Reusability: Enabling shared components that can be reused across different projects to simplify the integration effort.

  • Interoperability: A common interface to simplify integrations between different parties and avoid the common pitfall of vendor lock-in.

  • Performance: A serialized binary format which is compact and efficient, resulting in smaller message sizes and reduced network overhead compared to its JSON counterpart

Please note that this package only contains the generated Haskell code from the u5c specification. To write a u5c implementation, please see the client or server SDK.

For documentation on the specification, see https://utxorpc.org.

UTxO RPC

This package is generated by proto-lens-protoc from the u5c specification and contains Data.ProtoLens.Message.Message instances useful for serde. It is designed to be used with the client or server SDK. Build a message with the lens library by importing the relevant utxorpc modules and calling Data.ProtoLens.Message.defMessage:

import Control.Lens.Operators ((&), (.~))
import Data.ProtoLens.Message (Message (defMessage))
import qualified Data.Text.Encoding as T
import Proto.Utxorpc.V1.Sync.Sync (FetchBlockRequest)
import Proto.Utxorpc.V1.Sync.Sync_Fields (hash, index)

fetchBlockRequest :: FetchBlockRequest
fetchBlockRequest =
defMessage
    & ref .~
    [ defMessage 
        & index .~ 116541970
        & hash .~ T.encodeUtf8 "9d5abce5b1a7d94b141a597fd621a1ff9dcd46579ff1939664364311cd1be338"
    ]

The easieset way to send requests or run a service is through the SDKs: utxorpc-client and utxorpc-server.

Generating this package from the spec

Please see the u5c project README for information on how this package was generated. To generate this code yourself, please see proto-lens.

NOTE: proto-lens-protobuf-types version >= 0.7.2 is required to build this package, as it includes support of the FieldMask well-known type.

Maintainers

See the UTxO spec repo README.

[!NOTE] proto-lens-protobuf-types version >= 0.7.2 is required to build this package as it contains support for the FieldMask well-known type.

Metadata

Version

0.0.9.0

License

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows