add all local interfaces to node

This commit is contained in:
Matthew R. Kasun
2022-11-28 11:16:19 -05:00
parent 2a69df0979
commit 6b18ff57c9
5 changed files with 55 additions and 0 deletions

View File

@@ -238,6 +238,14 @@ func JoinNetwork(cfg *config.ClientConfig, privateKey string) error {
logger.Log(1, "network:", cfg.Network, "error retrieving private address: ", err.Error())
}
}
if len(cfg.Node.Interfaces) == 0 {
ip, err := getInterfaces()
if err != nil {
logger.Log(0, "failed to retrive local interfaces", err.Error())
} else {
cfg.Node.Interfaces = *ip
}
}
// set endpoint if blank. set to local if local net, retrieve from function if not
if cfg.Node.Endpoint == "" {