This commit is contained in:
0xFugue 2022-12-29 21:39:16 +05:30
parent 6e96757d10
commit d75530e718
3 changed files with 0 additions and 121 deletions

View File

@ -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 <output dir> <#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

View File

@ -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

View File

@ -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 <input dir> <repo prefix>" >&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!"