Migrate Configuration
...from 2.0.0-pre-rc.20
to the new format.
DANGER
This is an unstable document, Work in Progress.
Do the following:
- Update CLI and ENVs
- Use TOML for the config file
- Update parameters
CLI and Environment
Here, the After column contains all new supported environment variables. Environment variables aren't mentioned in the Before column were removed.
Before | After |
---|---|
IROHA2_CONFIG_PATH | removed, use --config instead |
IROHA2_GENESIS_PATH | GENESIS_FILE |
IROHA2_GENESIS_PATH | GENESIS_FILE |
IROHA_PUBLIC_KEY | PUBLIC_KEY |
IROHA_PRIVATE_KEY | split into PRIVATE_KEY_ALGORITHM and PRIVATE_KEY_PAYLOAD |
TORII_P2P_ADDR | P2P_ADDRESS |
IROHA_GENESIS_ACCOUNT_PUBLIC_KEY | GENESIS_PUBLIC_KEY |
IROHA_GENESIS_ACCOUNT_PRIVATE_KEY | split into GENESIS_PRIVATE_KEY_ALGORITHM and GENESIS_PRIVATE_KEY_PAYLOAD |
TORII_API_URL | API_ADDRESS |
KURA_INIT_MODE | same |
KURA_BLOCK_STORE_PATH | KURA_STORE_DIR |
KURA_DEBUG_OUTPUT_NEW_BLOCKS | same |
MAX_LOG_LEVEL | LOG_LEVEL |
COMPACT_MODE | removed, see LOG_FORMAT |
TERMINAL_COLORS | same, see --terminal-colors |
SNAPSHOT_CREATION_ENABLED | removed, see SNAPSHOT_MODE |
SNAPSHOT_DIR_PATH | SNAPSHOT_STORE_DIR |
SUMERAGI_TRUSTED_PEERS | same |
...all other ones | removed |
Configuration Parameters
- New mandatory parameter:
chain_id
List of all old parameters:
- Root parameters: see Base Params
PRIVATE_KEY
: becameprivate_key
; renamedigest_function
toalgorithm
PUBLIC_KEY
: becamepublic_key
: section removedBLOCK_SYNC
: removedACTOR_CHANNEL_CAPACITY
BLOCK_BATCH_SIZE
: becamenetwork.max_blocks_per_gossip
GOSSIP_PERIOD_MS
: becamenetwork.block_gossip_period
: removedDISABLE_PANIC_TERMINAL_COLORS
GENESIS
: see Genesis ParamsACCOUNT_PRIVATE_KEY
: becamegenesis.private_key
; renamedigest_function
toalgorithm
ACCOUNT_PUBLIC_KEY
: becamegenesis.public_key
KURA
: see Kura Params: removedACTOR_CHANNEL_CAPACITY
: removedBLOCKS_PER_STORAGE_FILE
BLOCK_STORE_PATH
: becamekura.store_dir
DEBUG_OUTPUT_NEW_BLOCKS
: becamekura.debug.output_new_blocks
INIT_MODE
: same, lowercase
LOGGER
: see Logger Params: removed; now might be enabled withCOMPACT_MODE
logger.format = "compact"
: removed; use STDOUT redirection instead and enable JSON format withLOG_FILE_PATH
logger.format = "json"
MAX_LOG_LEVEL
: becamelogger.log_level
: removedTELEMETRY_CAPACITY
: removed; useTERMINAL_COLORS
--terminal-colors
instead
NETWORK
: see Network Params, some parameters migrated here: removedACTOR_CHANNEL_CAPACITY
QUEUE
: see Queue ParamsFUTURE_THRESHOLD_MS
: becamequeue.future_threshold
MAX_TRANSACTIONS_IN_QUEUE
: becamequeue.capacity
MAX_TRANSACTIONS_IN_QUEUE_PER_USER
: becamequeue.capacity_per_user
TRANSACTION_TIME_TO_LIVE_MS
: becamequeue.transaction_time_to_live
SNAPSHOT
: see Snapshot ParamsCREATE_EVERY_MS
: becamesnapshot.create_every
CREATION_ENABLED
: removed in favour ofsnapshot.mode
; see the mapping:Before: creation_enabled
After: mode
false
read_write
true
readonly
DIR_PATH
: becamesnapshot.store_dir
SUMERAGI
: see Sumeragi Params: removedACTOR_CHANNEL_CAPACITY
: removed[1]BLOCK_TIME_MS
: removed[1:1]COMMIT_TIME_LIMIT_MS
GOSSIP_BATCH_SIZE
: becamenetwork.max_transactions_per_gossip
GOSSIP_PERIOD_MS
: becamenetwork.transaction_gossip_period
: removedKEY_PAIR
: removed[1:2]MAX_TRANSACTIONS_IN_BLOCK
: removedPEER_ID
TRUSTED_PEERS
: same, lowercase
TELEMETRY
: see Telemetry ParamsFILE
: becamedev_telemetry.out_file
(todo)MAX_RETRY_DELAY_EXPONENT
: same, lowercaseMIN_RETRY_PERIOD
: same, lowercaseNAME
: same, lowercaseURL
: same, lowercase
TORII
: see Torii ParamsAPI_URL
: becametorii.address
: removedFETCH_SIZE
MAX_CONTENT_LEN
: same, lowercase: removedMAX_TRANSACTION_SIZE
P2P_ADDR
: becamenetwork.address
QUERY_IDLE_TIME_MS
: becametorii.query_idle_time
: temporarily moved toWSV
chain_wide
section, but is going to be removed from the configuration entirely[1:3]
Example
Complete setup before:
shell
export IROHA2_CONFIG=./config.json
export IROHA2_GENESIS=./genesis.json
iroha --submit-genesis
json
{
"PUBLIC_KEY": "ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B",
"PRIVATE_KEY": {
"digest_function": "ed25519",
"payload": "282ED9F3CF92811C3818DBC4AE594ED59DC1A2F78E4241E31924E101D6B1FB831C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B"
},
"TORII": {
"API_URL": "127.0.0.1:8080",
"P2P_ADDR": "127.0.0.1:1337"
},
"GENESIS": {
"ACCOUNT_PUBLIC_KEY": "ed01203F4E3E98571B55514EDC5CCF7E53CA7509D89B2868E62921180A6F57C2F4E255",
"ACCOUNT_PRIVATE_KEY": {
"digest_function": "ed25519",
"payload": "038AE16B219DA35AA036335ED0A43C28A2CC737150112C78A7B8034B9D99C9023F4E3E98571B55514EDC5CCF7E53CA7509D89B2868E62921180A6F57C2F4E255"
}
},
"KURA": {
"BLOCK_STORE_PATH": "./storage"
}
}
Complete setup after:
shell
iroha --submit-genesis --config ./iroha.toml
toml
chain_id = "000"
public_key = "ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B"
private_key = { algorithm = "ed25519", payload = "282ED9F3CF92811C3818DBC4AE594ED59DC1A2F78E4241E31924E101D6B1FB831C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B" }
[network]
address = "127.0.0.1:1337"
[torii]
address = "127.0.0.1:8080"
[kura]
store_dir = "./storage"
[genesis]
public_key = "ed01203F4E3E98571B55514EDC5CCF7E53CA7509D89B2868E62921180A6F57C2F4E255"
private_key = { algorithm = "ed25519", payload = "038AE16B219DA35AA036335ED0A43C28A2CC737150112C78A7B8034B9D99C9023F4E3E98571B55514EDC5CCF7E53CA7509D89B2868E62921180A6F57C2F4E255" }
file = "./genesis.json"
See also
See Chain Wide Params. ↩︎ ↩︎ ↩︎ ↩︎