Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dv extra flags feature #23

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cli/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ type GenCmdFlags struct {
elExtraFlags []string
clExtraFlags []string
vlExtraFlags []string
dvExtraFlags []string
relayURLs []string
mevBoostUrl string
executionApiUrl string
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions cli/sub_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Additionally, you can use this syntax '<CLIENT>:<DOCKER_IMAGE>' 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 \"<flag1>=value1\" --el-extra-flag \"<flag2>=\\\"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 \"<flag1>=value1\" --cl-extra-flag \"<flag2>=\\\"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 \"<flag1>=value1\" --vl-extra-flag \"<flag2>=\\\"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 \"<flag1>=value1\" --dv-extra-flag \"<flag2>=\\\"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.")
Expand Down
1 change: 1 addition & 0 deletions docs/docs/commands/generate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<flag1>=value1" --el-extra-flag "<flag2>=\"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 "<flag1>=value1" --cl-extra-flag "<flag2>=\"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 "<flag1>=value1" --vl-extra-flag "<flag2>=\"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 "<flag1>=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.
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/generate/generate_scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/generate/generate_scripts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/generate/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type GenData struct {
ElExtraFlags []string
ClExtraFlags []string
VlExtraFlags []string
DvExtraFlags []string
MapAllPorts bool
Mev bool
RelayURLs []string
Expand Down Expand Up @@ -116,6 +117,7 @@ type DockerComposeData struct {
ElExtraFlags []string
ClExtraFlags []string
VlExtraFlags []string
DvExtraFlags []string
ECBootnodes string
CCBootnodes string
CCBootnodesList []string
Expand Down
5 changes: 4 additions & 1 deletion templates/services/merge/distributedValidator/charon.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading