Changed main to be functional again

This commit is contained in:
Alberto Soutullo 2023-01-18 15:05:44 +01:00
parent 9479746c73
commit 861bb2fe91
2 changed files with 9 additions and 23 deletions

View File

@ -16,31 +16,20 @@ def run(args):
config_json = read_file(src=config_file)
config = json.decode(config_json)
# # Setup Gennet & generate topology
gennet_service = gennet.init(config['num_nodes'], config['num_topics'], config['node_type'], config['max_packet_size'], config['inter_msg_type'], config['dist_type'], config['emitters_fraction'])
# Copy the topology from the service
topology_artifact = plan.store_service_files(
# Gennet Service Id
service_id = "example-service-id",
src = "/gennet/topology",
name = "topology-artifact-id",
)
# 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)
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
# same_toml_configuration = config['same_toml_configuration']
# waku_services = waku.instantiate_waku_nodes(waku_topology, same_toml_configuration)
same_toml_configuration = config['same_toml_configuration']
waku_services = waku.instantiate_waku_nodes(waku_topology, same_toml_configuration)
# # Set up prometheus + grafana
# prometheus_service = prometheus.set_up_prometheus(waku_services)
# grafana_service = grafana.set_up_grafana(prometheus_service)
prometheus_service = prometheus.set_up_prometheus(waku_services)
grafana_service = grafana.set_up_grafana(prometheus_service)
# waku.interconnect_waku_nodes(waku_topology, waku_services)
waku.interconnect_waku_nodes(waku_topology, waku_services)
# # Setup WSL & Start the Simulation
# wsl_service = wsl.init(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'])
wsl_service = wsl.init(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'])

View File

@ -88,9 +88,6 @@ DEFAULT_TOPOLOGY_FILE_DEFAULT_ARGUMENT_VALUE = "waku_test_topology_small.json"
TOPOLOGIES_LOCATION = "github.com/logos-co/wakurtosis/config/network_topology/"
DEFAULT_TOPOLOGY_FILE = "network_data.json"
NUMBER_TEST_MESSAGES = 50
DELAY_BETWEEN_TEST_MESSAGE = "0.5"
# Default Simulation Parameters
SIMULATION_TIME = 300
MESSAGE_RATE = 25