mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 17:40:26 +00:00
more sim work
This commit is contained in:
parent
9c818c6278
commit
5db93be4df
@ -5,19 +5,24 @@ import (
|
|||||||
|
|
||||||
"github.com/gologme/log"
|
"github.com/gologme/log"
|
||||||
|
|
||||||
//"github.com/yggdrasil-network/yggdrasil-go/src/address"
|
|
||||||
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
"github.com/yggdrasil-network/yggdrasil-go/src/config"
|
||||||
//"github.com/yggdrasil-network/yggdrasil-go/src/crypto"
|
"github.com/yggdrasil-network/yggdrasil-go/src/crypto"
|
||||||
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
|
||||||
)
|
)
|
||||||
|
|
||||||
type simNode struct {
|
type simNode struct {
|
||||||
core yggdrasil.Core
|
core yggdrasil.Core
|
||||||
id int
|
id int
|
||||||
|
nodeID crypto.NodeID
|
||||||
|
dialer *yggdrasil.Dialer
|
||||||
|
listener *yggdrasil.Listener
|
||||||
}
|
}
|
||||||
|
|
||||||
func newNode(id int) *simNode {
|
func newNode(id int) *simNode {
|
||||||
n := simNode{id: id}
|
n := simNode{id: id}
|
||||||
n.core.Start(config.GenerateConfig(), log.New(ioutil.Discard, "", 0))
|
n.core.Start(config.GenerateConfig(), log.New(ioutil.Discard, "", 0))
|
||||||
|
n.nodeID = *n.core.NodeID()
|
||||||
|
n.dialer, _ = n.core.ConnDialer()
|
||||||
|
n.listener, _ = n.core.ConnListen()
|
||||||
return &n
|
return &n
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user