aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/puppeth/wizard.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-05-03 15:09:34 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-05-03 15:09:34 +0800
commitcf4faa491a699e2a9397ad3809695cc9c0965662 (patch)
tree62ca961f5f70d8351e10c1e0dd5c6b431b21f373 /cmd/puppeth/wizard.go
parent59966255add632e3ef09799a8b994ec982bd415a (diff)
downloaddexon-cf4faa491a699e2a9397ad3809695cc9c0965662.tar.gz
dexon-cf4faa491a699e2a9397ad3809695cc9c0965662.tar.zst
dexon-cf4faa491a699e2a9397ad3809695cc9c0965662.zip
cmd/puppeth, vendor: update ssh, manage server keys (#14398)
Diffstat (limited to 'cmd/puppeth/wizard.go')
-rw-r--r--cmd/puppeth/wizard.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go
index 92d7962a0..9687d5e0d 100644
--- a/cmd/puppeth/wizard.go
+++ b/cmd/puppeth/wizard.go
@@ -44,14 +44,24 @@ type config struct {
bootLight []string // Bootnodes to always connect to by light nodes
ethstats string // Ethstats settings to cache for node deploys
- Servers []string `json:"servers,omitempty"`
+ Servers map[string][]byte `json:"servers,omitempty"`
+}
+
+// servers retrieves an alphabetically sorted list of servers.
+func (c config) servers() []string {
+ servers := make([]string, 0, len(c.Servers))
+ for server := range c.Servers {
+ servers = append(servers, server)
+ }
+ sort.Strings(servers)
+
+ return servers
}
// flush dumps the contents of config to disk.
func (c config) flush() {
os.MkdirAll(filepath.Dir(c.path), 0755)
- sort.Strings(c.Servers)
out, _ := json.MarshalIndent(c, "", " ")
if err := ioutil.WriteFile(c.path, out, 0644); err != nil {
log.Warn("Failed to save puppeth configs", "file", c.path, "err", err)