Skip to main content

Toml format (old)

The default config.toml file should look like the following:


[cosmos]
modules = []
prefix = "cosmos"

[database]
host = "localhost"
max_idle_connections = 1
max_open_connections = 1
name = "database-name"
password = "password"
port = 5432
schema = "public"
ssl_mode = ""
user = "user"

[grpc]
address = "localhost:9090"
insecure = true

[logging]
format = "text"
level = "debug"

[parsing]
fast_sync = false
genesis_file_path = ""
listen_new_blocks = true
parse_genesis = true
parse_old_blocks = true
start_height = 1
workers = 1

[pruning]
interval = 10
keep_every = 500
keep_recent = 100

[rpc]
address = "http://localhost:26657"
client_name = "juno"
max_connections = 20

[telemetry]
enabled = false
port = 500

Let's see what each section refers to:

cosmos

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

AttributeTypeDescriptionExample
modulesarrayList of modules that should be enabled[ "auth", "bank", "distribution" ]
prefixstringBech 32 prefix of the addressescosmos

Supported modules

Currently, we support the followings Cosmos modules:

  • 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)
  • distribution to parse the x/distribution data
  • gov to parse the x/gox data
  • messages to parse the various messages inside a separate table
  • mint to parse the x/mint data
  • modules to get the list of enabled modules inside BDJuno
  • pricefeed to get the token prices
  • slashing to parse the x/slashing data
  • staking to parse the x/staking data
  • history to store historical data. This is currently limited to
    • historical price data, stored every time the price changes
    • historical account balance, which includes:
      • the available balance
      • the delegated amount
      • the delegation reward
      • the validator commission reward
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

pricefeed

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

The only field required in this section is the tokens field, which must be an array of objects, each one containing two fields:

  • 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 the various prices of the token, we will try and 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 at least a unit with a price_id 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.

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 endpointlocalhost:9090
insecurebooleanWhether the gRPC endpoint is insecure or notfalse

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

database

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

AttributeTypeDescriptionExample
hoststringHost where the database is foundlocalhost
portintegerPort to be used to connect to the PostgreSQL instance5432
namestringName of the database to which connect tobdjuno
userstringName of the user to use when connecting to the database. This user must have read/write access to all the database.bdjuno
passwordstringPassword to be used to connect to the database instancepassword
schemastringSchema to be used inside the database (default: public)public
ssl_modestringPostgreSQL SSL mode to be used when connecting to the database. If not set, disable will be used.verify-ca
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

pruning

This section contains the configuration about the pruning options of the database. Note that this will have an 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 Juno.

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

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