From 54b7dc94ed38708d9d5deb66a0563af83ab4827b Mon Sep 17 00:00:00 2001 From: Jordan Hrycaj Date: Tue, 5 Apr 2022 11:53:41 +0100 Subject: [PATCH] update scripts --- scripts/run-beacon-session.sh | 6 ++++- scripts/run-geth-session.sh | 1 + scripts/run-nimbus-session.sh | 42 ++++++++++++++++++++++------------- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/scripts/run-beacon-session.sh b/scripts/run-beacon-session.sh index 0dd7ecb..dc43b8c 100644 --- a/scripts/run-beacon-session.sh +++ b/scripts/run-beacon-session.sh @@ -45,13 +45,17 @@ num_backlogs=40 # Base directory for finding objects in the Beacon file system find_prefix="`dirname $0` . .. ../.." +find_prefix="$find_prefix ../nimbus-eth1" find_prefix="$find_prefix go-ethereum ../nethermind nimbus-eth1-blobs" find_prefix="$find_prefix ../go-ethereum ../nethermind ../nimbus-eth1-blobs" # Sub-find directory for various items find_beacon=". .. build/bin" find_yamlconf="merge-testnets/$name $name" -find_jwtsecret="datadir-geth-$name$instance datadir-$name$instance" +find_jwtsecret= +find_jwtsecret="$find_jwtsecret datadir-geth-$name$instance" +find_jwtsecret="$find_jwtsecret datadir-nimbus-$name" +find_jwtsecret="$find_jwtsecret datadir-$name$instance" # ------------------------------------------------------------------------------ # Helpers diff --git a/scripts/run-geth-session.sh b/scripts/run-geth-session.sh index 0c8c685..b408947 100644 --- a/scripts/run-geth-session.sh +++ b/scripts/run-geth-session.sh @@ -325,6 +325,7 @@ test yes != "$start" || ( umask 377 rm -f "$datadir/jwtsecret" { + echo 0x openssl rand -hex 32 # echo $session_key } | tr -d '\n' > "$datadir/jwtsecret" diff --git a/scripts/run-nimbus-session.sh b/scripts/run-nimbus-session.sh index 3b29ea0..d3076e4 100644 --- a/scripts/run-nimbus-session.sh +++ b/scripts/run-nimbus-session.sh @@ -12,7 +12,7 @@ port=${NIMBUS_SESSION_PORT:-30308} datadir=${NIMBUS_SESSION_DATADIR:-./datadir-nimbus-$name} # # Enable websockets, rpc, etc, -# exelayer=${NIMBUS_SESSION_EXELAYER:-no} +exelayer=${NIMBUS_SESSION_EXELAYER:-no} # Connect locally without discovery, static peer file as argument localpeer=${NIMBUS_SESSION_LOCALPEER} @@ -51,20 +51,22 @@ test -z "$localpeer" || { optargs="$optargs --nat=None" } -# # Run an Execution Layer Client (use the same ports as geth) -# test yes != "$exelayer" || { -# optargs="$optargs --ws=true" -# # optargs="$optargs --ws-port=8546" -# -# optargs="$optargs --rpc=true" -# # optargs="$optargs --rpc-port=8545" -# -# optargs="$optargs --engine-api=true" -# # optargs="$optargs --engine-api-port=8550" -# -# optargs="$optargs --engine-api-ws=true" -# # optargs="$optargs --engine-api-ws-port=8551" -# } +# Run an Execution Layer Client (using the same ports as geth) +test yes != "$exelayer" || { + optargs="$optargs --ws=true" + optargs="$optargs --ws-port=8551" # 8546 + + #optargs="$optargs --rpc=true" + #optargs="$optargs --rpc-port=8545" + + #optargs="$optargs --engine-api=true" + #optargs="$optargs --engine-api-port=8550" + + #optargs="$optargs --engine-api-ws=true" + #optargs="$optargs --engine-api-ws-port=8551" + + optargs="$optargs --jwt-secret=./jwtsecret" +} # ------------------------------------------------------------------------------ # Helpers @@ -303,6 +305,16 @@ test yes != "$start" || ( *) optargs="$optargs --network=$name" esac + # RPC authorisation seed, might not be needed though + test yes != "$exelayer" -o -s "$datadir/jwtsecret" || ( + umask 377 + rm -f "$datadir/jwtsecret" + { + echo 0x + openssl rand -hex 32 + # echo $session_key + } | tr -d '\n' > "$datadir/jwtsecret" + ) test yes != "$nohup" || { trap "echo '*** $self: NOHUP ignored'" HUP