Skip to main content

Yaml format

Here's an example of the config.yaml file:

chain:
bech32_prefix: cosmos
modules:
- modules
- messages
- auth
node:
type: remote
config:
rpc:
client_name: juno
address: http://localhost:26657
max_connections: 20
grpc:
address: http://localhost:9090
insecure: true
parsing:
workers: 1
listen_new_blocks: true
parse_old_blocks: true
parse_genesis: true
start_height: 1
fast_sync: true
genesis_file_path: [Path to the genesis file]
average_block_time: 3s
database:
url: postgres://user:password@localhost:5432/database-name?sslmode=disable&search_path=public
max_open_connections: 10
max_idle_connections: 10
partition_size: 100000
partition_batch: 1000
logging:
level: debug
format: text
telemetry:
port: 5000
pruning:
keep_recent: 100
keep_every: 500
interval: 10
pricefeed:
tokens:
- name: Atom
units:
- denom: uatom
exponent: 0
- denom: atom
exponent: 6
price_id: cosmos
- name: Photino
units:
- denom: uptn
exponent: 0
- denom: ptn
exponent: 6
actions:
port: 3000
Migrate from TOML file

If you previously ran bdjuno with a config.toml file, you can easily migrate to the new config.yaml file by running:

$ bdjuno migrate v2

A config.yaml file will be generated based on the existing config.toml file.

Let's see what each section refers to:

chain

This section contains the details of the chain configuration regarding the Cosmos SDK.

AttributeDescriptionExample
bech32_prefixBech 32 prefix of the addressescosmos
modulesList of modules that should be enabled- modules
- messages
- auth

Supported modules

Currently, we support the followings Cosmos modules:

  • modules to get the list of enabled modules inside BDJuno
  • messages to parse the various messages inside a separate table
  • auth to parse the x/auth data
  • bank to parse the x/bank data
  • consensus to parse the consensus data. This includes:
    • the genesis details
    • average block times (since genesis, in a day, in an hour, in a minute)
  • feegrant to parse the x/feegrant data
  • gov to parse the x/gox data
  • mint to parse the x/mint data
  • pricefeed to get the token price every 2 mins and store historical price data every 1 hour
  • slashing to parse the x/slashing data
  • staking to parse the x/staking data
  • distribution to parse the x/distribution data
  • upgrade to parse the x/upgrade data and handle software upgrades
  • wasm to parse the x/wasm data
  • actions to support Hasura Actions
  • daily refetch to refetch missing blocks in database every day
Module order

When listing the different modules to be used, please note that there is some order that must be respected. In particular:

  • modules should be listed before every other module
  • messages should be listed after the modules module and before every other module
  • distribution must be listed after the staking module

node

This section defines from which source bdjuno will parse the data.

AttributeDescriptionExample
typeRead from a running node, or from the chain's db of the local machineremote or local
configConfig according to the node typeexample

Node Config

rpc

This section contains the details of the chain RPC to which BDJuno will connect.

AttributeTypeDescriptionExample
addressstringAddress of the RPC endpointhttp://localhost:26657
client_namestringClient name used when subscribing to the Tendermint websocketbdjuno
max_connectionsintMax number of connections that can created towards the RPC node (any value less or equal to 0 means to use the default one instead)20

grpc

This section contains the details of the gRPC endpoint that BDJuno will use to query the data.

AttributeTypeDescriptionExample
addressstringAddress of the gRPC endpointhttps://0.0.0.1:9090
insecurebooleanWhether the gRPC endpoint is insecure or notfalse

Node config example

# node type : remote, BDjuno is set to read from a running node
node:
type: remote
config:
rpc:
client_name: juno
address: http://localhost:26657
max_connections: 20
grpc:
address: http://localhost:9090
insecure: true

# node type : local, BDjuno is set to read from the chain's database of a static node
node:
type: local
config:
home: path/to/.desmos
Node Type

If you encounter the error ERROR: failed to start client: failed to initialize database: resource temporarily unavailable , you might want to make sure the node.type is set to remote which tells BDjuno to read from a running node, instead of the static chain's DB.

pricefeed

This section contains the data used by the pricefeed to fetch token prices using the CoinGecko APIs.

The only field required in this section is the tokens field which contains two subfields:

  • name represents the human-readable name of the token
  • units contains a list of token units, each of them having the following attributes:
    • denom
    • exponent
    • (optional) aliases
    • (optional) price_id
Provide a valid price_id

When fetching token prices, BDJuno will search for prices based on the price_id of the units that you provide. For this reason, you need to make sure that you provide the correct price_id value that is listed inside the CoinGecko coins list API.

E.g. If you have a token that is named MyToken and is listed inside CoinGecko with the ticker $MTKN and id mytoken, make sure you specify a token unit having denom = "mtkn", price_id = "mytoken" and exponent = 6 (or whatever amount of decimal places your token unit has inside your chain). This will make sure the price is always fetched correctly.

parsing

AttributeTypeDescriptionExample
listen_new_blocksbooleanWhether BDJuno should parse new blocks as soon as they get createdtrue
parse_genesisbooleanWhether BDJuno needs to parse the genesis state or nottrue
parse_old_blocksbooleanWhether BDJuno should parse old chain blocks or nottrue
start_heightintegerHeight at which BDJuno should start parsing old blocks250000
workersintegerNumber of works that will be used to fetch the data and store it inside the database5
average_block_timetimeThe average block time for setting the frequency of querying new block heights. Default is 3 seconds.3s

database

This section contains all the different configurations related to the PostgreSQL database where BDJuno will write the data.

AttributeTypeDescriptionExample
urlstringPostgreSQL database URLpostgres://user:password@localhost:5432/bdjuno?sslmode=disable&search_path=public
max_idle_connectionsintegerMax number of idle connections that should be kept open (default: 1)10
max_open_connectionsintegerMax number of open connections at any time (default: 1)15
partition_sizeintegerPostgreSQL table partition height interval (since v3.0.0)100000
partition_batchintegerMax number of transaction rows to migrate in each batch (since v3.0.0)1000

pruning

This section contains the configuration about the pruning options of the database. Note that this will have effect only if you add the "pruning" entry to the modules field of the cosmos config.

AttributeTypeDescriptionExample
intervalintegerNumber of blocks that should pass between one pruning and the other (default: prune every 10 blocks)100
keep_everyintegerKeep the state every nth block, even if it should have been pruned500
keep_recentintegerDo not prune this amount of recent states100

logging

This section allows to configure the logging details of BDJuno.

AttributeTypeDescriptionExample
formatstringFormat in which the logs should be output (either json or text)json
levelstringLevel of the log (either verbose, debug, info, warn or error)error

telemetry

This section allows to configure the telemetry details of BDJuno.

AttributeTypeDescriptionExample
enabledboolWhether the telemetry should be enabled or notfalse
portuintPort on which the telemetry server will listen8000
tip

If telemetry server is enabled, a new endpoint at the provided port and path /metrics will expose Prometheus data.

actions

This section allows to configure Hasura Actions.

AttributeTypeDescriptionExample
portuintPort on which the hasura actions service will run3000
node (optional)node detailsRPC & gRPC address on which the hasura actions service will listen. If not configured, it will listen to the addresses in the node config section.example

Actions Node Example

actions:
port: 3000
node:
rpc:
address: http://localhost:26657
grpc:
address: http://localhost:9090
insecure: true