Configuring Iroha
Local peer configuration is set via Environment and/or TOML files. Note that this is different from On-Chain Configuration set via SetParameter
instruction (TODO refer to ISI reference).
Use --config
CLI argument to specify the path to the configuration file.
Template
For a detailed description of each parameter, please refer to the Parameters reference.
peer.template.toml
## For the full reference, go to (TODO put link)
## You can use another TOML file to extend from.
## For a single file extension:
# extends = "./base.toml"
## Or, for a chain of extensions:
# extends = ["base-1.toml", "base-2.toml"]
# chain =
# public_key =
# private_key =
# trusted_peers =
[genesis]
# public_key =
# file =
[network]
# address =
# block_gossip_period_ms = 10_000
# block_gossip_size = 4
# transaction_gossip_period_ms = 1_000
# transaction_gossip_size = 500
# idle_timeout_ms = 60_000
[torii]
# address =
# max_content_len = 16_000_000
# query_idle_time_ms = 30_000
# query_store_capacity = 128
# query_store_capacity_per_user = 128
[kura]
# init_mode = "strict"
# store_dir = "./storage"
# blocks_in_memory = 128
[logger]
# level = "INFO"
# format = "full"
## Transactions Queue
[queue]
# capacity = 65536
# capacity_per_user = 65536
# transaction_time_to_live_ms = 86_400_000 # 1 day
[snapshot]
# mode = "read_write"
# create_every_ms = 60_000
# store_dir = "./storage/snapshot"
[telemetry]
# name =
# url =
# min_retry_period_ms = 1_000
# max_retry_delay_exponent = 4
[dev_telemetry]
## A path to a file with JSON logs
# out_file = "./dev_telemetry.json"
Composing configuration files
TOML configuration files has an additional extends
field, pointing to other TOML file(s). It could be a single path or multiple paths:Example format:
extends = "single-path.toml"
extends = ["file1.toml", "file2.toml"]
Iroha will recursively read all files specified in extends
and compose them into layers, where latter ones overwrite previous ones on a parameter level. For example, if reading config.toml
:
extends = ["a.toml", "b.toml"]
[torii]
address = "0.0.0.0:8080"
chain_id = "whatever"
[torii]
address = "localhost:4000"
max_content_len = 2048
The resulting configuration will be chain_id
from a.toml
, max_content_len
from b.toml
, and torii.address
from config.toml
(overwrites b.toml
).
Troubleshooting
Pass --trace-config
CLI flag to see a trace of how configuration is read and parsed.