config.json


Overview

The `config.json` file serves as the primary configuration source for a Blockbook Indexer Service instance tailored to the Dogecoin blockchain. This JSON configuration file contains all necessary parameters for connecting to the Dogecoin RPC node, managing indexer worker concurrency, setting caching policies, integrating fiat currency exchange rates, and specifying blockchain-specific parameters such as address format and extended public key magic bytes.

This file enables the indexer service to operate correctly by providing connection credentials, runtime options, and external service endpoints. It is critical in customizing the indexer's behavior to the targeted blockchain and its ecosystem.


Detailed Explanation of Configuration Fields

Field

Type

Description

Example / Notes

**fiat_rates**

String

Specifies the external provider for fiat currency rates used to enrich blockchain data with exchange rates.

`"coingecko"` — the indexer fetches rates from CoinGecko API.

**fiat_rates_vs_currencies**

String

A comma-separated list of fiat and crypto currency symbols against which exchange rates are fetched.

`"AED,ARS,AUD,BDT,...,BTC,ETH"` — includes multiple fiat currencies and cryptocurrencies.

**fiat_rates_params**

String

A JSON-encoded string containing parameters for the fiat rates provider, such as API URL, coin identifier, and update interval in seconds.

{"url": "https://api.coingecko.com/api/v3", "coin": "dogecoin", "periodSeconds": 900}

**coin_name**

String

The full name of the blockchain coin.

`"Dogecoin"`

**coin_shortcut**

String

The coin's ticker symbol or shorthand.

`"DOGE"`

**coin_label**

String

Label used across the indexer and APIs for this blockchain coin.

`"Dogecoin"`

**rpc_url**

String

The full URL to the blockchain node's RPC endpoint, used for direct blockchain queries such as fetching blocks and transactions.

`"http://localhost:8332"`

**rpc_user**

String

Username for authenticating with the RPC node.

`"user"`

**rpc_pass**

String

Password for authenticating with the RPC node.

`"password"`

**rpc_timeout**

Integer

Timeout in seconds for RPC calls to the blockchain node.

`25`

**parse**

Boolean

Enables or disables parsing of blockchain data within the indexer. Typically true to allow extraction of addresses, amounts, and other metadata.

`true`

**message_queue_binding**

String

URI for the message queue broker used to bind and listen for blockchain events or synchronization messages.

`"tcp://localhost:28332"`

**subversion**

String

Optional field indicating the subversion string of the blockchain node; may be used for compatibility checks or logging.

`""` (empty in this config)

**address_format**

String

Defines the address format used by this blockchain (e.g., legacy, segwit, bech32). Empty string here indicates default or unspecified format.

`""`

**xpub_magic**

Integer

Magic bytes used to identify extended public keys (xpubs) for this blockchain, supporting HD wallet compatibility.

`49990397`

**slip44**

Integer

SLIP-44 coin type index, used in HD wallets to derive coin-specific keypaths.

`3` (Dogecoin's registered SLIP-44 index)

**mempool_workers**

Integer

Number of concurrent worker threads allocated for mempool transaction processing.

`8`

**mempool_sub_workers**

Integer

Number of sub-workers per mempool worker for further parallelization of mempool transaction handling.

2

**block_addresses_to_keep**

Integer

Number of recent blocks' addresses to keep cached for efficient querying and quick address balance calculations.

`300`


Usage and Examples

Loading Configuration in the Indexer

The indexer service loads `config.json` at startup to configure its runtime behavior. For example, in Node.js:

const fs = require('fs');

const config = JSON.parse(fs.readFileSync('config.json', 'utf8'));

console.log(`Connecting to RPC node at ${config.rpc_url} with user ${config.rpc_user}`);

Example: Configuring Fiat Rates Fetching

The indexer uses the `fiat_rates`, `fiat_rates_vs_currencies`, and `fiat_rates_params` to query CoinGecko every 900 seconds for Dogecoin price data:

"fiat_rates": "coingecko",
"fiat_rates_vs_currencies": "USD,EUR,BTC,ETH,...",
"fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"dogecoin\", \"periodSeconds\": 900}"

The indexer's fiat rate module parses `fiat_rates_params` into an object and schedules periodic HTTP GET requests to:

https://api.coingecko.com/api/v3/simple/price?ids=dogecoin&vs_currencies=USD,EUR,BTC,ETH,...

Important Implementation Details


Interaction with Other System Components


Visual Diagram: Configuration Structure Flowchart

flowchart TD
    Config[config.json]

    Config --> RPC[RPC Connection]
    Config --> Mempool[Mempool Workers]
    Config --> Cache[Cache Settings]
    Config --> FiatRates[Fiat Rates Integration]
    Config --> MsgQueue[Message Queue Binding]
    Config --> BlockchainParams[Blockchain Parameters]

    RPC -->|Uses| rpc_url
    RPC -->|Uses| rpc_user
    RPC -->|Uses| rpc_pass
    RPC -->|Uses| rpc_timeout

    Mempool -->|Controls| mempool_workers
    Mempool -->|Controls| mempool_sub_workers

    Cache -->|Defines| block_addresses_to_keep

    FiatRates -->|Provider| fiat_rates
    FiatRates -->|Currencies| fiat_rates_vs_currencies
    FiatRates -->|Params| fiat_rates_params

    MsgQueue -->|Binding URI| message_queue_binding

    BlockchainParams -->|Coin Info| coin_name
    BlockchainParams -->|Coin Symbol| coin_shortcut
    BlockchainParams -->|Coin Label| coin_label
    BlockchainParams -->|Address Format| address_format
    BlockchainParams -->|xpub Magic| xpub_magic
    BlockchainParams -->|SLIP44 Index| slip44

Summary

The `config.json` file is a foundational configuration artifact for the Dogecoin Blockbook Indexer, specifying how the indexer connects to blockchain nodes, processes mempool transactions, caches address data, and integrates external fiat currency rates. It also defines blockchain-specific parameters that ensure data is interpreted and served correctly downstream to API servers and clients.

The clarity and completeness of this configuration enable the indexer to efficiently and reliably index Dogecoin blockchain data, supporting fast queries, real-time event notifications, and enriched data views for end users.


End of Documentation for config.json