Skip to content

Commit

Permalink
able to write config to client.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberbono3 committed Mar 15, 2021
1 parent 20f5f98 commit f4f6dde
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions client/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const defaultConfigTemplate = `# This is a TOML config file.
###############################################################################
chain-id = "{{ .ClientConfig.ChainID }}"
keyring-backend = "{{ .ClientConfig.KeyringBackend }}"
output = "{{ .ClientConfig.Output }}"
node = "{{ .ClientConfig.Node }}"
broadcast-mode = "{{ .ClientConfig.BroadcastMode }}"
trace = "{{ .ClientConfig.Trace }}"
chain-id = "{{ .ChainID }}"
keyring-backend = "{{ .KeyringBackend }}"
output = "{{ .Output }}"
node = "{{ .Node }}"
broadcast-mode = "{{ .BroadcastMode }}"
trace = "{{ .Trace }}"
`

// InitConfigTemplate initiates config template that will be used in
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ require (
github.com/improbable-eng/grpc-web v0.14.0
github.com/magiconair/properties v1.8.4
github.com/mattn/go-isatty v0.0.12
github.com/mitchellh/mapstructure v1.3.3
github.com/otiai10/copy v1.5.0
github.com/pelletier/go-toml v1.8.1
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/common v0.18.0
Expand Down
1 change: 1 addition & 0 deletions server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ func interceptConfigs(rootViper *viper.Viper) (*tmcfg.Config, error) {
return nil, fmt.Errorf("failed to merge configuration: %w", err)
}

// TODO test It if it works
// Adding default ClientConfig and writing it into "client.toml"
cliCfgFilePath := filepath.Join(configPath, "client.toml")
// if _, err := os.Stat(cliCfgFilePath); os.IsNotExist(err) {
Expand Down

0 comments on commit f4f6dde

Please sign in to comment.