APIs
Mini Blockfrost

Mini Blockfrost

Dolos exposes a HTTP endpoint that exposes some of Blockfrost's endpoints.

The endpoint provided implements some but not all of the endpoints defined by the Blockfrost OpenAPI specification (opens in a new tab). Currently implemented endpoints are:

  • /accounts/{stake_address}/utxos
  • /addresses/{address}/utxos
  • /addresses/{address}/utxos/asset
  • /blocks/latest
  • /blocks/latest/txs
  • /blocks/{hash_or_number}
  • /blocks/{hash_or_number}/addresses
  • /blocks/{hash_or_number}/next
  • /blocks/{hash_or_number}/previous
  • /blocks/{hash_or_number}/txs
  • /blocks/slot/{slot_number}
  • /epochs/latest/parameters
  • /tx/submit
  • /txs/{tx_hash}/cbor

If enabled via configuration, Dolos will expose a TCP port accepting HTTP connections. The default port number is 3000, but this value can be changed via configuration.

Usage

Once you have the daemon running you can hit the endpoint using any HTTP client (cURL, Postman, your browser, etc). Some cURL examples:

$ curl localhost:3000/blocks/latest | jq -S
{
  "block_vrf": "vrf_vk1wz88xjus636xa3u3qwmhwqqawf4dwed96yh7r6k9t36xtk2m635q4tfmmz",
  "confirmations": 0,
  "epoch": 895,
  "epoch_slot": 74777,
  "fees": "1088620",
  "hash": "7577092717e9f764d9cda887beaf5b1da022f58fbe140f0c6f0e122fac7c383c",
  "height": 3121489,
  "next_block": null,
  "op_cert": "221826dc3e1061793f486026c1e02416ac3829f38c3e7388acd3540ba46d576d",
  "op_cert_counter": "7",
  "output": "10106802795",
  "previous_block": "1e16f870725c163da2f63301794c99c95861d01afbea75b8902f76485e5e8af8",
  "size": 12025,
  "slot": 77402777,
  "slot_leader": "pool1vurgy6s6u7yq36shf9yspesh3rrnd36km8xkghpcr4smgfz278m",
  "time": 1744058777,
  "tx_count": 2
}
 
$ curl localhost:3000/blocks/7577092717e9f764d9cda887beaf5b1da022f58fbe140f0c6f0e122fac7c383c/addresses | jq -S
[
  {
    "address": "addr_test1qpqkckcetcavp78f0pj00vfcspmu0xdqev29smnmv7llh4eqgpdscdds83ekk7lg9uztqchvxl64mjcjj2mydl27fef",
    "transactions": [
      {
        "tx_hash": "1a5458ac788cac1b48df584762af5bce43b621f588342b5957402fce4c32ba4a"
      }
    ]
  }
]
 
$ curl localhost:3000/txs/1a5458ac788cac1b48df584762af5bce43b621f588342b5957402fce4c32ba4a/cbor | jq -S
{
  "cbor": "84aa00d90102838258208243dcc6e325742625b9cc06fe...
 

SDKs

Blockfrost's SDKs can (to the most part) be adapted to be used with the Dolos MiniBF endpoint. An example with the Python SDK (opens in a new tab) looks like this:

import json
 
from blockfrost import BlockFrostApi
 
api = BlockFrostApi(
    project_id=None,
    base_url="http://localhost:3000",
    api_version=None,
)
api.api_version = None  # The API version defaults to "v0" on __init__.
 
print(json.dumps(api.block_latest().to_dict(), indent=2))

TX Builder support.

Support for TX building tools as a Blockfrost Provider is not yet complete, but we're working towrds that goal.

Configuration

The serve.minibf section controls the options for the MiniBF endpoint that can be used by clients.

propertytypeexample
listen_addressstring"[::]:3000"
  • listen_address: the local address (IP:PORT) to listen for incoming connections ([::] represents any IP address).

This is an example of the serve.minibf fragment with a dolos.toml configuration file.

[serve.minibf]
listen_address = "[::]:3000"