diff --git a/main.star b/main.star index df1e291..ada0fd0 100755 --- a/main.star +++ b/main.star @@ -1,13 +1,21 @@ DEFAULT_CONFIG_FILE = "github.com/logos-co/wadoku/waku/config.json" +DEFAULT_RUN_PAIR = "lf" + def get_config_file(args): return DEFAULT_CONFIG_FILE if not hasattr(args, "config") else args.config +def get_run_pair(args): + return DEFAULT_RUN_PAIR if not hasattr(args, "run_pair") else args.run_pair + + def run(args): print(args) config_file = get_config_file(args) + run_pair = get_run_pair(args) print("Reading the config from: %s" %config_file) + print("The runpair is %s" %run_pair) config_json = read_file(src=config_file) config = json.decode(config_json) @@ -19,7 +27,10 @@ def run(args): ctopic = config['content_topic'] print(config) - waku_filtr = add_service( + + if run_pair == "lf": # run lightpush and filter + + waku_filtr = add_service( service_id = "waku-filter", config = struct( image = "waku-filter:alpha", @@ -30,8 +41,8 @@ def run(args): "-l=" + loglvl, "-i=" + iat ], ), - ) - waku_lpush = add_service( + ) + waku_lpush = add_service( service_id = "waku-lightpush", config = struct( image = "waku-lightpush:alpha", @@ -42,7 +53,33 @@ def run(args): "-l=" + loglvl, "-i=" + iat ], ), - ) + ) + print(waku_filtr, waku_lpush) - print(waku_filtr, waku_lpush) + else: # run waku publish and subscribe + waku_sub = add_service( + service_id = "waku-subscribe", + config = struct( + image = "waku-subscribe:alpha", + entrypoint= ["/go/bin/waku-subscribe"], + cmd = [ "-o=" + "/go/bin/out/subscribe.out", + "-d=" + duration, + "-c=" + ctopic, + "-l=" + loglvl, + "-i=" + iat ], + ), + ) + waku_pub = add_service( + service_id = "waku-publish", + config = struct( + image = "waku-publish:alpha", + entrypoint= ["/go/bin/waku-publish"], + cmd = [ "-o=" + "/go/bin/out/publish.out", + "-d=" + duration, + "-c=" + ctopic, + "-l=" + loglvl, + "-i=" + iat ], + ), + ) + print(waku_sub, waku_pub) diff --git a/run-waku.sh b/run-waku.sh index 77c6aaf..70258cd 100755 --- a/run-waku.sh +++ b/run-waku.sh @@ -1,13 +1,24 @@ #!/bin/sh usage(){ - echo "Usage: ./run.sh < clean | metal | docker | kurtosis>" + echo "Usage: ./run.sh