From d75530e71830741749c9c8035be60da6af87b6a3 Mon Sep 17 00:00:00 2001 From: 0xFugue <119708655+0xFugue@users.noreply.github.com> Date: Thu, 29 Dec 2022 21:39:16 +0530 Subject: [PATCH] cleanup --- gen_jsons.sh | 45 ------------------------------------------- main.star | 41 --------------------------------------- run_kurtosis_tests.sh | 35 --------------------------------- 3 files changed, 121 deletions(-) delete mode 100755 gen_jsons.sh delete mode 100644 main.star delete mode 100755 run_kurtosis_tests.sh diff --git a/gen_jsons.sh b/gen_jsons.sh deleted file mode 100755 index 15e1042..0000000 --- a/gen_jsons.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -#MAX and MIN for topics and num nodes -MIN=5 -MAX=100 - -#requires bc -getrand(){ - orig=$(od -An -N1 -i /dev/urandom) - range=`echo "$MIN + ($orig % ($MAX - $MIN + 1))" | bc` - RANDOM=$range -} - -getrand1(){ - orig=$(od -An -N1 -i /dev/urandom) - range=`echo "$MIN + ($orig % ($MAX - $MIN + 1))" | bc` - return range - #getrand1 # call the fun and use the return value - #n=$? -} - -if [ "$#" -ne 2 ] || [ $2 -le 0 ] || ! [ -d "$1" ]; then - echo "usage: $0 <#json files needed>" >&2 - exit 1 -fi - -path=$1 -nfiles=$2 - -echo "Ok, will generate $nfiles networks & put them under '$path'." - -prefix=$path"/WakuNet_" -suffix=".json" - -for i in $(seq $nfiles) -do - getrand - n=$((RANDOM+1)) - getrand - t=$((RANDOM+1)) - fname=$prefix$i$suffix - nwtype="configuration_model" - $(./generate_network.py -n $n -t $t -T $nwtype -o $fname) - echo "#$i\tn=$n\tt=$t\tT=$nwtype\to=$fname" -done diff --git a/main.star b/main.star deleted file mode 100644 index 34ec34d..0000000 --- a/main.star +++ /dev/null @@ -1,41 +0,0 @@ -IMAGE_NAME = "statusteam/nim-waku:deploy-status-prod" - -# Waku RPC Port -RPC_PORT_ID = "rpc" -RPC_TCP_PORT = 8545 - -# Waku Matrics Port -PROMETHEUS_PORT_ID = "prometheus" -PROMETHEUS_TCP_PORT = 8008 - -GET_WAKU_INFO_METHOD = "get_waku_v2_debug_v1_info" -CONNECT_TO_PEER_METHOD = "post_waku_v2_admin_v1_peers" - -def run(args): - # in case u want to run each json separately, follow this cmd line arg format for main.star - #kurtosis run . --args '{"json_nw_name": "github.com/user/kurto-module/json_dir/abc.json"}' - json_loc=args.json_nw_name - file_contents = read_file(json_loc) - #print(file_contents) - decoded = json.decode(file_contents) - services ={} - - # Get up all waku nodes - for wakunode_name in decoded.keys(): - waku_service = add_service( - service_id=wakunode_name, - config=struct( - image=IMAGE_NAME, - ports={ - RPC_PORT_ID: struct(number=RPC_TCP_PORT, protocol="TCP"), - PROMETHEUS_PORT_ID: struct(number=PROMETHEUS_TCP_PORT, protocol="TCP") - }, - entrypoint=[ - "/usr/bin/wakunode", "--rpc-address=0.0.0.0", "--metrics-server-address=0.0.0.0" - ], - cmd=[ - "--topics='" + " ".join(decoded[wakunode_name]["topics"]) + "'", '--rpc-admin=true', '--keep-alive=true', '--metrics-server=true', - ] - ) - ) - services[wakunode_name] = waku_service diff --git a/run_kurtosis_tests.sh b/run_kurtosis_tests.sh deleted file mode 100755 index 3d316ac..0000000 --- a/run_kurtosis_tests.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -# -> symlink - ln -s source/dir . - -# step 0) -# symlink this script and the main.star to the root of ur kurtosis module. -# -# step 1) -# put the json files you want to run kurtosis in a directory -# -# step 2) -# copy that entire directory to the root of your kurtosis module -# !!! WARNING: symlinking the directory will NOT work !!! -# -# step 3) -# run this script in the kurtosis module root dir of ur module - - -if [ "$#" -ne 2 ] || ! [ -d "$1" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -path=$1 -repo=$2 -echo "Ok, will run kurtosis on all .json networks under '$path'." - -for json in "$path"/*.json -do - cmd="kurtosis run . --args '{\"json_nw_name\": \"$repo/$json\"}'" - echo $cmd - eval $cmd -done - -echo $repo, $path, "DONE!"