Update parameter names; add fallback connection.

Update parameter names to meet newer standards.

Provide a fallback beacon node if none other supplied.
This commit is contained in:
Jim McDonald
2023-04-09 23:19:19 +01:00
parent df99d43415
commit 2c01d18195
58 changed files with 491 additions and 521 deletions

View File

@@ -37,7 +37,12 @@ In quiet mode this will return 0 if the chain information can be obtained, other
Run: func(cmd *cobra.Command, args []string) {
ctx := context.Background()
eth2Client, err := util.ConnectToBeaconNode(ctx, viper.GetString("connection"), viper.GetDuration("timeout"), viper.GetBool("allow-insecure-connections"))
eth2Client, err := util.ConnectToBeaconNode(ctx, &util.ConnectOpts{
Address: viper.GetString("connection"),
Timeout: viper.GetDuration("timeout"),
AllowInsecure: viper.GetBool("allow-insecure-connections"),
LogFallback: !viper.GetBool("quiet"),
})
errCheck(err, "Failed to connect to Ethereum 2 beacon node")
config, err := eth2Client.(eth2client.SpecProvider).Spec(ctx)