diff --git a/CHANGELOG.md b/CHANGELOG.md index d09de1b..fcfcfcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +dev: + - clarify that --connection should be a URL + 1.15.0: - add --period to "synccommittee members", can be "current", "next" - add "validator expectation" diff --git a/cmd/root.go b/cmd/root.go index 491c8bf..587d444 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -201,7 +201,7 @@ func init() { if err := viper.BindPFlag("debug", RootCmd.PersistentFlags().Lookup("debug")); err != nil { panic(err) } - RootCmd.PersistentFlags().String("connection", "localhost:4000", "connection to an Ethereum 2 node") + RootCmd.PersistentFlags().String("connection", "http://localhost:3500", "URL to an Ethereum 2 node's RET API endpoint") if err := viper.BindPFlag("connection", RootCmd.PersistentFlags().Lookup("connection")); err != nil { panic(err) } diff --git a/util/beaconnode.go b/util/beaconnode.go index 8997773..8174510 100644 --- a/util/beaconnode.go +++ b/util/beaconnode.go @@ -32,6 +32,9 @@ func ConnectToBeaconNode(ctx context.Context, address string, timeout time.Durat return nil, errors.New("no timeout specified") } + if !strings.HasPrefix(address, "http") { + address = fmt.Sprintf("http://%s", address) + } if !allowInsecure { // Ensure the connection is either secure or local. connectionURL, err := url.Parse(address)