26 lines
933 B
Python
Raw Normal View History

2023-11-01 14:02:29 +02:00
import os
2023-11-03 17:01:00 +02:00
from dotenv import load_dotenv
2023-11-01 14:02:29 +02:00
2023-11-03 17:01:00 +02:00
load_dotenv() # This will load environment variables from a .env file if it exists
2023-11-01 14:02:29 +02:00
2023-11-03 17:01:00 +02:00
def get_env_var(var_name, default=None):
2023-11-01 14:02:29 +02:00
env_var = os.getenv(var_name, default)
2023-11-03 17:01:00 +02:00
if env_var is not None:
print(f"{var_name}: {env_var}")
else:
print(f"{var_name} is not set; using default value: {default}")
2023-11-01 14:02:29 +02:00
return env_var
2023-11-01 16:44:42 +02:00
# Configuration constants. Need to be upercase to appear in reports
2023-11-03 17:01:00 +02:00
NODE_1 = get_env_var("NODE_1", "wakuorg/nwaku:latest")
2023-11-01 14:02:29 +02:00
NODE_2 = get_env_var("NODE_2", "wakuorg/go-waku:latest")
LOG_DIR = get_env_var("LOG_DIR", "./log")
NETWORK_NAME = get_env_var("NETWORK_NAME", "waku")
SUBNET = get_env_var("SUBNET", "172.18.0.0/16")
IP_RANGE = get_env_var("IP_RANGE", "172.18.0.0/24")
GATEWAY = get_env_var("GATEWAY", "172.18.0.1")
DEFAULT_PUBSUBTOPIC = get_env_var("DEFAULT_PUBSUBTOPIC", "/waku/2/default-waku/proto")
2023-11-03 17:01:00 +02:00
PROTOCOL = get_env_var("PROTOCOL", "REST")