UTxO RPC
By TxPipe
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, UtxoRpc aims to facilitate seamless integration across an heterogenous ecosystems of clients and data providers. Utilizing event-driven patterns and the capabilities of Proto3, the interface supports efficient communication, cross-language compatibility, and adaptability between systems.
Demeter is serverless, you don't need to provision any infrastructure.
It provides highly-available, multi-tenant instances of UTxO RPC, powered by Dolos.
By utilizing UTxORPC on Demeter, developers can seamlessly integrate blockchain functionalities into their applications with minimal effort.
The platform's event-driven architecture and efficient communication protocols ensure that you can build scalable and performant solutions.
Requests to these instances are load balanced. Demeter eliminates the need for manual infrastructure management by handling monitoring, security, and version upgrades.
Demeter price scales to zero, you only pay for what you use.
Usage is measured by number of requests, and price defined for every 100,000 requests. If no requests are made, you incur no charges, except for minimum fees in Tiers with reserved throughput. Demeter offers different Tiers for UTxO RPC Ports, allowing you to reserve throughput and scale your usage to meet the specific demands of your project. Service is limited by number of requests per second. Leverage Demeter Free Tier to get started.
Tier | Free | Flex | Pro I | Pro II |
---|---|---|---|---|
Minimum fee | - | - | - | - |
Price per 100k requests | - | - | - | - |
Max requests per second | - | - | - | - |
Aprox daily requests limit | - | - | - | - |
This guide will help you get started with interacting with the UTxO RPC service offered by Demeter using grpcurl
. We'll cover everything from installing grpcurl
to making your first requests to the UTxO RPC endpoint.
grpcurl
is to gRPC what curl
is to HTTP. While HTTP APIs are widely understood and commonly used, gRPC is gaining popularity for its efficiency and performance, particularly in microservices communication. However, gRPC's binary protocol can seem less accessible because traditional tools like curl
don't work with it. This is where grpcurl
comes in—a command-line tool that simplifies interactions with gRPC services, much like curl
does for HTTP.
You can install grpcurl
on various operating systems. Detailed installation instructions and binaries are available on its official GitHub repository.
To interact with the UTxO RPC service provided by Demeter, you will need to use grpcurl
along with your API key.
To list the available services on the UTxO RPC endpoint, run the following command:
grpcurl -H 'dmtr-api-key: <api-key>' -H 'content-type: application/grpc' api.utxorpc.cloud:443 list
This will output a list of services available on the endpoint:
You can further describe a specific service or method. For example, to describe the FetchBlock
method provided by the SyncService
, run:
grpcurl \
-H 'dmtr-api-key: <api-key>' -H 'content-type: application/grpc' \
api.utxorpc.cloud:443 describe utxorpc.v1alpha.sync.SyncService.FetchBlock
This command will output details about the FetchBlock
method, including its request and response structure.
Once you understand the request format, you can execute a method. For instance, to fetch a specific block using the SyncService
, use the following command with the appropriate parameters:
grpcurl \
-H 'dmtr-api-key: <api-key>' -H 'content-type: application/grpc' \
-d '{"ref": [{"index": "68364075", "hash": "hxGMj8HY/u4YSKl2Wk6m8bocd9iQeMeelrh1Db8umuY="}]}' \
api.utxorpc.cloud:443 utxorpc.v1alpha.sync.SyncService.FetchBlock
In this example, the index
represents the slot of the block, and the hash
is the block hash encoded in base64 in Cardano. The response will include details about the block, such as its header, transactions, and other relevant information.