Skip to content

Commit

Permalink
Restore the ability to test the Web3Signer (don't enable it in CI yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
zah committed Jun 2, 2023
1 parent ee71b6c commit e6ed11f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion scripts/launch_local_testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ DL_GETH="0"
#NIMBUS EL VARS
RUN_NIMBUS_ETH1="0"
: ${NIMBUS_ETH1_BINARY:="./build/downloads/nimbus$EXE_EXTENSION"}
: ${WEB3SIGNER_VERSION:=22.11.0}
: ${WEB3SIGNER_VERSION:=23.1.0}
: ${WEB3SIGNER_DIR:="${BUILD_DIR}/downloads/web3signer-${WEB3SIGNER_VERSION}"}
: ${WEB3SIGNER_BINARY:="${WEB3SIGNER_DIR}/bin/web3signer$BAT_EXTENSION"}
: ${SIGNER_NODES:=0}
Expand Down
14 changes: 7 additions & 7 deletions scripts/signers/custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ SIGNER_NODE_IDX=$1
# These directories store the keystores and secrets generated by the
# simulation script. These are either full validator keys or partial
# validator keys depending on the `--signer-nodes` parameter (see above).
local secrets_dir="${DATA_DIR}/secrets_shares/$((SIGNER_NODE_IDX + 1))"
local keystores_dir="${DATA_DIR}/validators_shares/$((SIGNER_NODE_IDX + 1))"
SECRETS_DIR="${DATA_DIR}/secrets_shares/$((SIGNER_NODE_IDX + 1))"
KEYSTORES_DIR="${DATA_DIR}/validators_shares/$((SIGNER_NODE_IDX + 1))"

# You can re-arrange the keystore files to match the layout expected by
# your signer. The example below demonstrates how this is done when working
# with the Consensys Web3Signer:
#
# for validator_pubkey in $(ls "$secrets_dir")
# for validator_pubkey in $(ls "$SECRETS_DIR")
# do
# mv "$secrets_dir/$validator_pubkey" "$secrets_dir/$validator_pubkey.txt"
# mv "$keystores_dir/$validator_pubkey/keystore.json" "$keystores_dir/$validator_pubkey.json"
# mv "$SECRETS_DIR/$validator_pubkey" "$SECRETS_DIR/$validator_pubkey.txt"
# mv "$KEYSTORES_DIR/$validator_pubkey/keystore.json" "$KEYSTORES_DIR/$validator_pubkey.json"
# done

# Here you need to launch your signer server process.
Expand All @@ -45,8 +45,8 @@ local keystores_dir="${DATA_DIR}/validators_shares/$((SIGNER_NODE_IDX + 1))"
# --metrics-port=$(( BASE_REMOTE_SIGNER_METRICS_PORT + SIGNER_NODE_IDX )) \
# eth2 \
# --slashing-protection-enabled=false \
# --keystores-passwords-path="${secrets_dir}" \
# --keystores-path="${keystores_dir}" \
# --keystores-passwords-path="${SECRETS_DIR}" \
# --keystores-path="${KEYSTORES_DIR}" \
# --network="${RUNTIME_CONFIG_FILE}" &> "${DATA_DIR}/web3signer.log" &

# Finally, you must write the PIDs of any created processes in the `pids` directory
Expand Down
14 changes: 7 additions & 7 deletions scripts/signers/web3signer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ fi

WEB3SIGNER_NODE_IDX=$1

local secrets_dir="${DATA_DIR}/secrets_shares/$((WEB3SIGNER_NODE_IDX + 1))"
local keystores_dir="${DATA_DIR}/validators_shares/$((WEB3SIGNER_NODE_IDX + 1))"
SECRETS_DIR="${DATA_DIR}/secrets_shares/$((WEB3SIGNER_NODE_IDX + 1))"
KEYSTORES_DIR="${DATA_DIR}/validators_shares/$((WEB3SIGNER_NODE_IDX + 1))"

# We re-arrange the keystore files to match the layout expected by the Web3Signer
# TODO generateSimulationDeposits can be refactored to produce the right layout from the start
for validator_pubkey in $(ls "$secrets_dir")
for validator_pubkey in $(ls "$SECRETS_DIR")
do
mv "$secrets_dir/$validator_pubkey" "$secrets_dir/$validator_pubkey.txt"
mv "$keystores_dir/$validator_pubkey/keystore.json" "$keystores_dir/$validator_pubkey.json"
mv "$SECRETS_DIR/$validator_pubkey" "$SECRETS_DIR/$validator_pubkey.txt"
mv "$KEYSTORES_DIR/$validator_pubkey/keystore.json" "$KEYSTORES_DIR/$validator_pubkey.json"
done

# still participate in set -e, ideally
Expand All @@ -40,8 +40,8 @@ done
--metrics-port=$(( BASE_REMOTE_SIGNER_METRICS_PORT + WEB3SIGNER_NODE_IDX )) \
eth2 \
--slashing-protection-enabled=false \
--keystores-passwords-path="${secrets_dir}" \
--keystores-path="${keystores_dir}" \
--keystores-passwords-path="${SECRETS_DIR}" \
--keystores-path="${KEYSTORES_DIR}" \
--network="${RUNTIME_CONFIG_FILE}" &> "${DATA_DIR}/logs/web3signer.${WEB3SIGNER_NODE_IDX}.log" &

echo $! > "${DATA_DIR}/pids/web3signer.${WEB3SIGNER_NODE_IDX}"

0 comments on commit e6ed11f

Please sign in to comment.