Client Configuration
Let's look at the client configuration options.
Client configuration template
# chain =
## Might be set via `TORII_URL` env var
# torii_url =
[basic_auth]
# login =
# password =
[account]
# domain =
# public_key =
# private_key =
[transaction]
# time_to_live_ms = 100_000
# status_timeout_ms = 100_000
## Nonce is TODO describe what it is
# nonce = false
Generation
You can use kagami
to generate the default client configuration:
$ kagami config client > client-config.json
Public and Private Keys
The defaults/client.toml
client configuration file should contain the user's domain
and a pair of their cryptographic keys: public_key
and private_key
.
For details on cryptographic keys, see Public Key Cryptography.
User account
The ACCOUNT_ID
should be self-explanatory. The only thing you need to worry about is that the account must already exist in the blockchain. In other words, the account you provide here should already be registered.
Note
Iroha is case-sensitive, meaning that Alice@wonderland is different from alice@wonderland. It should go without saying that alice@wonderland is not the same as alice@looking_glass either, since these accounts belong to different domains, wonderland
and looking_glass
.
Basic Authentication Credentials
The idea of basic authentication credentials is to provide the access control using a web server with a reverse proxy like Nginx while these credentials are ignored by the Iroha peers.
The login and password will be filled by the client and used for the Authorization
HTTP header.
Use this style of configuration to provide the basic authentication credentials (login and password):
"BASIC_AUTH": {
"web_login": "mad_hatter",
"password": "ilovetea"
},
Iroha Public Addresses
TORII
is the module in charge of handling incoming and outgoing connections. For client configuration, you can set up two addresses: TORII_API_URL
and TORII_TELEMETRY_URL
.
TORII_API_URL
First, the TORII_API_URL
is the same as torii.address
in the peer configuration. This is the module responsible for handling incoming and outgoing connections. You should also add the prefix http://
or (preferably) https://
to the address. For example:
{
"TORII_API_URL": "http://127.0.0.1:8080"
}
Transaction Limits
You can specify the transaction limits that each transaction must adhere to: the maximum number of instructions and the maximum size of a WASM blob (in bytes). For example:
{
"max_instruction_number": 4096,
"max_wasm_size_bytes": 4194304
}
Transaction TTL and Timeout
Configure the time-to-live (TTL) for transactions and the timeout to wait for the status. Both values have to be provided in milliseconds. For example:
"TRANSACTION_TIME_TO_LIVE_MS": 100000,
"TRANSACTION_STATUS_TIMEOUT_MS": 15000,
Transaction Nonce
If you set ADD_TRANSACTION_NONCE
to true
, Iroha will create different hashes for transactions that occur repeatedly and simultaneously.