Environment Chain Data Backups
Kaleido supports environment wide chain data backups. Chain Data backups can be automatically scheduled to take place 1-4 times per day. When a backup request is executed, backup files are generated and stored in a Kaleido managed S3 bucket along with any additional customer specific backup storage destinations. When a consortia member opts into this feature and registers their own backup destination. They will receieve all same chain data backup files as the rest of the members of the consortia, thus providing everyone in the environment the same chain data backup files.
Environment Chain Data Backups are supported for the following protocols:
- Geth
- Quorum
- Besu
Configure Chain Data Backups in Kaleido Console
- Log into the Kaleido Console and navigate to the Environment Settings page.
- Enable and Choose the backup frequency for your environment. Frequency options:
- Once a day
- Twice a day
- Three times a day
- Four times a day
-
Alternatively, to create an
Environment Backup
using API, refer to the following API Documentation. -
Note: If you are creating a new environment, an Environment backup configuration is created automatically but is disabled by default. You may use the
Patch
endpoint to update the Environment Backup Config. API Documenation. -
After selecting these options in the UI, the System monitor node will undergo a node reset to add the additional configurations to the runtime. If you are using the API to configure chain data backups, you will need to reset the system monitor node .
-
Subsequently, backup files are created based on the selected schedule and uploaded to the configured backup destinations. Whenever a backup occurs, the monitor node will be offline for the duration of the backup (it will be online when the files are being uploaded). This is because the Ethereum client running on the system monitor node has to be temporarily halted in order to gather an incremental chain data backup. In the console, the environment dashboard will provide an indication when a backup is in progress.
-
Because the Ethereum client is halted while the incremental chain data backup is gathered, certain services such as Block explorer and Ledger API will be unavailable for the duration of the backup
Note: The monitor node will reset everytime there is an update to the Enabled field on the Environment backup config.
- If a customer would like to see the history of the backup files created, one can click Download on the settings page which will provide a JSON file with a record of history of every backup file taken for that environment. This record of history will correspond to the backup files being sent to backup destinations.
{
"latest_backup": "2022-08-10T00:00:00.635Z",
"provider": "quorum",
"history": [
{
"file": "2022-08-09T18:00:00.295Z-block-0-100000.rlp",
"date": "2022-08-09T18:00:00.295Z",
"canonical_chain": true,
"raftSwapFile": false,
"start_block": {
"block": 0,
"hash": "0x76291f4f298c5e5f62dddeafd6cb1917974829624f5ac9ad07b1cd6be0a6093d",
"parent_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"end_block": {
"block": 100000,
"hash": "0xd721c6aae86cef2460c222885450fc438f33f78fe8be3cc81f4482b32a346569",
"parent_hash": "0xd108a7fdb62575e1e96684a548de7585a0a402ccac8efc42e64c834a710b69ca"
}
},
{
"file": "2022-08-09T18:00:00.336Z-block-100001-200001.rlp",
"date": "2022-08-09T18:00:00.336Z",
"canonical_chain": true,
"raftSwapFile": false,
"start_block": {
"block": 100001,
"hash": "0xd216fbd05b9ccfa8b394b0e391caa29e3aadda2214cf0265251a656d87ef2746",
"parent_hash": "0xd721c6aae86cef2460c222885450fc438f33f78fe8be3cc81f4482b32a346569"
},
"end_block": {
"block": 200001,
"hash": "0x113cb2f44a02ac68cebf6060134624d55c25c4fb083872a88c74025f1f44b3a0",
"parent_hash": "0xfdd3312a5e86335faf7acf1d245629f4f7c4ba14759e71594ed14e1ebb1f8661"
}
},
{
"file": "2022-08-09T18:00:00.397Z-block-200002-300002.rlp",
"date": "2022-08-09T18:00:00.397Z",
"canonical_chain": true,
"raftSwapFile": false,
"start_block": {
"block": 200002,
"hash": "0xe989ec95c780991832697772d7d5896bcb19e93b4f640d4036186647d15c21f6",
"parent_hash": "0x113cb2f44a02ac68cebf6060134624d55c25c4fb083872a88c74025f1f44b3a0"
},
"end_block": {
"block": 300002,
"hash": "0x18f46729767b85877b7312477b8bd8d737430084302c0f6c5863cffa92aea2bc",
"parent_hash": "0x89fa3a25cfca101cf364cc0610f795044370ea4031263902f5d9bb00c5e03769"
}
},
-
This file will contain meta data about each backup file, including exactly which block numbers are include in each file, along with their corresponding hash and parent_hash. This meta data is used to keep a record of history of all backup files containing chain data from block 0 to the end of the chain.
-
Each Backup file is created with a start and end block using the commands linked below.
-
The start block is calculated based on the latest backup file end block + 1. The proposed start block's parent hash is compared to the latest file hash to ensure continuity with all the backup files over the entire blockchain.
-
The end block is calculated by starting with the monitor node's block height. Then all validator nodes in the environment are asked to confirm the hash of said block. If all agree, then that block is the new end block for that backup request. Otherwise, the backup algorithm will walk back blocks repeating the process until there is a consensus on the hash for the end block. All this effort is done to ensure that each backup file that is taken contains the canonical blockchain for the environment.
-
Each backup file is generated using protocol
export
commands with links below:
Configure backup configuration for Automated Chain Data backups
- Follow the steps to create a backup configuration here Backup Configuration Guide
- In order for a backup configuration to be enabled to receive automated chain data backups, select Environment Backup Target
- If Chain Data Backups have previously been enabled for an environment before adding an enabled backup configuration, the backup configuration will receive all previous backup files along with any new/future backup files that are created. If at a later time, you would like the configured backup destination to stop receiving chain data files, disable the Environment Backup Target flag on the config.