square-codeFast API

With the Fast APIs, you can submit and process transactions on the Fast network, or query for information about the current state of the network.

While the high level functionality of the APIs is similar to that of other cryptocurrency platforms, particularities of the Fast network which make it differ from existing blockchain systems necessitate changes in the underlying APIs:

  • Fast does not globally order transactions: this means each Fast validator is free to process transactions in parallel.

  • To unlock the maximum potential parallelism enabled by the Fast protocol, all work that can be offloaded from the validators is offloaded.

One consequence of this is that Fast validators (for the most part) do not gossip among themselves. Instead, the protocol is client-driven. This means that clients must communicate individually with each validator in the current validator set to drive transaction processing to completion.

To simplify the communication with the network, recall that the protocol allows for a proxy, an intermediate entity responsible for broadcasting messages from clients to validators and aggregating signatures. Read more in the description of Fast protocol. For this, we offer a special API variant that simplifies talking with the network.

Currently, Fast API is available in the following variants:

Proxy RPC

When a client calls a Proxy RPC method, internally, the proxy will:

  1. Forward an appropriate RPC call to each validator in the current validator set.

  2. Aggregate the RPC responses from each validator queried in (1).

  3. Return the aggregated results to the client.

The Proxy RPC lets builders move fast, without needing to worry about tracking current validator sets, connection failure handling and retry policies, response aggregation, etc.

Later documentation will cover these APIs in more detail.

Prerequisites

Fast APIs are based on the JSON-RPC protocolarrow-up-right, a transport-agnostic server/client RPC protocol that uses JSON-encoded payloads.

In Fast, our JSON-RPC APIs currently use an HTTP transport.

To use the Fast APIs, apps must be able to initiate a JSON-RPC over HTTP (i.e., act as JSON-RPC HTTP clients).

While the JSON-RPC specification itself is quite simple and easy to implement, there are already existing JSON-RPC client libraries available for popular programming languages like Python, Javascript, and Rust. Here are some in no particular order:

JSON-RPC requests can also be performed directly from your terminal using curl which is available by default on almost all modern OS distributions.

Below is a real JSON-RPC command written using curl that you can execute against the Fast network proxy, just by copying and pasting the text below into your terminal.

You'll see more such examples in the API documentation.

Contents

  • Proxy API: the complete API documentation for the Fast Proxy RPC interface.

  • Data types: cross-referenced type definitions.