diff --git a/.gitignore b/.gitignore index e46f4ddb..f8d8cd73 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/blox-ssv-config-sample.yaml b/blox-ssv-config-sample.yaml new file mode 100644 index 00000000..2270b842 --- /dev/null +++ b/blox-ssv-config-sample.yaml @@ -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 diff --git a/blox-ssv2.yml b/blox-ssv2.yml new file mode 100644 index 00000000..7c865811 --- /dev/null +++ b/blox-ssv2.yml @@ -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: diff --git a/default.env b/default.env index e6170923..238cb441 100644 --- a/default.env +++ b/default.env @@ -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 diff --git a/ethd b/ethd index 26ad23de..8f02e90c 100755 --- a/ethd +++ b/ethd @@ -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 ) @@ -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 @@ -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 @@ -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" @@ -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 diff --git a/grafana/provision-dashboards.sh b/grafana/provision-dashboards.sh index 8f97f791..c08761e8 100755 --- a/grafana/provision-dashboards.sh +++ b/grafana/provision-dashboards.sh @@ -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' @@ -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) diff --git a/prometheus/blox-ssv2-prom.yml b/prometheus/blox-ssv2-prom.yml new file mode 100644 index 00000000..9790a049 --- /dev/null +++ b/prometheus/blox-ssv2-prom.yml @@ -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 diff --git a/prometheus/choose-config.sh b/prometheus/choose-config.sh index 45ffb70f..f11714ec 100755 --- a/prometheus/choose-config.sh +++ b/prometheus/choose-config.sh @@ -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