Skip to content

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.

BeforeAfter
IROHA2_CONFIG_PATHremoved, use --config instead
IROHA2_GENESIS_PATHGENESIS_FILE
IROHA2_GENESIS_PATHGENESIS_FILE
IROHA_PUBLIC_KEYPUBLIC_KEY
IROHA_PRIVATE_KEYsplit into PRIVATE_KEY_ALGORITHM and PRIVATE_KEY_PAYLOAD
TORII_P2P_ADDRP2P_ADDRESS
IROHA_GENESIS_ACCOUNT_PUBLIC_KEYGENESIS_PUBLIC_KEY
IROHA_GENESIS_ACCOUNT_PRIVATE_KEYsplit into GENESIS_PRIVATE_KEY_ALGORITHM and GENESIS_PRIVATE_KEY_PAYLOAD
TORII_API_URLAPI_ADDRESS
KURA_INIT_MODEsame
KURA_BLOCK_STORE_PATHKURA_STORE_DIR
KURA_DEBUG_OUTPUT_NEW_BLOCKSsame
MAX_LOG_LEVELLOG_LEVEL
COMPACT_MODEremoved, see LOG_FORMAT
TERMINAL_COLORSsame, see --terminal-colors
SNAPSHOT_CREATION_ENABLEDremoved, see SNAPSHOT_MODE
SNAPSHOT_DIR_PATHSNAPSHOT_STORE_DIR
SUMERAGI_TRUSTED_PEERSsame
...all other onesremoved

Configuration Parameters

List of all old parameters:

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


  1. See Chain Wide Params. ↩︎ ↩︎ ↩︎ ↩︎