Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from dappnode/pablo/add-docs
Browse files Browse the repository at this point in the history
Added md files
  • Loading branch information
pablomendezroyo authored Mar 14, 2022
2 parents ae9daf2 + 289425b commit 78ddb22
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 30 deletions.
3 changes: 3 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Welcome to your eth2 client Nimbus-prater:

- Upload your keystores in the [web3signer-ui](http://ui.web3signer-prater.dappnode?signer_url=http://web3signer.web3signer-prater.dappnode:9000) (do not have web3singer yet? install it [here](http://my.dappnode/#/installer/web3signer-prater.dnp.dappnode.eth))
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
⚠ This package is under development and must not be use in production!!
# Nimbus DAppNode package (prater config)

**Nimbus prater ETH2.0 Beacon chain + validator**

Nimbus is a client implementation for both the consensus layer (eth2) and execution layer (eth1) that strives to be as lightweight as possible in terms of resources used. This allows it to perform well on embedded systems, resource-restricted devices -- including Raspberry Pis and mobile devices.

However, resource-restricted hardware is not the only thing Nimbus is good for. Its low resource consumption makes it easy to run Nimbus together with other workloads on your server (this is especially valuable for stakers looking to lower the cost of their server instances).

![avatar](nimbus-avatar.png)

| Updated | Champion/s |
| :----------------: | :-------------: |
| :heavy_check_mark: | @pablomendez_95 |
12 changes: 6 additions & 6 deletions build/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ function ensure_envs_exist() {
# }]
# }
function get_public_keys() {
if PUBLIC_KEYS=$(curl -s -X GET \
if PUBLIC_KEYS_API=$(curl -s -X GET \
-H "Content-Type: application/json" \
--max-time 10 \
--retry 2 \
--retry-delay 2 \
--retry-max-time 40 \
"${HTTP_WEB3SIGNER}/eth/v1/keystores"); then
if PUBLIC_KEYS_PARSED=$(echo ${PUBLIC_KEYS} | jq -r '.data[].validating_pubkey'); then
if [ ! -z "$PUBLIC_KEYS_PARSED" ]; then
echo "${INFO} found public keys: $PUBLIC_KEYS_PARSED"
if PUBLIC_KEYS_API=($(echo ${PUBLIC_KEYS_API} | jq -r '.data[].validating_pubkey')); then
if [ ! -z "$PUBLIC_KEYS_API" ]; then
echo "${INFO} found public keys: $PUBLIC_KEYS_API"
else
echo "${WARN} no public keys found"
fi
Expand All @@ -64,7 +64,7 @@ function write_public_keys() {
touch ${PUBLIC_KEYS_FILE}

echo "${INFO} writing public keys to file"
for PUBLIC_KEY in ${PUBLIC_KEYS_PARSED}; do
for PUBLIC_KEY in ${PUBLIC_KEYS_API}; do
if [ ! -z "${PUBLIC_KEY}" ]; then
echo "${INFO} adding public key: $PUBLIC_KEY"
echo "${PUBLIC_KEY}" >> ${PUBLIC_KEYS_FILE}
Expand All @@ -84,7 +84,7 @@ ensure_envs_exist
# Get public keys from API keymanager
get_public_keys

if [ ! -z "${PUBLIC_KEYS_PARSED}" ]; then
if [ ! -z "${PUBLIC_KEYS_API}" ]; then
# Write public keys to file
echo "${INFO} writing public keys file"
write_public_keys
Expand Down
39 changes: 19 additions & 20 deletions build/get-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ HTTP_WEB3SIGNER="http://web3signer.web3signer-prater.dappnode:9000"

# Get public keys in format: string[]
function get_public_keys() {
if PUBLIC_KEYS=$(curl -s -X GET \
if PUBLIC_KEYS_API=$(curl -s -X GET \
-H "Content-Type: application/json" \
--max-time 10 \
--retry 5 \
--retry-delay 2 \
--retry-max-time 40 \
"${HTTP_WEB3SIGNER}/eth/v1/keystores"); then
if PUBLIC_KEYS_PARSED=$(echo ${PUBLIC_KEYS} | jq -r '.data[].validating_pubkey'); then
if [ ! -z "$PUBLIC_KEYS_PARSED" ]; then
echo "${INFO} found public keys: $PUBLIC_KEYS_PARSED"
if PUBLIC_KEYS_API=($(echo ${PUBLIC_KEYS} | jq -r '.data[].validating_pubkey')); then
if [ ! -z "$PUBLIC_KEYS_API" ]; then
echo "${INFO} found public keys: $PUBLIC_KEYS_API"
else
echo "${WARN} no public keys found"
PUBLIC_KEYS_PARSED=()
PUBLIC_KEYS_API=()
fi
else
{ echo "${ERROR} something wrong happened parsing the public keys"; exit 1; }
Expand Down Expand Up @@ -56,34 +56,33 @@ function read_old_public_keys() {
function compare_public_keys() {
echo "${DEBUG} comparing public keys"
echo "${DEBUG} public keys from file: $PUBLIC_KEYS_OLD"
echo "${DEBUG} public keys from api: $PUBLIC_KEYS_PARSED"
echo "${DEBUG} public keys from api: $PUBLIC_KEYS_API"
echo "${DEBUG} public keys length from file: ${#PUBLIC_KEYS_OLD[@]}"
echo "${DEBUG} public keys length from api: ${#PUBLIC_KEYS_PARSED[@]}"
echo "${DEBUG} public keys length from api: ${#PUBLIC_KEYS_API[@]}"

# compare array lentghs
if [ ${#PUBLIC_KEYS_OLD[@]} -ne ${#PUBLIC_KEYS_PARSED[@]} ]; then
if [ ${#PUBLIC_KEYS_OLD[@]} -ne ${#PUBLIC_KEYS_API[@]} ]; then
echo "${WARN} public keys from file and api are different. Killing process to restart"
kill 1
exit 0
else
if [ ${#PUBLIC_KEYS_PARSED[@]} -eq 0 ]; then
if [ ${#PUBLIC_KEYS_API[@]} -eq 0 ]; then
echo "${INFO} public keys from file and api are empty. Not comparision needed"
exit 0
else
echo "${INFO} same number of public keys, comparing"
# Compare public keys
for i in "${PUBLIC_KEYS_OLD[@]}"; do
if [[ "${PUBLIC_KEYS_API[@]}" =~ "${i}" ]]; then
echo "${INFO} public key ${i} found in api"
else
echo "${WARN} public key ${i} from file not found in api. Killing process to restart"
kill 1
exit 0
fi
done
fi
fi

# Compare public keys
for i in "${PUBLIC_KEYS_OLD[@]}"; do
if [[ "${PUBLIC_KEYS_PARSED[@]}" =~ "${i}" ]]; then
echo "${INFO} public key ${i} found in api"
else
echo "${WARN} public key ${i} from file not found in api. Killing process to restart"
kill 1
exit 0
fi
done
}

########
Expand Down
3 changes: 0 additions & 3 deletions getting-started.md

This file was deleted.

0 comments on commit 78ddb22

Please sign in to comment.