Configurations

Many of the chifra commands allow you to customize their behaviour through configuration files and/or environment variables. These options are documented here.

Environment variables

Each command-line option may be overridden by exporting an environment variable in your shell prior to running a chifra command.

The name of those environment variables is as follows:

  1. The environment variable beings with TB_
  2. The environment variable is ALL_UPPER_CASE
  3. The environment variable name removes underbars from the item_name (item_name becomes ITEMNAME)
  4. The environment variable name starts with the group the item belongs to

For example: TB_GROUP_ITEMNAME.

A more concrete example might be:

export TB_SETTINGS_RPCPROVIDER=http://localhost:9876
chifra blocks 100

which would cause chifra to use an alternate rpcProvider without having to edit the configuration file.

This feature comes in handy when build shell scripts to automate various tasks with chifra.

Where are configs stored?

The configuration files for chifra are stored in the operating system specific locations in the TrueBlocks folder.

Separate files

A single global configuration, called trueBlocks.toml, which stores all the configuration items, is located at the root of the configuration folder.

The remained of this documentation is incorrect. See the configuration file itself or the source code for more information.

Note: As of version 2.5.2, this is no longer true.

In addition, each individual tool may have its own configuration file with items peculuar to that tool. If a configuration item is found in a particular file, it applies only to that tool.

If, however, one of the items documented below under trueBlocks.toml is found in a tool’s individual config, it will override that value for that tool only.

For historical reasons, the configuration files are names based on old tool names. Please see the table below for the name of each tool’s config file.

Multichain

If you’re running against multiple chains, you may place any of these files in the root of the chain’s configuration folder, and the values found there will replace any values found at the top level. In this way, you may configure all chains for certain values, but customize your configuration per chain.

Configuration files

trueBlocks.toml (all tools)
Item Description / Default
[settings]
rpcProvider The RPC endpoint (required)
http://localhost:8545
cachePath Location of binary cache
$CONFIG/cache/
indexPath Location of unchained index
$CONFIG/unchained/
etherscan_key API key for Etherscan (optional)
empty
[dev]
debug_curl Increases log level for curl commands
false
All tools (in each file)
Item Description / Default
[display]
format Customizes default output of tool
empty
acctExport.toml for chifra export
Item Description / Default
[settings]
cache If true, queried transactions are cached
false
cache_traces If true, queried traces are cached
false
ether_rounding When doing reconciliations, round to this number of decimals places
18
start_when_deployed For smart contracts only, if true, start scan when contract is first deployed. If false, scan entire history (slower)
true
max_traces For any given transaction, limit number of traces to this number
250
skip_ddos Skip over 2016 dDos attacks
true
[display]
format Display format when exporting transactions (search source code)
STR_DISPLAY_TRANSACTION
receipt Display format when exporting receipts
STR_DISPLAY_RECEIPT
log Display format when exporting logs
STR_DISPLAY_LOG
trace Display format when exporting traces
STR_DISPLAY_TRACE
appearances Display format when exporting appearances
STR_DISPLAY_APPEARANCE
neighbor Display format when exporting neighbors
STR_DISPLAY_APPEARANCE
statement Display format when exporting statements
STR_DISPLAY_RECONCILIATION
[exclusions]
enabled If true, exclude addresses in list from extractions
false
list If [exclusions]enabled is true, exclude this list of addresses from extractions
empty
blockScrape.toml for chifra scrape

Configuration group: [settings]

Item Type Default Description / Default
[settings]
apps_per_chunk uint64 200000 the number of appearances to build into a chunk before consolidating it
snap_to_grid blknum 100000 an override to apps_per_chunk to snap-to-grid at every modulo of this value, this allows easier corrections to the index
first_snap blknum 0 the first block at which snap_to_grid is enabled
unripe_dist blknum 28 the distance (in blocks) from the front of the chain under which (inclusive) a block is considered unripe
channel_count uint64 20 number of concurrent processing channels
allow_missing bool false do not report errors for blockchains that contain blocks with zero addresses
chunkMan.toml for chifra chunks
Item Description / Default
[enabled]
download_manifest If true, download the index manifest prior to processing
true
getTraces.toml for chifra traces
Item Description / Default
[settings]
skip_ddos If true, skip over September 2016 dDos transactions
true
max If skip_ddos is true, this number of traces defines a ‘dDos’ transaction
250
ethslurp.toml for chifra slurp

See the source code for information on customizing this tool – this legacy code does not comply with other tools.

Other tools

The following tools are documented, but customizing them is not supported. If you change something here, and you break your installation, please don’t tell us we didn’t warn you.

testRunner.toml for testRunner
Item Description / Default
[settings]
api_provider The location of the API endpoint gotten from chifra daemon
http://localhost:8080
run_local If true, run tests labeled as local (most will fail)
false
json_pretty_print Post processor for API test cases (formats output to verify valid JSON production)
jq .
test_epoch The epoch to report in the performance testing tool - usually tracks current version
E-<VERSION_MINOR>
copy_path An alternate path to which to copy performance results
makeClass.toml for makeClass
Item Description / Default
[settings]
disabled If true, makeClass is enabled. Be warned – this will overwrite source code file if improperly configured
false
last_format The timestamp at date the makeClass formatter was run
0
[enabled]
auto_format If true, run the auto-formatter
false
generate If true, run the auto-code generator
false
readmes If true, generate README files with make generate
false

The follow values are defined for each classDefinition file

Item Description / Default
[settings]
class The name of the C++ class
fields The name of the file holding the field definitions for the class
includes The include files for the class’s header file
cpp_includes The include files for the class’s c++ file
sort If true, add sorting function to the class
equals If true, add equality function to the class
contained_by If present, the name of the class that contains items of this type
doc_producer The name of the chifra tool that produces this type of data
doc_group The documentation group this class belongs to
doc_descr The description of the class for the documentation
doc_route The command line tool and/or the API route
force_objget Some flag for some reason
false

Edit this page on GitHub