From 311b03737c8d8100205e48c5a3a5cd501865a07a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 7 Jan 2024 04:16:18 -0500 Subject: [PATCH] fix: need to fix construction od node and stick to using interfaces --- node/node.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/node/node.go b/node/node.go index a539282..fd2b5a1 100644 --- a/node/node.go +++ b/node/node.go @@ -4,6 +4,7 @@ import ( "git.lumeweb.com/LumeWeb/libs5-go/config" "git.lumeweb.com/LumeWeb/libs5-go/encoding" "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/utils" "github.com/vmihailenco/msgpack/v5" @@ -29,13 +30,16 @@ func (n *NodeImpl) Services() interfaces.Services { return n.services } -func NewNode(config *config.NodeConfig) *NodeImpl { - return &NodeImpl{ +func NewNode(config *config.NodeConfig) interfaces.Node { + n := &NodeImpl{ nodeConfig: config, metadataCache: structs.NewMap(), started: false, hashQueryRoutingTable: structs.NewMap(), } + n.services = NewServices(service.NewP2P(n)) + + return n } func (n *NodeImpl) HashQueryRoutingTable() structs.Map { return n.hashQueryRoutingTable