mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Use metadata from config file
This commit is contained in:
parent
d9884a5cac
commit
92bb63f196
3 changed files with 42 additions and 31 deletions
|
@ -2,13 +2,11 @@ package yggdrasil
|
|||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"regexp"
|
||||
"runtime"
|
||||
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/defaults"
|
||||
|
@ -126,15 +124,7 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error {
|
|||
c.admin.init(c, nc.AdminListen)
|
||||
|
||||
c.metadata.init(c)
|
||||
m := map[string]string{
|
||||
"buildname": GetBuildName(),
|
||||
"buildversion": GetBuildVersion(),
|
||||
"buildplatform": runtime.GOOS,
|
||||
"buildarch": runtime.GOARCH,
|
||||
}
|
||||
if json, err := json.Marshal(m); err == nil {
|
||||
c.metadata.setMetadata(json)
|
||||
}
|
||||
c.metadata.setMetadata(nc.Metadata)
|
||||
|
||||
if err := c.tcp.init(c, nc.Listen, nc.ReadTimeout); err != nil {
|
||||
c.log.Println("Failed to start TCP interface")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue