Refactored code for NetworkDomain, added NetworkDomain.Prefix parameter to Mobile module

This commit is contained in:
vadym 2022-12-11 14:52:15 +02:00
parent 8da27aad4f
commit 56ed2bd629
8 changed files with 24 additions and 36 deletions

View file

@ -47,13 +47,17 @@ func (m *Mesh) StartJSON(configjson []byte) error {
if err := json.Unmarshal(configjson, &m.config); err != nil {
return err
}
// Setup the Yggdrasil node itself.
// Setup the Mesh node itself.
{
sk, err := hex.DecodeString(m.config.PrivateKey)
if err != nil {
panic(err)
}
options := []core.SetupOption{}
options := []core.SetupOption{
core.NodeInfo(m.config.NodeInfo),
core.NodeInfoPrivacy(m.config.NodeInfoPrivacy),
core.NetworkDomain(m.config.NetworkDomain),
}
for _, peer := range m.config.Peers {
options = append(options, core.Peer{URI: peer})
}