fix: need to fix construction od node and stick to using interfaces
This commit is contained in:
parent
99167b4cec
commit
311b03737c
|
@ -4,6 +4,7 @@ import (
|
||||||
"git.lumeweb.com/LumeWeb/libs5-go/config"
|
"git.lumeweb.com/LumeWeb/libs5-go/config"
|
||||||
"git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
"git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
||||||
"git.lumeweb.com/LumeWeb/libs5-go/interfaces"
|
"git.lumeweb.com/LumeWeb/libs5-go/interfaces"
|
||||||
|
"git.lumeweb.com/LumeWeb/libs5-go/service"
|
||||||
"git.lumeweb.com/LumeWeb/libs5-go/structs"
|
"git.lumeweb.com/LumeWeb/libs5-go/structs"
|
||||||
"git.lumeweb.com/LumeWeb/libs5-go/utils"
|
"git.lumeweb.com/LumeWeb/libs5-go/utils"
|
||||||
"github.com/vmihailenco/msgpack/v5"
|
"github.com/vmihailenco/msgpack/v5"
|
||||||
|
@ -29,13 +30,16 @@ func (n *NodeImpl) Services() interfaces.Services {
|
||||||
return n.services
|
return n.services
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewNode(config *config.NodeConfig) *NodeImpl {
|
func NewNode(config *config.NodeConfig) interfaces.Node {
|
||||||
return &NodeImpl{
|
n := &NodeImpl{
|
||||||
nodeConfig: config,
|
nodeConfig: config,
|
||||||
metadataCache: structs.NewMap(),
|
metadataCache: structs.NewMap(),
|
||||||
started: false,
|
started: false,
|
||||||
hashQueryRoutingTable: structs.NewMap(),
|
hashQueryRoutingTable: structs.NewMap(),
|
||||||
}
|
}
|
||||||
|
n.services = NewServices(service.NewP2P(n))
|
||||||
|
|
||||||
|
return n
|
||||||
}
|
}
|
||||||
func (n *NodeImpl) HashQueryRoutingTable() structs.Map {
|
func (n *NodeImpl) HashQueryRoutingTable() structs.Map {
|
||||||
return n.hashQueryRoutingTable
|
return n.hashQueryRoutingTable
|
||||||
|
|
Loading…
Reference in New Issue