From 669e61af9a378544cee16d4058f99460a5326081 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 13 May 2023 16:15:04 -0500 Subject: [PATCH] update to bugfixed ironwood, fix broken core test, add getPaths handler to admin socket --- go.mod | 2 +- go.sum | 4 ++-- src/admin/admin.go | 30 ++++++++++++++---------------- src/core/core_test.go | 3 ++- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 3c1e2da..5a68591 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/yggdrasil-network/yggdrasil-go go 1.19 require ( - github.com/Arceliar/ironwood v0.0.0-20230513191034-495699d87ae4 + github.com/Arceliar/ironwood v0.0.0-20230513211242-fac5b9486c3c github.com/Arceliar/phony v0.0.0-20220903101357-530938a4b13d github.com/cheggaaa/pb/v3 v3.0.8 github.com/gologme/log v1.2.0 diff --git a/go.sum b/go.sum index ca7fde5..66dfae5 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Arceliar/ironwood v0.0.0-20230513191034-495699d87ae4 h1:I2IlZA7DQAZCR3xasKDJ2YgHbXh1fbyOu0Jqn1i4Zi8= -github.com/Arceliar/ironwood v0.0.0-20230513191034-495699d87ae4/go.mod h1:MIfrhR4b+U6gurd5pln622Zwaf2kzpIvXcnvRZMvlRI= +github.com/Arceliar/ironwood v0.0.0-20230513211242-fac5b9486c3c h1:+MCqerP9VlZw/ECZaDItAgihDDcDGAszgKu/n14WjP0= +github.com/Arceliar/ironwood v0.0.0-20230513211242-fac5b9486c3c/go.mod h1:MIfrhR4b+U6gurd5pln622Zwaf2kzpIvXcnvRZMvlRI= github.com/Arceliar/phony v0.0.0-20220903101357-530938a4b13d h1:UK9fsWbWqwIQkMCz1CP+v5pGbsGoWAw6g4AyvMpm1EM= github.com/Arceliar/phony v0.0.0-20220903101357-530938a4b13d/go.mod h1:BCnxhRf47C/dy/e/D2pmB8NkB3dQVIrkD98b220rx5Q= github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= diff --git a/src/admin/admin.go b/src/admin/admin.go index 75089ba..d0d444b 100644 --- a/src/admin/admin.go +++ b/src/admin/admin.go @@ -145,22 +145,20 @@ func (a *AdminSocket) SetupAdminHandlers() { return res, nil }, ) - /* - _ = a.AddHandler( - "getPaths", "Show established paths through this node", []string{}, - func(in json.RawMessage) (interface{}, error) { - req := &GetPathsRequest{} - res := &GetPathsResponse{} - if err := json.Unmarshal(in, &req); err != nil { - return nil, err - } - if err := a.getPathsHandler(req, res); err != nil { - return nil, err - } - return res, nil - }, - ) - */ + _ = a.AddHandler( + "getPaths", "Show established paths through this node", []string{}, + func(in json.RawMessage) (interface{}, error) { + req := &GetPathsRequest{} + res := &GetPathsResponse{} + if err := json.Unmarshal(in, &req); err != nil { + return nil, err + } + if err := a.getPathsHandler(req, res); err != nil { + return nil, err + } + return res, nil + }, + ) _ = a.AddHandler( "getSessions", "Show established traffic sessions with remote nodes", []string{}, func(in json.RawMessage) (interface{}, error) { diff --git a/src/core/core_test.go b/src/core/core_test.go index f917030..ce28f4e 100644 --- a/src/core/core_test.go +++ b/src/core/core_test.go @@ -75,7 +75,8 @@ func WaitConnected(nodeA, nodeB *Core) bool { return true } */ - if len(nodeA.GetDHT()) > 1 && len(nodeB.GetDHT()) > 1 { + if len(nodeA.GetTree()) > 1 && len(nodeB.GetTree()) > 1 { + time.Sleep(3*time.Second) // FIXME hack, there's still stuff happening internally return true } }