Merge branch 'develop' of https://github.com/yggdrasil-network/yggdrasil-go into yggdrasil-v0.4.7-develop

This commit is contained in:
vadym 2022-12-01 14:36:36 +02:00
commit 35cc180647
20 changed files with 309 additions and 178 deletions

View file

@ -13,8 +13,9 @@ import (
"net"
"os"
c "github.com/RiV-chain/RiV-mesh/src/core"
"github.com/cheggaaa/pb/v3"
"github.com/RiV-chain/RiV-mesh/src/address"
"github.com/gologme/log"
)
var numHosts = flag.Int("hosts", 1, "number of host vars to generate")
@ -35,7 +36,6 @@ func main() {
println("Can't generate less keys than hosts.")
return
}
var keys []keySet
for i := 0; i < *numHosts+1; i++ {
keys = append(keys, newKey())
@ -77,7 +77,9 @@ func newKey() keySet {
if err != nil {
panic(err)
}
ip := net.IP(address.AddrForKey(pub)[:]).String()
logger := log.New(os.Stdout, "", log.Flags())
core, _ := c.New(priv, logger, nil)
ip := net.IP(core.AddrForKey(pub)[:]).String()
return keySet{priv[:], pub[:], ip}
}