Skip to content

Commit

Permalink
refactor: Update struct fields in main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mattevans committed Dec 16, 2024
1 parent 1cc5c6f commit 611685e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions cmd/sentry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ var (
)

type ContributoorConfig struct {
Version string `yaml:"version"`
ContributoorDirectory string `yaml:"contributoorDirectory"`
RunMethod string `yaml:"runMethod"`
Network *NetworkConfig `yaml:"network"`
Version string `yaml:"version"`
ContributoorDirectory string `yaml:"contributoorDirectory"`
RunMethod string `yaml:"runMethod"`
NetworkName string `yaml:"networkName"`
BeaconNodeAddress string `yaml:"beaconNodeAddress"`
OutputServer *OutputServerConfig `yaml:"outputServer"`
}

type NetworkConfig struct {
Name string `yaml:"name"`
BeaconNodeAddress string `yaml:"beaconNodeAddress"`
type OutputServerConfig struct {
Address string `yaml:"address"`
Credentials string `yaml:"credentials,omitempty"`
}

var rootCmd = &cobra.Command{
Expand All @@ -38,8 +40,9 @@ var rootCmd = &cobra.Command{

logCtx := log.WithFields(logrus.Fields{
"config_path": config.ContributoorDirectory,
"network_name": config.Network.Name,
"beacon_address": config.Network.BeaconNodeAddress,
"network_name": config.NetworkName,
"beacon_address": config.BeaconNodeAddress,
"output_server": config.OutputServer.Address,
"version": config.Version,
})

Expand Down

0 comments on commit 611685e

Please sign in to comment.