Skip to content

Commit a8aefdc

Browse files
committed
Use prysm containers directly
1 parent 915e15f commit a8aefdc

4 files changed

Lines changed: 19 additions & 31 deletions

File tree

shared/services/config/rocket-pool-config.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,14 @@ func (cfg *RocketPoolConfig) ConsensusClientApiUrl() (string, error) {
925925
return cCfg.(config.ExternalConsensusConfig).GetApiUrl(), nil
926926
}
927927

928+
func stripScheme(url string) string {
929+
idx := strings.Index(url, "://")
930+
if idx != -1 {
931+
url = url[idx+3:]
932+
}
933+
return url
934+
}
935+
928936
// Used by text/template to format validator.yml
929937
func (cfg *RocketPoolConfig) ConsensusClientRpcUrl() (string, error) {
930938
// Check if Rescue Node is in-use
@@ -947,8 +955,8 @@ func (cfg *RocketPoolConfig) ConsensusClientRpcUrl() (string, error) {
947955
return fmt.Sprintf("%s:%d", Eth2ContainerName, cfg.Prysm.RpcPort.Value), nil
948956
}
949957

950-
// Use the external RPC endpoint
951-
return cfg.ExternalPrysm.JsonRpcUrl.Value.(string), nil
958+
// Use the external RPC endpoint, but strip any scheme
959+
return stripScheme(cfg.ExternalPrysm.JsonRpcUrl.Value.(string)), nil
952960
}
953961

954962
// Used by text/template to format validator.yml
@@ -976,7 +984,7 @@ func (cfg *RocketPoolConfig) FallbackCcRpcUrl() string {
976984
return ""
977985
}
978986

979-
return cfg.FallbackPrysm.JsonRpcUrl.Value.(string)
987+
return stripScheme(cfg.FallbackPrysm.JsonRpcUrl.Value.(string))
980988
}
981989

982990
// Used by text/template to format validator.yml

shared/services/rocketpool/assets/install/scripts/start-vc.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,6 @@ if [ "$CC_CLIENT" = "prysm" ]; then
168168
# Make the Prysm dir
169169
mkdir -p /validators/prysm-non-hd/
170170

171-
# Get rid of the protocol prefix
172-
CC_RPC_ENDPOINT=$(echo $CC_RPC_ENDPOINT | sed -E 's/.*\:\/\/(.*)/\1/')
173-
if [ ! -z "$FALLBACK_CC_RPC_ENDPOINT" ]; then
174-
FALLBACK_CC_RPC_ENDPOINT=$(echo $FALLBACK_CC_RPC_ENDPOINT | sed -E 's/.*\:\/\/(.*)/\1/')
175-
fi
176-
177171
# Set up the CC + fallback string
178172
CC_URL_STRING=$CC_RPC_ENDPOINT
179173
if [ ! -z "$FALLBACK_CC_RPC_ENDPOINT" ]; then

shared/services/rocketpool/assets/install/templates/eth2.tmpl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,7 @@
77

88
services:
99
eth2:
10-
{{- if eq .ConsensusClient.String "prysm"}}
11-
image: localhost/{{.GetBeaconContainerTag}}
12-
pull_policy: never
13-
build:
14-
dockerfile_inline: |
15-
FROM {{.GetBeaconContainerTag}} as upstream
16-
FROM debian:bookworm-slim
17-
RUN apt update && apt install -y wget ca-certificates && rm -rf /var/lib/apt/lists/*
18-
COPY --from=upstream /app/cmd/beacon-chain/beacon-chain /app/cmd/beacon-chain/beacon-chain
19-
{{- else}}
2010
image: {{.GetBeaconContainerTag}}
21-
{{- end}}
2211
user: root
2312
container_name: {{.Smartnode.ProjectName}}_eth2
2413
restart: unless-stopped
@@ -83,7 +72,11 @@ services:
8372
{{- else if eq .ConsensusClient.String "lighthouse"}}
8473
- BN_P2P_QUIC_PORT={{.Lighthouse.P2pQuicPort}}
8574
{{- end}}
75+
{{- if eq .ConsensusClient.String "prysm"}}
76+
entrypoint: bash
77+
{{- else}}
8678
entrypoint: sh
79+
{{- end}}
8780
command: "/setup/start-bn.sh"
8881
cap_drop:
8982
- all

shared/services/rocketpool/assets/install/templates/validator.tmpl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,7 @@
77

88
services:
99
validator:
10-
{{- if eq .ConsensusClient.String "prysm"}}
11-
image: localhost/{{.GetVCContainerTag}}
12-
pull_policy: never
13-
build:
14-
dockerfile_inline: |
15-
FROM {{.GetVCContainerTag}} as upstream
16-
FROM debian:bookworm-slim
17-
RUN apt update && apt install -y wget ca-certificates && rm -rf /var/lib/apt/lists/*
18-
COPY --from=upstream /app/cmd/validator/validator /app/cmd/validator/validator
19-
{{- else}}
2010
image: {{.GetVCContainerTag}}
21-
{{- end}}
2211
user: root
2312
container_name: {{.Smartnode.ProjectName}}_validator
2413
restart: unless-stopped
@@ -56,7 +45,11 @@ services:
5645
{{- if eq .ConsensusClient.String "teku"}}
5746
- TEKU_USE_SLASHING_PROTECTION={{.Teku.UseSlashingProtection}}
5847
{{- end}}
48+
{{- if eq .ConsensusClient.String "prysm"}}
49+
entrypoint: bash
50+
{{- else}}
5951
entrypoint: sh
52+
{{- end}}
6053
command: "/setup/start-vc.sh"
6154
cap_drop:
6255
- all

0 commit comments

Comments
 (0)