-
Notifications
You must be signed in to change notification settings - Fork 0
Added dv-pod installation flow #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Padraic-O-Mhuiris
wants to merge
1
commit into
main
Choose a base branch
from
dv-pod-installation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1222,6 +1222,96 @@ configure_path() { | |
| fi | ||
| } | ||
|
|
||
| # Validate Ethereum address (0x followed by 40 hex characters) | ||
| validate_ethereum_address() { | ||
| local address="$1" | ||
|
|
||
| # Check if address matches pattern: 0x followed by 40 hex characters | ||
| if [[ "$address" =~ ^0x[0-9a-fA-F]{40}$ ]]; then | ||
| return 0 | ||
| else | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| # Install dv-pod with user prompts | ||
| install_dv_pod() { | ||
| log_info "Installing dv-pod..." | ||
| echo "" | ||
|
|
||
| # Prompt for nickname | ||
| local nickname="" | ||
| while [[ -z "$nickname" ]]; do | ||
| read -p "Enter nickname: " nickname </dev/tty | ||
| if [[ -z "$nickname" ]]; then | ||
| log_error "Nickname cannot be empty" | ||
| fi | ||
| done | ||
|
|
||
| # Prompt for operator address with validation | ||
| local operator_address="" | ||
| while true; do | ||
| read -p "Enter operator address (Ethereum address): " operator_address </dev/tty | ||
| if validate_ethereum_address "$operator_address"; then | ||
| break | ||
| else | ||
| log_error "Invalid Ethereum address. Must be in format: 0x followed by 40 hex characters" | ||
| fi | ||
| done | ||
|
|
||
| echo "" | ||
| log_info "Installing dv-pod with nickname: $nickname, operator: $operator_address" | ||
|
|
||
| # Add helm repo | ||
| if ! "$OBOL_BIN_DIR/obol" helm repo add obol https://obolnetwork.github.io/helm-charts 2>/dev/null; then | ||
| log_warn "Failed to add helm repo (may already exist)" | ||
| fi | ||
|
|
||
| # Install dv-pod | ||
| if "$OBOL_BIN_DIR/obol" helm install my-dv-pod obol/dv-pod \ | ||
| --set charon.dkgSidecar.apiEndpoint=https://obol-api-nonprod-dev.dev.obol.tech \ | ||
| --set network=hoodi \ | ||
| --set charon.operatorAddress="$operator_address" \ | ||
| --set charon.dkgSidecar.image.tag=90a1656 \ | ||
| --set charon.nickname="$nickname" \ | ||
| --set validatorClient.type=prysm \ | ||
| --set validatorClient.config.prysm.acceptTermsOfUse=true \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This flag doesn't exist anymore |
||
| --set centralMonitoring.enabled=true \ | ||
| --set-string centralMonitoring.token='obolkvmusKH1SFvr/ruCzfj/Vlix3E49=59TdIH1BcTLecZabTv9SF=81HbtXucMNjwsJbFW=Z9ND7hD/GYPtz=B?TpWs2sJq9FIz-uN1-4DyR1l6J=HyC=d=Q!-?fHP'; then | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might need to double check for a generic token cc @OisinKyne |
||
| log_success "dv-pod installed successfully" | ||
|
|
||
| # Wait 3 seconds for secret to be created | ||
| echo "" | ||
| log_info "Waiting 3 seconds for secret to be created..." | ||
| sleep 3 | ||
|
|
||
| # Retrieve and display ENR secret | ||
| echo "" | ||
| log_info "Retrieving ENR secret..." | ||
| local enr_secret | ||
| enr_secret=$("$OBOL_BIN_DIR/obol" kubectl get secret -n default charon-enr-private-key -o jsonpath='{.data.enr}' 2>/dev/null | base64 --decode) | ||
|
|
||
| if [[ -n "$enr_secret" ]]; then | ||
| echo "" | ||
| log_success "ENR Secret:" | ||
| echo "$enr_secret" | ||
| echo "" | ||
| else | ||
| log_warn "Failed to retrieve ENR secret (it may not be ready yet)" | ||
| echo "" | ||
| echo "You can retrieve it manually with:" | ||
| echo "" | ||
| echo " obol kubectl get secret -n default charon-enr-private-key -o jsonpath='{.data.enr}' | base64 --decode" | ||
| echo "" | ||
| fi | ||
|
|
||
| return 0 | ||
| else | ||
| log_error "Failed to install dv-pod" | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| # Print post-install instructions | ||
| print_instructions() { | ||
| local install_mode="$1" | ||
|
|
@@ -1255,7 +1345,22 @@ print_instructions() { | |
|
|
||
| # Run obol bootstrap | ||
| if "$OBOL_BIN_DIR/obol" bootstrap; then | ||
| # Bootstrap succeeded, we're done | ||
| # Bootstrap succeeded, now prompt for dv-pod installation | ||
| echo "" | ||
| log_info "Would you like to install dv-pod?" | ||
| echo "" | ||
|
|
||
| local dv_pod_choice | ||
| read -p "Install dv-pod? [y/N]: " dv_pod_choice </dev/tty | ||
|
|
||
| case "$dv_pod_choice" in | ||
| [Yy]*) | ||
| install_dv_pod | ||
| ;; | ||
| *) | ||
| log_info "Skipping dv-pod installation" | ||
| ;; | ||
| esac | ||
| return 0 | ||
| else | ||
| log_error "Bootstrap failed" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better pin a :latest here while we are in active dev IMO