From 6f3546e96d0e11ff30185316889cb3343e58dfd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Mon, 22 Apr 2024 15:07:07 +0300 Subject: [PATCH] Fix operation mode. --- multiversx_sdk_cli/localnet/node_config_toml.py | 14 ++++++++++---- multiversx_sdk_cli/localnet/step_start.py | 3 +-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/multiversx_sdk_cli/localnet/node_config_toml.py b/multiversx_sdk_cli/localnet/node_config_toml.py index 6e5e5f20..75df47a7 100644 --- a/multiversx_sdk_cli/localnet/node_config_toml.py +++ b/multiversx_sdk_cli/localnet/node_config_toml.py @@ -7,10 +7,16 @@ def patch_config(data: ConfigDict, config: ConfigRoot): - general_settings: ConfigDict = dict() - general_settings['ChainID'] = CHAIN_ID - - data['GeneralSettings'].update(general_settings) + data['GeneralSettings']['ChainID'] = CHAIN_ID + + # "--operation-mode=historical-balances" is not available for nodes, + # since << validator cannot be a full archive node >>, + # but we attempt to set the "deep-history" mode as follows: + data['DbLookupExtensions']['Enabled'] = True + data['GeneralSettings']['StartInEpochEnabled'] = False + data['StateTriesConfig']['AccountsStatePruningEnabled'] = False + data['StoragePruning']['ObserverCleanOldEpochsData'] = False + data['StoragePruning']['AccountsTrieCleanOldEpochsData'] = False # Make epochs shorter epoch_start_config: ConfigDict = dict() diff --git a/multiversx_sdk_cli/localnet/step_start.py b/multiversx_sdk_cli/localnet/step_start.py index 575bb34e..c061aacf 100644 --- a/multiversx_sdk_cli/localnet/step_start.py +++ b/multiversx_sdk_cli/localnet/step_start.py @@ -75,8 +75,7 @@ async def do_start(configfile: Path, stop_after_seconds: int): "--log-save", f"--log-level={loglevel}", "--log-logger-name", - f"--rest-api-interface={validator.api_interface()}", - "--operation-mode=historical-balances" + f"--rest-api-interface={validator.api_interface()}" ], cwd=validator.folder, delay=NODES_START_DELAY)) # Proxy