Skip to content

Mini Blockfrost

Dolos provides an HTTP endpoint to access data using Blockfrost OpenAPI specification.

Coverage

Dolos provides many, but not all of the Blockfrost endpoints. The following list represent the endpoints currently supported by Dolos:

EndpointDescription
/txs/{hash}/mirsGet MIRs for a specific transaction
/txs/{hash}/pool_retiresGet pool retirements for a specific transaction
/txs/{hash}/pool_updatesGet pool updates for a specific transaction
/txs/{hash}/stakesGet stakes for a specific transaction
/governance/dreps/{drep_id}Get DRep information
/txs/{hash}/redeemersGet redeemers for a specific transaction
/accounts/{stake_address}/rewardsGet rewards for a stake address
/accounts/{stake_address}/addressesGet addresses for a stake address
/metadata/txs/labels/{label}/cborGet CBOR metadata for transactions with a specific label
/metadata/txs/labels/{label}Get metadata for transactions with a specific label
/network/erasGet network eras information
/networkGet network information
/accounts/{stake_address}/delegationsGet delegations for a stake address
/accounts/{stake_address}/registrationsGet registrations for a stake address
/accounts/{stake_address}Get account information for a stake address
/assets/{asset}Get asset information
/pools/extendedGet extended pool information
/pools/{pool_id}/delegatorsGet delegators for a specific pool
/addresses/{address}/utxos/{asset}Get UTXOs for a specific address and asset
/txs/{hash}Get transaction information
/txs/{hash}/cborGet CBOR data for a transaction
/txs/{hash}/utxosGet UTXOs for a specific transaction
/txs/{hash}/metadataGet metadata for a specific transaction
/txs/{hash}/metadata/cborGet CBOR metadata for a specific transaction
/txs/{hash}/withdrawalsGet withdrawals for a specific transaction
/blocks/{hash_or_number}Get block information
/blocks/latestGet latest block information
/blocks/{hash_or_number}/nextGet next block
/blocks/{hash_or_number}/previousGet previous block
/blocks/{hash_or_number}/txsGet transactions for a specific block
/blocks/latest/txsGet transactions for the latest block
/blocks/slot/{slot}Get block by slot number
/txs/{hash}/delegationsGet delegations for a specific transaction
/epochs/{number}/parametersGet epoch parameters
/epochs/latest/parametersGet latest epoch parameters
/genesisGet genesis information
/addresses/{address}/transactionsGet transactions for a specific address
/addresses/{address}/utxosGet UTXOs for a specific address
/tx/submitSubmit a transaction

Usage

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.

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

This is an example of querying for the latest block using curl:

Terminal window
$ 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
}

Using the Blockfrost 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 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))

Using a Tx Builder

The endpoints required for most tx builders to work are supported. Libraries like Lucid, Lucid-evolution, Blaze, MeshJS, etc can be used by pointing their corresponding provider configuration to Dolos Mini-BF endpoint.

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"

Some of the endpoints require extra data to be tracked by Dolos. We disable tracking all data by default since it can heavily affect the storage requirements for running Dolos.

Depending on the endpoints you want to use, you’ll have to opt-in into specific dataset that you want Dolos to track.

  • seen_addresses: Tracks whether addresses have been observed.
  • asset_state: Monitors the state of assets.
  • pool_state: Keeps track of the state of pools.
  • pool_delegator: Observes delegator information for pools.
  • epoch_state: Tracks the state of epochs.
  • account_activity: Monitors activity related to accounts.
  • reward_logs: Keeps track of rewards for each delegator in each epoch

Check the Configuration Schema for detailed info on how to setup this.