Skip to content

Commit

Permalink
feat: add docker compose in grandine.tmpl
Browse files Browse the repository at this point in the history
  • Loading branch information
khalifaa55 committed May 20, 2024
1 parent 4e7e83d commit 2089fa6
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
45 changes: 45 additions & 0 deletions templates/services/merge/consensus/grandine.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{/* grandine.tmpl */}}
{{ define "consensus" }}
consensus:
stop_grace_period: 30s
container_name: sedge-consensus-client{{if .ContainerTag}}-{{.ContainerTag}}{{end}}
restart: unless-stopped
image: ${CC_IMAGE_VERSION}{{if .Mev}}
depends_on:{{if .Mev}}
mev-boost:
condition: service_started{{end}}{{end}}
networks:
- sedge
volumes:
- ${CC_DATA_DIR}:/root/.grandine
- ${CC_JWT_SECRET_PATH}:/root/.grandine/jwtsecret{{if .CustomConsensusConfigs}}{{if .CustomNetworkConfigPath}}
- {{.CustomNetworkConfigPath}}:/network/config.yaml{{end}}{{if .CustomGenesisPath}}
- {{.CustomGenesisPath}}:/network/genesis.ssz{{end}}{{if .CustomDeployBlockPath}}
- {{.CustomDeployBlockPath}}:/network/deploy_block.txt{{end}}{{end}}
ports:
- "{{.ClDiscoveryPort}}:{{.ClDiscoveryPort}}/tcp"
- "{{.ClDiscoveryPort}}:{{.ClDiscoveryPort}}/udp"
- "{{.ClMetricsPort}}:{{.ClMetricsPort}}/tcp"{{if .MapAllPorts}}
- "{{.ClApiPort}}:{{.ClApiPort}}"{{end}}
expose:
- {{.ClApiPort}}
command:
- grandine{{if .CustomConsensusConfigs}}
- --config-file=/network/config.yaml{{end}}
- --datadir=/root/.grandine
- --eth1-rpc-urls=${EC_API_URL}
- --jwt-secret=/root/.grandine/jwtsecret
- --http-address=0.0.0.0
- --http-port={{.ClApiPort}}{{if not .CustomConsensusConfigs}}
- --network={{if .SplittedNetwork}}${CL_NETWORK}{{else}}${NETWORK}{{end}}{{end}}
- --timeout=10000{{range $flag := .ClExtraFlags}}
- --{{$flag}}{{end}}{{if .MevBoostEndpoint}}
- --checkpoint-sync-url={{if .CheckpointSyncUrl}}{{ .CheckpointSyncUrl }}{{else}}${CHECKPOINT_SYNC_URL}{{end}}{{end}}{{range $flag := .ClExtraFlags}}
- --{{$flag}}{{end}}{{if .MevBoostEndpoint}}
- --builder={{.MevBoostEndpoint}}{{end}}{{if .LoggingDriver}}
logging:
driver: "{{.LoggingDriver}}"{{if eq .LoggingDriver "json-file"}}
options:
max-size: "10m"
max-file: "10"{{end}}{{end}}
{{ end }}
38 changes: 38 additions & 0 deletions templates/services/merge/validator/grandine.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{/* grandine.tmpl */}}
{{ define "validator" }}
validator:
container_name: sedge-validator-client{{if .ContainerTag}}-{{.ContainerTag}}{{end}}
image: ${VL_IMAGE_VERSION}
depends_on:
validator-blocker:
condition: service_completed_successfully
networks:
- sedge
ports:
- "{{.VlMetricsPort}}:{{.VlMetricsPort}}"
volumes:
- ${VL_DATA_DIR}:/data{{if .CustomConsensusConfigs}}{{if .CustomNetworkConfigPath}}
- {{.CustomNetworkConfigPath}}:/network_config/config.yaml{{end}}{{if .CustomGenesisPath}}
- {{.CustomGenesisPath}}:/network_config/genesis.ssz{{end}}{{if .CustomDeployBlockPath}}
- {{.CustomDeployBlockPath}}:/network_config/deploy_block.txt{{end}}{{end}}
command:
- grandine{{if .CustomConsensusConfigs}}
- --testnet-dir=/network_config{{end}}
- vc{{if not .CustomConsensusConfigs}}
- --network={{if .SplittedNetwork}}${CL_NETWORK}{{else}}${NETWORK}{{end}}{{end}}
- --beacon-nodes=${CC_API_URL}
- --graffiti=${GRAFFITI}
- --debug-level=${VL_LOG_LEVEL}
- --validators-dir=/data/validators{{with .FeeRecipient}}
- --suggested-fee-recipient=${FEE_RECIPIENT}{{end}}
- --metrics
- --metrics-port={{.VlMetricsPort}}
- --metrics-address=0.0.0.0{{range $flag := .VlExtraFlags}}
- --{{$flag}}{{end}}{{if .MevBoostOnValidator}}
- --builder-proposals{{end}}{{if .LoggingDriver}}
logging:
driver: "{{.LoggingDriver}}"{{if eq .LoggingDriver "json-file"}}
options:
max-size: "10m"
max-file: "10"{{end}}{{end}}
{{ end }}

0 comments on commit 2089fa6

Please sign in to comment.