diff --git a/cli/generate.go b/cli/generate.go index 96afe4e5..dccf89e0 100644 --- a/cli/generate.go +++ b/cli/generate.go @@ -77,6 +77,7 @@ type GenCmdFlags struct { elExtraFlags []string clExtraFlags []string vlExtraFlags []string + dvExtraFlags []string relayURLs []string mevBoostUrl string executionApiUrl string @@ -292,6 +293,7 @@ func runGenCmd(out io.Writer, flags *GenCmdFlags, sedgeAction actions.SedgeActio ElExtraFlags: flags.elExtraFlags, ClExtraFlags: flags.clExtraFlags, VlExtraFlags: flags.vlExtraFlags, + DvExtraFlags: flags.dvExtraFlags, MapAllPorts: flags.mapAllPorts, Mev: !flags.noMev && utils.Contains(services, validator) && utils.Contains(services, consensus) && !flags.noValidator, MevImage: flags.mevImage, diff --git a/cli/sub_gen.go b/cli/sub_gen.go index 1606e9aa..8b8149bb 100644 --- a/cli/sub_gen.go +++ b/cli/sub_gen.go @@ -106,6 +106,7 @@ Additionally, you can use this syntax ':' to override the cmd.Flags().StringArrayVar(&flags.elExtraFlags, "el-extra-flag", []string{}, "Additional flag to configure the execution client service in the generated docker-compose script. Example: 'sedge generate full-node --el-extra-flag \"=value1\" --el-extra-flag \"=\\\"value2\\\"\"'") cmd.Flags().StringArrayVar(&flags.clExtraFlags, "cl-extra-flag", []string{}, "Additional flag to configure the consensus client service in the generated docker-compose script. Example: 'sedge generate full-node --cl-extra-flag \"=value1\" --cl-extra-flag \"=\\\"value2\\\"\"'") cmd.Flags().StringArrayVar(&flags.vlExtraFlags, "vl-extra-flag", []string{}, "Additional flag to configure the validator client service in the generated docker-compose script. Example: 'sedge generate full-node --vl-extra-flag \"=value1\" --vl-extra-flag \"=\\\"value2\\\"\"'") + cmd.Flags().StringArrayVar(&flags.dvExtraFlags, "dv-extra-flag", []string{}, "Additional flag to configure the distributed validator client service in the generated docker-compose script. Example: 'sedge generate full-node --distributed --dv-extra-flag \"=value1\" --dv-extra-flag \"=\\\"value2\\\"\"'") cmd.Flags().StringVar(&flags.customChainSpec, "custom-chainSpec", "", "File path or url to use as custom network chainSpec for execution client.") cmd.Flags().StringVar(&flags.customNetworkConfig, "custom-config", "", "File path or url to use as custom network config file for consensus client.") cmd.Flags().StringVar(&flags.customGenesis, "custom-genesis", "", "File path or url to use as custom network genesis for consensus client.") diff --git a/docs/docs/commands/generate.mdx b/docs/docs/commands/generate.mdx index e319a1ad..b62661ee 100644 --- a/docs/docs/commands/generate.mdx +++ b/docs/docs/commands/generate.mdx @@ -103,6 +103,7 @@ Flags: --el-extra-flag stringArray Additional flag to configure the execution client service in the generated docker-compose script. Example: 'sedge generate full-node --el-extra-flag "=value1" --el-extra-flag "=\"value2\""' --cl-extra-flag stringArray Additional flag to configure the consensus client service in the generated docker-compose script. Example: 'sedge generate full-node --cl-extra-flag "=value1" --cl-extra-flag "=\"value2\""' --vl-extra-flag stringArray Additional flag to configure the validator client service in the generated docker-compose script. Example: 'sedge generate full-node --vl-extra-flag "=value1" --vl-extra-flag "=\"value2\""' + --dv-extra-flag stringArray Additional flag to configure the distributed validator client service in the generated docker-compose script. Example: 'sedge generate full-node --distributed --dv-extra-flag "=value1" --dv-extra-flag "CHARON_FEATURE_SET=\"alpha\""' --custom-chainSpec string File path or url to use as custom network chainSpec for execution client. --custom-config string File path or url to use as custom network config file for consensus client. --custom-genesis string File path or url to use as custom network genesis for consensus client. diff --git a/internal/pkg/generate/generate_scripts.go b/internal/pkg/generate/generate_scripts.go index d7d909a5..3fa5c50a 100644 --- a/internal/pkg/generate/generate_scripts.go +++ b/internal/pkg/generate/generate_scripts.go @@ -302,6 +302,7 @@ func ComposeFile(gd *GenData, at io.Writer) error { ElExtraFlags: gd.ElExtraFlags, ClExtraFlags: gd.ClExtraFlags, VlExtraFlags: gd.VlExtraFlags, + DvExtraFlags: gd.DvExtraFlags, ECBootnodes: strings.Join(gd.ECBootnodes, ","), CCBootnodes: strings.Join(gd.CCBootnodes, ","), CCBootnodesList: gd.CCBootnodes, diff --git a/internal/pkg/generate/generate_scripts_test.go b/internal/pkg/generate/generate_scripts_test.go index 86da3d22..ed2c00d1 100644 --- a/internal/pkg/generate/generate_scripts_test.go +++ b/internal/pkg/generate/generate_scripts_test.go @@ -389,6 +389,7 @@ func TestGenerateComposeServices(t *testing.T) { Distributed: true, Network: "holesky", Services: []string{execution, consensus, validator, distributedValidator}, + DvExtraFlags: []string{"extra", "flag"}, }, CheckFunctions: []CheckFunc{defaultFunc, checkValidatorBlocker}, }, diff --git a/internal/pkg/generate/types.go b/internal/pkg/generate/types.go index 267f970d..c0efd708 100644 --- a/internal/pkg/generate/types.go +++ b/internal/pkg/generate/types.go @@ -63,6 +63,7 @@ type GenData struct { ElExtraFlags []string ClExtraFlags []string VlExtraFlags []string + DvExtraFlags []string MapAllPorts bool Mev bool RelayURLs []string @@ -116,6 +117,7 @@ type DockerComposeData struct { ElExtraFlags []string ClExtraFlags []string VlExtraFlags []string + DvExtraFlags []string ECBootnodes string CCBootnodes string CCBootnodesList []string diff --git a/templates/services/merge/distributedValidator/charon.tmpl b/templates/services/merge/distributedValidator/charon.tmpl index f169e632..8660c24e 100644 --- a/templates/services/merge/distributedValidator/charon.tmpl +++ b/templates/services/merge/distributedValidator/charon.tmpl @@ -12,7 +12,10 @@ - CHARON_P2P_TCP_ADDRESS=0.0.0.0:{{.DVDiscoveryPort}} - CHARON_VALIDATOR_API_ADDRESS=127.0.0.1:{{.DVApiPort}} - CHARON_MONITORING_ADDRESS=0.0.0.0:{{.DVMetricsPort}}{{if .MevBoostOnValidator}} - - CHARON_BUILDER_API={{.MevBoostOnValidator}}{{end}} + - CHARON_BUILDER_API={{.MevBoostOnValidator}}{{end}} + {{- range $i, $flag := .DvExtraFlags }} + - {{$flag}} + {{- end }} ports: - ${CHARON_PORT_P2P_TCP:-{{.DVDiscoveryPort}}}:${CHARON_PORT_P2P_TCP:-{{.DVDiscoveryPort}}}/tcp expose: