Skip to content

Commit

Permalink
Prysm persist w3s keys loaded via keymanager (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne authored Aug 31, 2024
1 parent 197d42b commit 04a95c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Eth Docker uses a "semver-ish" scheme.
large.
- Second through fourth digit, [semver](https://semver.org/).

This is Eth Docker v2.12.1.0
This is Eth Docker v2.12.2.0
8 changes: 7 additions & 1 deletion prysm/docker-entrypoint-vc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ fi

# Web3signer URL
if [ "${WEB3SIGNER}" = "true" ]; then
__w3s_url="--validators-external-signer-url http://web3signer:9000 --validators-external-signer-public-keys http://web3signer:9000/api/v1/eth2/publicKeys"
__w3s_url="--validators-external-signer-url http://web3signer:9000 \
--validators-external-signer-public-keys http://web3signer:9000/api/v1/eth2/publicKeys \
--validators-external-signer-key-file=/var/lib/prysm/w3s-keys.txt"

if [ ! -f /var/lib/prysm/w3s-keys.txt ]; then
touch /var/lib/prysm/w3s-keys.txt
fi
else
__w3s_url=""
fi
Expand Down
12 changes: 2 additions & 10 deletions vc-utils/keymanager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,7 @@ and secrets directories into .eth/validator_keys instead."
__api_port=${__vc_api_port}
__api_tls=${__vc_api_tls}

if [ -z "${PRYSM:+x}" ]; then
jq --arg pubkey_value "$__pubkey" --arg url_value "http://web3signer:9000" '. | .remote_keys += [{"pubkey": $pubkey_value, "url": $url_value}]' <<< '{}' >/tmp/apidata.txt
else
jq --arg pubkey_value "$__pubkey" --arg url_value "http://web3signer:9000" '. | .remote_keys += [{"pubkey": $pubkey_value}]' <<< '{}' >/tmp/apidata.txt
fi
jq --arg pubkey_value "$__pubkey" --arg url_value "http://web3signer:9000" '. | .remote_keys += [{"pubkey": $pubkey_value, "url": $url_value}]' <<< '{}' >/tmp/apidata.txt

get-token
__api_data=@/tmp/apidata.txt
Expand Down Expand Up @@ -991,11 +987,7 @@ validator-register() {

__w3s_pubkeys="$(echo "$__result" | jq -r '.data[].validating_pubkey')"
while IFS= read -r __pubkey; do
if [ -z "${PRYSM:+x}" ]; then
jq --arg pubkey_value "$__pubkey" --arg url_value "http://web3signer:9000" '. | .remote_keys += [{"pubkey": $pubkey_value, "url": $url_value}]' <<< '{}' >/tmp/apidata.txt
else
jq --arg pubkey_value "$__pubkey" --arg url_value "http://web3signer:9000" '. | .remote_keys += [{"pubkey": $pubkey_value}]' <<< '{}' >/tmp/apidata.txt
fi
jq --arg pubkey_value "$__pubkey" --arg url_value "http://web3signer:9000" '. | .remote_keys += [{"pubkey": $pubkey_value, "url": $url_value}]' <<< '{}' >/tmp/apidata.txt

__api_data=@/tmp/apidata.txt
__api_path=eth/v1/remotekeys
Expand Down

0 comments on commit 04a95c0

Please sign in to comment.