Skip to content

Commit 6853e96

Browse files
committed
Fixed bugs when running applications with specific network config
1 parent cedbebd commit 6853e96

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

examples/distributed/teleport/teleport-alice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def run_alice():
3535
("Alice", run_alice)
3636
]
3737
)
38-
network_cfg_path = Path() / "network-alice.json"
38+
network_cfg_path = Path(__file__).parent / "network-alice.json"
3939
raw_results = run_applications(
4040
apps, use_app_config=False, enable_logging=False, network_cfg=network_cfg_path.resolve()
4141
)

examples/distributed/teleport/teleport-bob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def run_bob():
2525
("Bob", run_bob)
2626
]
2727
)
28-
network_cfg_path = Path() / "network-alice.json"
28+
network_cfg_path = Path(__file__).parent / "network-alice.json"
2929
raw_results = run_applications(
3030
apps, use_app_config=False, enable_logging=False, network_cfg=network_cfg_path.resolve()
3131
)

simulaqron/run/run.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,18 @@ def check_sim_backend(sim_backend: SimBackend):
6767
assert has_module.main(sim_backend.value), f"To use {sim_backend} as backend you need to install the package"
6868

6969

70-
def run_sim_backend(node_names: List[str], sim_backend: SimBackend, network_config_file: str):
70+
def run_sim_backend(node_names: List[str], sim_backend: SimBackend, network_config_file: Optional[str]):
7171
logger.debug("Starting simulaqron sim_backend process with nodes %s", node_names)
7272
check_sim_backend(sim_backend)
7373
simulaqron_settings.sim_backend = sim_backend.value
74-
network = Network(name="default", nodes=node_names, network_config_file=network_config_file, force=True, new=True)
74+
new_network = False if network_config_file is None else True
75+
network = Network(
76+
name="default",
77+
nodes=node_names,
78+
network_config_file=network_config_file,
79+
force=True,
80+
new=new_network
81+
)
7582
network.start()
7683
return network
7784

0 commit comments

Comments
 (0)