Skip to content

Commit

Permalink
Support legacy along jato v2 SSV
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Aug 8, 2023
1 parent 823924a commit e610dc7
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ alertmanager/config.yml
prometheus/custom-prom.yml
ssv-config.yaml
ssv-config.yaml.bak
blox-ssv-config.yaml
blox-ssv-config.yaml.bak
promtail/custom-lokiurl.yml
18 changes: 18 additions & 0 deletions blox-ssv-config-sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
db:
Path: /tmp/ssv-db
Type: badger-db
p2p:
DiscoveryType: discv5
TcpPort: 13001
UdpPort: 12001
eth2:
BeaconNodeAddr: http://consensus:5052
Network: prater
eth1:
ETH1Addr: ws://execution:8546
OperatorPrivateKey: YOURPRIVATEKEYHERE
MetricsAPIPort: 15000
global:
LogFormat: json
LogLevelFormat: lowercase
LogLevel: info
33 changes: 33 additions & 0 deletions blox-ssv2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "3.9"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 100m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
ssv2-node:
restart: "unless-stopped"
image: bloxstaking/ssv-node:${SSV2_NODE_TAG:-latest}
user: 12000:12000
volumes:
- ./blox-ssv-config.yaml:/config.yaml
- ssv2-data:/tmp
- /etc/localtime:/etc/localtime:ro
ports:
- ${SSV_P2P_PORT}:${SSV_P2P_PORT}/tcp
- ${SSV_P2P_PORT_UDP}:${SSV_P2P_PORT_UDP}/udp
<<: *logging
environment:
- CONFIG_PATH=/config.yaml
- HOME=/tmp
command: make BUILD_PATH=/go/bin/ssvnode start-node
ssv-generate-keys:
profiles: ["tools"]
restart: "no"
image: bloxstaking/ssv-node:${SSV2_NODE_TAG:-latest}
command: /go/bin/ssvnode generate-operator-keys
volumes:
ssv2-data:
2 changes: 2 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ MEV_NODE=http://mev-boost:18550

# SSV
SSV_NODE_TAG=latest
# Legacy
SSV2_NODE_TAG=latest

# MEV-Boost
# If mev-boost terminates with a SIGILL, make this one of the "portable" tags
Expand Down
14 changes: 10 additions & 4 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ envmigrate() {
ERIGON_DOCKERFILE MEV_DOCKERFILE MEV_DOCKER_TAG NIMEL_SRC_BUILD_TARGET NIMEL_DOCKER_TAG NIMEL_DOCKERFILE \
LS_SRC_BUILD_TARGET LS_DOCKER_TAG LS_DOCKERFILE GETH_SRC_BUILD_TARGET GETH_DOCKER_TAG TRAEFIK_TAG DDNS_TAG \
GETH_DOCKERFILE NM_SRC_BUILD_TARGET NM_DOCKER_TAG NM_DOCKERFILE BESU_SRC_BUILD_TARGET \
BESU_DOCKER_TAG BESU_DOCKERFILE SSV_NODE_TAG DEPCLI_SRC_BUILD_TARGET DEPCLI_DOCKER_TAG W3S_DOCKER_TAG \
BESU_DOCKER_TAG BESU_DOCKERFILE SSV_NODE_TAG SSV2_NODE_TAG DEPCLI_SRC_BUILD_TARGET DEPCLI_DOCKER_TAG W3S_DOCKER_TAG \
PG_DOCKER_TAG RETH_SRC_BUILD_TARGET RETH_DOCKER_TAG RETH_DOCKERFILE NODE_EXPORTER_IGNORE_MOUNT_REGEX )
OLD_VARS=( LH_PORT PRYSM_WEB_PORT EC_NODE REWARDS_TO GETH_CACHE CF_API_TOKEN SSV2_NODE_TAG \
EC_HOST EC_LB EC_WS_HOST EC_WS_LB CC_HOST CC_LB EC_P2P_PORT CC_NODE CC_P2P_PORT EC_RPC_PORT EC_WS_PORT )
Expand Down Expand Up @@ -703,7 +703,7 @@ envmigrate() {
# Literal match intended
# shellcheck disable=SC2076
if [[ "${value}" =~ "blox-ssv2.yml" ]]; then
blox_switch
ssv_switch
fi

# Migrate over user settings
Expand Down Expand Up @@ -810,7 +810,7 @@ migrate_compose_file() {
# When this gets called $var is COMPOSE_FILE and $value is what is set in .env for it
# Some files have been renamed and others removed altogether
FROM_YML=( ec-shared.yml ec-traefik.yml cc-shared.yml grafana-insecure.yml prysm-web-insecure.yml lh-base-notz.yml lh-validator-notz.yml lh-slasher.yml teku-base-notz.yml teku-validator-notz.yml lh-consensus.yml lh-validator.yml lodestar-consensus.yml lodestar-validator.yml nimbus-consensus.yml prysm-consensus.yml prysm-consensus-rest.yml prysm-validator.yml teku-consensus.yml teku-validator.yml lh-base.yml lh-vc-only.yml lh-cl-only.yml nm.yml lighthouse-base.yml teku-base.yml nimbus-base.yml prysm-base.yml lodestar-base.yml traefik-cf-v6.yml blox-ssv2.yml prysm-web.yml blank-grafana.yml lh-grafana.yml lhcc-grafana.yml nimbus-grafana.yml prysm-grafana.yml teku-grafana.yml geth-grafana.yml erigon-grafana.yml oe.yml teku-stats.yml lh-stats.yml lh-stats-consensus.yml lh-stats-validator.yml traefik-shared.yml lighthouse-slasher.yml prysm-slasher.yml )
TO_YML=( el-shared.yml el-traefik.yml cl-shared.yml grafana-shared.yml prysm-web-shared.yml lighthouse-base.yml lighthouse-vc-only.yml lighthouse-slasher.yml teku-base.yml teku-vc-only.yml lighthouse-cl-only.yml lighthouse-vc-only.yml lodestar-cl-only.yml lodestar-vc-only.yml nimbus-cl-only.yml prysm-cl-only.yml prysm-cl-only.yml prysm-vc-only.yml teku-cl-only.yml teku-vc-only.yml lighthouse-base.yml lighthouse-vc-only.yml lighthouse-cl-only.yml nethermind.yml lighthouse.yml teku.yml nimbus.yml prysm.yml lodestar.yml traefik-cf.yml ssv.yml "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" )
TO_YML=( el-shared.yml el-traefik.yml cl-shared.yml grafana-shared.yml prysm-web-shared.yml lighthouse-base.yml lighthouse-vc-only.yml lighthouse-slasher.yml teku-base.yml teku-vc-only.yml lighthouse-cl-only.yml lighthouse-vc-only.yml lodestar-cl-only.yml lodestar-vc-only.yml nimbus-cl-only.yml prysm-cl-only.yml prysm-cl-only.yml prysm-vc-only.yml teku-cl-only.yml teku-vc-only.yml lighthouse-base.yml lighthouse-vc-only.yml lighthouse-cl-only.yml nethermind.yml lighthouse.yml teku.yml nimbus.yml prysm.yml lodestar.yml traefik-cf.yml blox-ssv2.yml "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" )

__old_grafana=0
__new_grafana=0
Expand Down Expand Up @@ -853,7 +853,9 @@ migrate_compose_file() {
fi
}

blox_switch() {
ssv_switch() {
echo "Detected legacy SSV Node. Not migrating, yet."
return
echo "Detected legacy SSV Node. Migrating config to new testnet."
echo
echo "Stopping SSV Node container"
Expand Down Expand Up @@ -2326,6 +2328,10 @@ version() {
docompose exec ssv-node /go/bin/ssvnode --version
echo
;;&
*blox-ssv2.yml* )
docompose exec ssv2-node /go/bin/ssvnode --version
echo
;;&
*lighthouse.yml* | *lighthouse-cl-only* )
docompose exec consensus lighthouse --version
echo
Expand Down
11 changes: 10 additions & 1 deletion grafana/provision-dashboards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ case "$CLIENT" in
wget -t 3 -T 10 -qcO - "${__url}" | jq 'walk(if . == "prometheus_ds" then "Prometheus" else . end)' >"${__file}"
# cp /tmp/nethermind_dashboard.json "${__file}"
;;&
*ssv* )
*ssv.yml* )
# SSV Operator Dashboard
__url='https://raw.githubusercontent.com/bloxapp/ssv/main/monitoring/grafana/dashboard_ssv_operator_performance.json'
__file='/etc/grafana/provisioning/dashboards/ssv_operator_dashboard.json'
Expand All @@ -94,6 +94,15 @@ case "$CLIENT" in
__file='/etc/grafana/provisioning/dashboards/ssv_node_dashboard.json'
wget -t 3 -T 10 -qcO - "${__url}" | jq '.templating.list[0].current |= {selected: false, text: "ssv-node", value: "ssv-node"} | .templating.list[0].options = [ { "selected": true, "text": "ssv-node", "value": "ssv-node" } ] | .templating.list[0].query = "ssv-node"' >"${__file}"
;;&
*blox-ssv2.yml* )
# SSV Operator Dashboard
__url='https://raw.githubusercontent.com/bloxapp/ssv/main/monitoring/grafana/dashboard_ssv_operator_performance.json'
__file='/etc/grafana/provisioning/dashboards/ssv_operator_dashboard.json'
wget -t 3 -T 10 -qcO - "${__url}" | jq '.templating.list[0].current |= {selected: false, text: "ssv2-node", value: "ssv2-node"} | .templating.list[0].options = [ { "selected": true, "text": "ssv2-node", "value": "ssv2-node" } ] | .templating.list[0].query = "ssv2-node"' >"${__file}"
__url='https://raw.githubusercontent.com/bloxapp/ssv/main/monitoring/grafana/dashboard_ssv_node.json'
__file='/etc/grafana/provisioning/dashboards/ssv_node_dashboard.json'
wget -t 3 -T 10 -qcO - "${__url}" | jq '.templating.list[0].current |= {selected: false, text: "ssv2-node", value: "ssv2-node"} | .templating.list[0].options = [ { "selected": true, "text": "ssv2-node", "value": "ssv2-node" } ] | .templating.list[0].query = "ssv2-node"' >"${__file}"
;;&
* )
# Home staking dashboard
__revision=$(wget -t 3 -T 10 -qO - https://grafana.com/api/dashboards/17846 | jq .revision)
Expand Down
10 changes: 10 additions & 0 deletions prometheus/blox-ssv2-prom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- job_name: ssv
metrics_path: /metrics
static_configs:
- targets:
- ssv2-node:15000
- job_name: ssv_health
metrics_path: /health
static_configs:
- targets:
- ssv2-node:15000
3 changes: 2 additions & 1 deletion prometheus/choose-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ case "$CLIENT" in
esac

case "$CLIENT" in
*ssv* ) cat /etc/prometheus/ssv-prom.yml >> /etc/prometheus/prometheus.yml ;;
*ssv.yml* ) cat /etc/prometheus/ssv-prom.yml >> /etc/prometheus/prometheus.yml ;;
*blox-ssv2.yml* ) cat /etc/prometheus/blox-ssv2-prom.yml >> /etc/prometheus/prometheus.yml ;;
esac

case "$CLIENT" in
Expand Down

0 comments on commit e610dc7

Please sign in to comment.