1313from multiversx_sdk_cli .localnet .config_root import ConfigRoot
1414from multiversx_sdk_cli .localnet .constants import \
1515 NETWORK_MONITORING_INTERVAL_IN_SECONDS
16+ from multiversx_sdk_cli .localnet .step_config import \
17+ copy_binaries_into_localnet_workspace
1618
1719logger = logging .getLogger ("localnet" )
1820
@@ -38,6 +40,17 @@ def start(configfile: Path, stop_after_seconds: int):
3840async def do_start (configfile : Path , stop_after_seconds : int ):
3941 config = ConfigRoot .from_file (configfile )
4042
43+ logger .info ("Copy (overwrite) binaries, in case they've changed between restarts." )
44+
45+ try :
46+ # Do this on a best-effort basis.
47+ # Though useful (e.g. when the developer is using "resolution" = "local" and works with the Protocol itself),
48+ # this step is not strictly necessary, and might even fail in some cases
49+ # (e.g. when localnet is embedded in a Docker container and some cleanup procedures are performed upon setting up the localnet).
50+ copy_binaries_into_localnet_workspace (config )
51+ except Exception as e :
52+ logger .warning (f"Error while copying binaries: { e } " )
53+
4154 display_api_table (config )
4255
4356 logger .info ('Localnet folder is %s' , config .root ())
@@ -62,6 +75,7 @@ async def do_start(configfile: Path, stop_after_seconds: int):
6275 "--log-save" ,
6376 f"--log-level={ loglevel } " ,
6477 "--log-logger-name" ,
78+ "--log-correlation" ,
6579 f"--destination-shard-as-observer={ observer .shard } " ,
6680 f"--rest-api-interface={ observer .api_interface ()} " ,
6781 "--operation-mode=historical-balances"
@@ -75,6 +89,7 @@ async def do_start(configfile: Path, stop_after_seconds: int):
7589 "--log-save" ,
7690 f"--log-level={ loglevel } " ,
7791 "--log-logger-name" ,
92+ "--log-correlation" ,
7893 f"--rest-api-interface={ validator .api_interface ()} "
7994 ], cwd = validator .folder , delay = NODES_START_DELAY ))
8095
0 commit comments