File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -5,19 +5,25 @@ import (
55)
66
77type Config struct {
8- Url string `toml:"url"`
9- Port int `toml:"port"`
8+ Socket string `toml:"socket"`
9+ PublicKeys []string `toml:"publickeys"`
10+
11+ // Deprecated
1012 SocketPath string `toml:"socketPath"`
11- OtherNodeUrls []string `toml:"otherNodeUrls"`
1213 PublicKeyPath string `toml:"publicKeyPath"`
13- PrivateKeyPath string `toml:"privateKeyPath"`
14- StoragePath string `toml:"storagePath"`
1514}
1615
1716func LoadConfig (configPath string ) (* Config , error ) {
1817 cfg := new (Config )
1918 if _ , err := toml .DecodeFile (configPath , cfg ); err != nil {
2019 return nil , err
2120 }
21+ // Fall back to Constellation 0.0.1 config format if necessary
22+ if cfg .Socket == "" {
23+ cfg .Socket = cfg .SocketPath
24+ }
25+ if len (cfg .PublicKeys ) == 0 {
26+ cfg .PublicKeys = append (cfg .PublicKeys , cfg .PublicKeyPath )
27+ }
2228 return cfg , nil
2329}
Original file line number Diff line number Diff line change @@ -56,11 +56,11 @@ func New(configPath string) (*Constellation, error) {
5656 if err != nil {
5757 return nil , err
5858 }
59- err = RunNode (configPath , cfg .SocketPath )
59+ err = RunNode (configPath , cfg .Socket )
6060 if err != nil {
6161 return nil , err
6262 }
63- n , err := NewClient (cfg .PublicKeyPath , cfg .SocketPath )
63+ n , err := NewClient (cfg .PublicKeys [ 0 ] , cfg .Socket )
6464 if err != nil {
6565 return nil , err
6666 }
You can’t perform that action at this time.
0 commit comments