diff --git a/client-cmds/qlean-cmd.sh b/client-cmds/qlean-cmd.sh index 4ff639a..1bf270b 100644 --- a/client-cmds/qlean-cmd.sh +++ b/client-cmds/qlean-cmd.sh @@ -1,8 +1,24 @@ #!/bin/bash #-----------------------qlean setup---------------------- -node_binary= -node_docker= +# expects "qlean" submodule or symlink inside "lean-quickstart" root directory +# https://github.com/qdrvm/qlean-mini +node_binary="$scriptDir/qlean/build/src/executable/qlean \ + --modules-dir $scriptDir/qlean/build/src/modules \ + --genesis $configDir/config.yaml \ + --validator-registry-path $configDir/validators.yaml \ + --bootnodes $configDir/nodes.yaml \ + --data-dir $dataDir/$item \ + --node-id $item --node-key $configDir/$privKeyPath \ + --listen-addr /ip4/0.0.0.0/udp/$quicPort/quic-v1" + +node_docker="--platform linux/amd64 qdrvm/qlean-mini:3f121fc \ + --genesis /config/config.yaml \ + --validator-registry-path /config/validators.yaml \ + --bootnodes /config/nodes.yaml \ + --data-dir /data \ + --node-id $item --node-key /config/$privKeyPath \ + --listen-addr /ip4/0.0.0.0/udp/$quicPort/quic-v1" # choose either binary or docker -node_setup="docker" \ No newline at end of file +node_setup="docker" diff --git a/spin-node.sh b/spin-node.sh index c7baf20..274e37b 100755 --- a/spin-node.sh +++ b/spin-node.sh @@ -3,6 +3,9 @@ currentDir=$(pwd) scriptDir=$(dirname $0) +if [ "$scriptDir" == "." ]; then + scriptDir="$currentDir" +fi # 0. parse env and args source "$(dirname $0)/parse-env.sh" @@ -13,10 +16,7 @@ source "$(dirname $0)/set-up.sh" # should take config.yaml and validator-config.yaml and generate files # 1. nodes.yaml 2. validators.yaml 3. .key files for each of nodes -# 2. get the client cmds with args set -source "$scriptDir/$NETWORK_DIR/client_env.sh" - -# 3. collect the nodes that the user has asked us to spin and perform setup +# 2. collect the nodes that the user has asked us to spin and perform setup if [ "$validatorConfig" == "genesis_bootnode" ] || [ -z "$validatorConfig" ]; then validator_config_file="$configDir/validator-config.yaml" else @@ -46,13 +46,13 @@ then exit; fi; -# 4. run clients -mkdir $dataDir +# 3. run clients +mkdir -p $dataDir popupTerminalCmd="gnome-terminal --disable-factory --" for item in "${spin_nodes[@]}"; do # create and/or cleanup datadirs itemDataDir="$dataDir/$item" - mkdir $itemDataDir + mkdir -p $itemDataDir cmd="sudo rm -rf $itemDataDir/*" echo $cmd eval $cmd