wakurtosis/main.star

35 lines
1.6 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)
def run(args):
# Load global config file
2023-01-11 20:13:34 +00:00
config_file = args_parser.get_configuration_file_name(args)
config_json = read_file(src=config_file)
config = json.decode(config_json)
same_toml_configuration = config['same_toml_configuration']
# Load network topology
# waku_topology_json = read_file(src=system_variables.TOPOLOGIES_LOCATION + 'network_data.json')
waku_topology_json = read_file(src="github.com/logos-co/wakurtosis/" + config['topology_path'] + 'network_data.json')
waku_topology = json.decode(waku_topology_json)
# Set up nodes
waku_services = waku.instantiate_waku_nodes(waku_topology, same_toml_configuration)
2023-01-11 20:13:34 +00:00
# Set up prometheus + grafana
prometheus_service = prometheus.set_up_prometheus(waku_services)
2023-01-11 20:13:34 +00:00
grafana_service = grafana.set_up_grafana(prometheus_service)
2022-12-01 16:38:36 +00:00
waku.interconnect_waku_nodes(waku_topology, waku_services)
# Setup WSL & Start the Simulation
2023-01-06 17:01:43 +00:00
wsl_service = wsl.set_up_wsl(waku_services, config['simulation_time'], config['message_rate'], config['min_packet_size'], config['max_packet_size'], config['inter_msg_type'], config['dist_type'], config['emitters_fraction'])