wakurtosis/main.star

40 lines
1.4 KiB
Plaintext
Raw Normal View History

# System Imports
system_variables = import_module("github.com/logos-co/wakurtosis/src/system_variables.star")
2022-12-01 16:38:36 +00:00
# Module Imports
waku = import_module(system_variables.WAKU_MODULE)
prometheus = import_module(system_variables.PROMETHEUS_MODULE)
grafana = import_module(system_variables.GRAFANA_MODULE)
args_parser = import_module(system_variables.ARGUMENT_PARSER_MODULE)
2022-12-28 10:09:29 +00:00
wsl = import_module(system_variables.WSL_MODULE)
nodes = import_module(system_variables.NODE_BUILDERS_MODULE)
2023-01-19 18:26:34 +00:00
def run(plan, args):
# Load global config file
2023-01-19 18:26:34 +00:00
config_file = args_parser.get_configuration_file_name(plan, args)
config_json = read_file(src=config_file)
config = json.decode(config_json)
2023-01-19 18:26:34 +00:00
kurtosis_config = config['kurtosis']
wsl_config = config['wsl']
same_toml_configuration = kurtosis_config['same_toml_configuration']
# Load network topology
2023-01-18 14:05:44 +00:00
waku_topology_json = read_file(src=system_variables.TOPOLOGIES_LOCATION + 'network_data.json')
waku_topology = json.decode(waku_topology_json)
# Set up nodes
2023-01-19 18:26:34 +00:00
services = nodes.instantiate_services(plan, waku_topology, same_toml_configuration)
# Set up prometheus + graphana
2023-01-19 18:26:34 +00:00
prometheus_service = prometheus.set_up_prometheus(plan, services)
grafana_service = grafana.set_up_grafana(plan, prometheus_service)
2022-12-01 16:38:36 +00:00
2023-01-19 18:26:34 +00:00
waku.interconnect_waku_nodes(plan, waku_topology, services)
2023-01-16 14:01:43 +00:00
# # Setup WSL & Start the Simulation
2023-01-19 18:26:34 +00:00
wsl_service = wsl.init(plan, services, wsl_config)