Advanced Blockchain Configuration
Depending on your requirements, Kaleido provides the ability to configure the following advanced settings for your environment/nodes. Note that these options are only available via the API at the moment. One or more of these options are only allowed if your organization is at a certain billing plan level.
Environment Configuration
These options must be set during environment creation and cannot be changed after the environment is created.
Chain ID
To configure a specific Chain ID for your environment, use the field chain_id
in the request body during environment creation.
API Reference: Create Environment
Block Period
To configure a block interval which will be used by all nodes in the environment, use the field block_period
during environment creation (available only for Enterprise plan organizations).
API Reference: Create Environment
See below for a summary of configurable block periods for each protocol selection:
Block Period Min (seconds) | Block Period Max (seconds) | |
---|---|---|
Quorum | 2(IBFT) | 20(IBFT) |
Besu | 5(PoA) 5(IBFT) | 10(PoA) 20(IBFT) |
Geth | 5 | 10 |
NOTE: IBFT 2 second block intervals requires an administrative action by the Kaleido ops team. Contact
support@kaleido.io
if you would like this configuration applied. Please note that block intervals can ONLY be defined during environment creation, as the specified configuration is hard-coded within your chain's genesis block.
Prefunded accounts
To configure one or more ethereum accounts with Ether balance in the genesis configuration, use the prefunded_accounts
field in the request body during environment creation. For such account addresses, Ether pool is generated and funded automatically in the genesis configuration.
"prefunded_accounts": {
"44a7eed471ce4b929ecb222b35bf993a0dd7ecc3": {
"balance": "1000000000000000000000000000"
},
"a8424e5df5280d861ade7d159c6fa0d2c128b22f": {
"balance": "400000000000000000000000"
},
},
Node Configuration
Kaleido provides the ability to create a configuration profile that includes Gas Price, Target Gas Limit, Garbage Collection Mode, Sync Mode, Log Verbosity, CORS Origin Hosts
at the environment level for each membership. A configuration profile can be assigned to a node at creation time for these settings to be applied. To apply a node configuration profile to an existing node, the node needs to be "reset" after applying the configuration profile.
API Reference: Create Node Configuration
Garbage Collection Mode
Use the field gc_mode
to configure garbage collection mode for the node.
-
archive - To create an archive node that retains complete historical state (disable state trie pruning), use this setting for
gc_mode
. This is applicable only if the node is created as alarge
node. The setting is ignored for Small/Medium-sized nodes -
full (default) - With this setting, state trie pruning is enabled, and only the latest 128 tries are kept in memory
Sync Mode
Use the field sync_mode
Blockchain sync mode for the node.
-
fast - Run the node in
fast sync
mode, in which transaction receipts and blocks are downloaded, and a recent state database are downloaded. Still, the entire blockchain transaction history is not replayed locally to reconstruct local state. Only the block header chain is verified locally for consistency/validity. The node retrieves and performs state trie processing for only a recent history of blocks (1024). Note:fast sync
is no longer supported in Geth environments on release version 1.0.63 or newer. We are in the process of adding support forsnap sync
to replace the previous usage offast sync
. -
full (default) - Downloads block headers, block bodies and validates all transactions by replaying state starting from the genesis block
-
light - Run the node as a 'light' client, which downloads only the block headers and fetches other parts of the blockchain on-demand
Log Level
Use the field geth_log_verbosity
to configure the log verbosity of the ethereum client.
- silent
- error
- info
- warn
- debug (default)
Gas Price
Use the field gas_price
to configure the minimum gas price below which the node will not accept any transactions submitted to it (default: 0
).
Target Gas Limit
Use the field target_gas_limit
to configure the artificial target gas floor for the blocks to mine (default: 804247552
).
CORS Origin Hosts
Use the field cors_origin_hosts
to configure a list of origins (as regular expressions) that are allowed to access RPC/WSS endpoints on nodes (default: '*'
). When specific origins are configured (other than *
), it may cause some features of the node "Connect" dashboard not to function as expected.
Below is an example JSON payload that is used to configure an archive
node with info
log verbosity:
https://console.kaleido.io/api/v1/consortia/{consortia_id}/environments/{environment_id}/configurations
{
"membership_id": "<membership_id>",
"name": "archive_node_config",
"type": "node_config",
"details": {
"geth_log_verbosity": "info",
"gc_mode": "archive"
},
}
Applying Node Configuration
The node configuration that is created as described above must be associated with a node for the node to inherit the configuration parameters.
- To attach a node configuration during node creation, use the parameter
node_config_id
and specify the ID of the node configuration profile in the API request to create a node
API Reference: Create Node
- To attach a node configuration after node creation, update the node to attach a
node_config_id
and then reset the node for the changes to affect the node runtime. This step reboots a running node and results in a downtime for the node.
API Reference: Update Node
API Reference: Reset Node