From 40b6a6531cb9d79b54df85110a931f5fd201a1af Mon Sep 17 00:00:00 2001 From: Moses Narrow Date: Tue, 17 Dec 2024 13:16:59 -0600 Subject: [PATCH 1/2] replace imports starting with github.com/skycoin/skywire-utilities with github.com/skycoin/skywire/pkg/skywire-utilities --- Makefile | 2 +- cmd/dmsg-discovery/commands/dmsg-discovery.go | 10 +- cmd/dmsg-server/commands/root.go | 2 +- cmd/dmsg-server/commands/start/root.go | 8 +- cmd/dmsg-socks5/commands/dmsg-socks5.go | 6 +- cmd/dmsgcurl/commands/dmsgcurl.go | 8 +- cmd/dmsghttp/commands/dmsghttp.go | 8 +- cmd/dmsgip/commands/dmsgip.go | 8 +- cmd/dmsgpty-cli/commands/root.go | 4 +- cmd/dmsgpty-cli/commands/whitelist.go | 2 +- cmd/dmsgpty-host/commands/root.go | 8 +- cmd/dmsgpty-ui/commands/dmsgpty-ui.go | 2 +- cmd/dmsgweb/commands/dmsgweb.go | 8 +- cmd/dmsgweb/commands/dmsgwebsrv.go | 6 +- cmd/dmsgweb/commands/root.go | 4 +- examples/basics/main.go | 2 +- .../dmsg-example-http-server.go | 6 +- examples/dmsgcurl/gen-keys/gen-keys.go | 2 +- examples/proxified/main.go | 4 +- go.mod | 18 +- go.sum | 70 +-- internal/discmetrics/victoria_metrics.go | 2 +- internal/dmsg-discovery/api/api.go | 12 +- .../api/entries_endpoint_test.go | 4 +- .../api/get_available_servers_test.go | 4 +- internal/dmsg-discovery/store/redis.go | 6 +- internal/dmsg-discovery/store/redis_test.go | 4 +- internal/dmsg-discovery/store/storer.go | 4 +- internal/dmsg-discovery/store/testing.go | 2 +- internal/dmsg-server/api/api.go | 8 +- internal/servermetrics/victoria_metrics.go | 2 +- pkg/direct/client.go | 4 +- pkg/direct/direct.go | 4 +- pkg/direct/entries.go | 2 +- pkg/disc/client.go | 4 +- pkg/disc/client_mock_test.go | 2 +- pkg/disc/entry.go | 2 +- pkg/disc/entry_test.go | 4 +- pkg/disc/testing.go | 2 +- pkg/dmsg/client.go | 6 +- pkg/dmsg/client_session.go | 4 +- pkg/dmsg/entity_common.go | 6 +- pkg/dmsg/listener.go | 2 +- pkg/dmsg/server.go | 6 +- pkg/dmsg/server_session.go | 2 +- pkg/dmsg/session_common.go | 2 +- pkg/dmsg/stream.go | 2 +- pkg/dmsg/stream_test.go | 4 +- pkg/dmsg/types.go | 2 +- pkg/dmsgcurl/dmsgcurl.go | 4 +- pkg/dmsgcurl/dmsgcurl_test.go | 6 +- pkg/dmsgcurl/flags.go | 2 +- pkg/dmsghttp/examples_test.go | 6 +- pkg/dmsghttp/http.go | 4 +- pkg/dmsghttp/http_test.go | 2 +- pkg/dmsghttp/http_transport_test.go | 6 +- pkg/dmsghttp/util.go | 2 +- pkg/dmsgpty/cli.go | 4 +- pkg/dmsgpty/host.go | 4 +- pkg/dmsgpty/host_test.go | 4 +- pkg/dmsgpty/pty_client.go | 4 +- pkg/dmsgpty/ui.go | 4 +- pkg/dmsgpty/whitelist.go | 2 +- pkg/dmsgpty/whitelist_client.go | 2 +- pkg/dmsgpty/whitelist_gateway.go | 2 +- pkg/dmsgserver/config.go | 2 +- pkg/dmsgtest/dmsg_client_test.go | 4 +- pkg/dmsgtest/env.go | 2 +- pkg/ioutil/logging.go | 2 +- pkg/noise/net.go | 2 +- pkg/noise/net_test.go | 2 +- pkg/noise/noise.go | 4 +- pkg/noise/noise_test.go | 4 +- pkg/noise/read_writer.go | 2 +- pkg/noise/read_writer_test.go | 2 +- vendor/github.com/fatih/color/README.md | 23 +- vendor/github.com/fatih/color/color.go | 32 +- .../skycoin/src/cipher/base58/base58_old.go | 6 +- .../skycoin/skycoin/src/cipher/crypto.go | 2 +- .../secp256k1-go/secp256k1-go2/secp256k1.go | 4 +- .../cipher/secp256k1-go/secp256k1-go2/xy.go | 2 +- .../github.com/skycoin/skywire/.golangci.yml | 3 + .../github.com/skycoin/skywire/CHANGELOG.md | 15 + vendor/github.com/skycoin/skywire/Makefile | 27 +- .../skycoin/skywire/mainnet_rules.md | 341 ++++++------- .../pkg/buildinfo/buildinfo.go | 81 ++++ .../skywire-utilities/pkg/cipher/cipher.go | 266 +++++++++++ .../pkg/cipher/utils_pubkey.go | 24 + .../skywire-utilities/pkg/cmdutil/catch.go | 0 .../skywire-utilities/pkg/cmdutil/cmd_name.go | 0 .../pkg/cmdutil/service_flags.go | 0 .../pkg/cmdutil/signal_context.go | 0 .../pkg/cmdutil/signal_unix.go | 0 .../pkg/cmdutil/signal_windows.go | 0 .../pkg/cmdutil/sysloghook_unix.go | 0 .../pkg/cmdutil/sysloghook_windows.go | 0 .../pkg/httputil/dmsghttp.go | 0 .../skywire-utilities/pkg/httputil/error.go | 0 .../skywire-utilities/pkg/httputil/health.go | 0 .../pkg/httputil/httputil.go | 0 .../skywire-utilities/pkg/httputil/log.go | 0 .../pkg/logging/formatter.go | 449 ++++++++++++++++++ .../skywire-utilities/pkg/logging/hooks.go | 45 ++ .../skywire-utilities/pkg/logging/logger.go | 69 +++ .../skywire-utilities/pkg/logging/logging.go | 85 ++++ .../skywire-utilities/pkg/metricsutil/http.go | 2 +- .../request_duration_middleware.go | 0 .../requests_in_flight_count_middleware.go | 0 .../pkg/metricsutil/status_response_writer.go | 4 +- .../victoria_metrics_int_gauge_wrapper.go | 0 .../victoria_metrics_uint_gauge_wrapper.go | 0 .../skywire-utilities/pkg/netutil/copy.go | 0 .../pkg}/skywire-utilities/pkg/netutil/net.go | 4 +- .../pkg/netutil/net_darwin.go | 0 .../pkg/netutil/net_linux.go | 0 .../pkg/netutil/net_windows.go | 0 .../skywire-utilities/pkg/netutil/porter.go | 0 .../skywire-utilities/pkg/netutil/retrier.go | 0 .../pkg/networkmonitor/networkmonitor.go | 0 vendor/github.com/skycoin/skywire/skywire.go | 26 +- vendor/modules.txt | 29 +- 121 files changed, 1461 insertions(+), 458 deletions(-) create mode 100644 vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo/buildinfo.go create mode 100644 vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher/cipher.go create mode 100644 vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher/utils_pubkey.go rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/cmdutil/catch.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/cmdutil/cmd_name.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/cmdutil/service_flags.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/cmdutil/signal_context.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/cmdutil/signal_unix.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/cmdutil/signal_windows.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/cmdutil/sysloghook_unix.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/cmdutil/sysloghook_windows.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/httputil/dmsghttp.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/httputil/error.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/httputil/health.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/httputil/httputil.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/httputil/log.go (100%) create mode 100644 vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/formatter.go create mode 100644 vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/hooks.go create mode 100644 vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/logger.go create mode 100644 vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/logging.go rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/metricsutil/http.go (92%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/metricsutil/request_duration_middleware.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/metricsutil/requests_in_flight_count_middleware.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/metricsutil/status_response_writer.go (97%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/netutil/copy.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/netutil/net.go (97%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/netutil/net_darwin.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/netutil/net_linux.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/netutil/net_windows.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/netutil/porter.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/netutil/retrier.go (100%) rename vendor/github.com/skycoin/{ => skywire/pkg}/skywire-utilities/pkg/networkmonitor/networkmonitor.go (100%) diff --git a/Makefile b/Makefile index bce6356cf..65121302d 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ ifneq (,$(findstring 64,$(GOARCH))) endif DMSG_REPO := github.com/skycoin/dmsg -SKYWIRE_UTILITIES_BASE := github.com/skycoin/skywire-utilities +SKYWIRE_UTILITIES_BASE := github.com/skycoin/skywire/pkg/skywire-utilities BUILDINFO_PATH := $(SKYWIRE_UTILITIES_BASE)/pkg/buildinfo BUILDINFO_VERSION := -X $(BUILDINFO_PATH).version=$(VERSION) diff --git a/cmd/dmsg-discovery/commands/dmsg-discovery.go b/cmd/dmsg-discovery/commands/dmsg-discovery.go index 3f60d4ed3..efa31a9f6 100644 --- a/cmd/dmsg-discovery/commands/dmsg-discovery.go +++ b/cmd/dmsg-discovery/commands/dmsg-discovery.go @@ -15,11 +15,11 @@ import ( proxyproto "github.com/pires/go-proxyproto" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" "github.com/spf13/cobra" "github.com/skycoin/dmsg/internal/discmetrics" diff --git a/cmd/dmsg-server/commands/root.go b/cmd/dmsg-server/commands/root.go index 2c64cc0c6..da11d3bde 100644 --- a/cmd/dmsg-server/commands/root.go +++ b/cmd/dmsg-server/commands/root.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" "github.com/spf13/cobra" "github.com/skycoin/dmsg/cmd/dmsg-server/commands/config" diff --git a/cmd/dmsg-server/commands/start/root.go b/cmd/dmsg-server/commands/start/root.go index 7217670a4..8a4b76d4b 100644 --- a/cmd/dmsg-server/commands/start/root.go +++ b/cmd/dmsg-server/commands/start/root.go @@ -13,10 +13,10 @@ import ( chi "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" "github.com/spf13/cobra" "github.com/skycoin/dmsg/internal/dmsg-server/api" diff --git a/cmd/dmsg-socks5/commands/dmsg-socks5.go b/cmd/dmsg-socks5/commands/dmsg-socks5.go index e7eac5c74..05d6b3d77 100644 --- a/cmd/dmsg-socks5/commands/dmsg-socks5.go +++ b/cmd/dmsg-socks5/commands/dmsg-socks5.go @@ -15,9 +15,9 @@ import ( socks5 "github.com/confiant-inc/go-socks5" "github.com/skycoin/skywire" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/cmd/dmsgcurl/commands/dmsgcurl.go b/cmd/dmsgcurl/commands/dmsgcurl.go index b5397090f..4f0b73630 100644 --- a/cmd/dmsgcurl/commands/dmsgcurl.go +++ b/cmd/dmsgcurl/commands/dmsgcurl.go @@ -19,10 +19,10 @@ import ( "github.com/sirupsen/logrus" "github.com/skycoin/skywire" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/cmd/dmsghttp/commands/dmsghttp.go b/cmd/dmsghttp/commands/dmsghttp.go index 292957fc6..cd86b346f 100644 --- a/cmd/dmsghttp/commands/dmsghttp.go +++ b/cmd/dmsghttp/commands/dmsghttp.go @@ -14,10 +14,10 @@ import ( "strings" "time" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/cmd/dmsgip/commands/dmsgip.go b/cmd/dmsgip/commands/dmsgip.go index 7a875d8e1..e6b1caea6 100644 --- a/cmd/dmsgip/commands/dmsgip.go +++ b/cmd/dmsgip/commands/dmsgip.go @@ -10,10 +10,10 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/cmd/dmsgpty-cli/commands/root.go b/cmd/dmsgpty-cli/commands/root.go index 811b7b236..a4c517fdb 100644 --- a/cmd/dmsgpty-cli/commands/root.go +++ b/cmd/dmsgpty-cli/commands/root.go @@ -10,8 +10,8 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" "github.com/spf13/cobra" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/cmd/dmsgpty-cli/commands/whitelist.go b/cmd/dmsgpty-cli/commands/whitelist.go index 4d0e7e96c..1208ce70a 100644 --- a/cmd/dmsgpty-cli/commands/whitelist.go +++ b/cmd/dmsgpty-cli/commands/whitelist.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/spf13/cobra" ) diff --git a/cmd/dmsgpty-host/commands/root.go b/cmd/dmsgpty-host/commands/root.go index 753ff3beb..6e89fbfa5 100644 --- a/cmd/dmsgpty-host/commands/root.go +++ b/cmd/dmsgpty-host/commands/root.go @@ -15,10 +15,10 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/cmd/dmsgpty-ui/commands/dmsgpty-ui.go b/cmd/dmsgpty-ui/commands/dmsgpty-ui.go index 140a2312e..665944339 100644 --- a/cmd/dmsgpty-ui/commands/dmsgpty-ui.go +++ b/cmd/dmsgpty-ui/commands/dmsgpty-ui.go @@ -11,7 +11,7 @@ import ( "time" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/dmsgpty" diff --git a/cmd/dmsgweb/commands/dmsgweb.go b/cmd/dmsgweb/commands/dmsgweb.go index d7f94cee2..e8dab2939 100644 --- a/cmd/dmsgweb/commands/dmsgweb.go +++ b/cmd/dmsgweb/commands/dmsgweb.go @@ -21,10 +21,10 @@ import ( "github.com/chen3feng/safecast" "github.com/confiant-inc/go-socks5" "github.com/gin-gonic/gin" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "golang.org/x/net/proxy" diff --git a/cmd/dmsgweb/commands/dmsgwebsrv.go b/cmd/dmsgweb/commands/dmsgwebsrv.go index 181d426ad..19401d2ff 100644 --- a/cmd/dmsgweb/commands/dmsgwebsrv.go +++ b/cmd/dmsgweb/commands/dmsgwebsrv.go @@ -18,9 +18,9 @@ import ( "github.com/bitfield/script" "github.com/chen3feng/safecast" "github.com/gin-gonic/gin" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/cmd/dmsgweb/commands/root.go b/cmd/dmsgweb/commands/root.go index 38d1e7580..6cdebdf1e 100644 --- a/cmd/dmsgweb/commands/root.go +++ b/cmd/dmsgweb/commands/root.go @@ -17,8 +17,8 @@ import ( "github.com/bitfield/script" "github.com/chen3feng/safecast" "github.com/gin-gonic/gin" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/examples/basics/main.go b/examples/basics/main.go index fae8557af..7d545ccc9 100644 --- a/examples/basics/main.go +++ b/examples/basics/main.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "golang.org/x/net/nettest" "github.com/skycoin/dmsg/pkg/disc" diff --git a/examples/dmsgcurl/dmsg-example-http-server/dmsg-example-http-server.go b/examples/dmsgcurl/dmsg-example-http-server/dmsg-example-http-server.go index 44cff2f4f..c2a8daff0 100644 --- a/examples/dmsgcurl/dmsg-example-http-server/dmsg-example-http-server.go +++ b/examples/dmsgcurl/dmsg-example-http-server/dmsg-example-http-server.go @@ -9,9 +9,9 @@ import ( "path" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/examples/dmsgcurl/gen-keys/gen-keys.go b/examples/dmsgcurl/gen-keys/gen-keys.go index d8b958ca9..312bd9b29 100644 --- a/examples/dmsgcurl/gen-keys/gen-keys.go +++ b/examples/dmsgcurl/gen-keys/gen-keys.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) func main() { diff --git a/examples/proxified/main.go b/examples/proxified/main.go index 880afb29d..f5f1b3f9e 100644 --- a/examples/proxified/main.go +++ b/examples/proxified/main.go @@ -5,8 +5,8 @@ import ( "net/http" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "golang.org/x/net/proxy" "github.com/skycoin/dmsg/pkg/disc" diff --git a/go.mod b/go.mod index 9567f1fd9..e0652386b 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/skycoin/dmsg -go 1.22 +go 1.23 -toolchain go1.23.1 +toolchain go1.23.4 require ( github.com/ActiveState/termtest/conpty v0.5.0 @@ -21,9 +21,8 @@ require ( github.com/pires/go-proxyproto v0.8.0 github.com/sirupsen/logrus v1.9.3 github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 - github.com/skycoin/skycoin v0.28.0 - github.com/skycoin/skywire v1.3.28 - github.com/skycoin/skywire-utilities v1.3.25 + github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f + github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 golang.org/x/net v0.30.0 @@ -38,9 +37,9 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/fatih/color v1.17.0 // indirect + github.com/fatih/color v1.18.0 // indirect github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-playground/locales v0.14.1 // indirect @@ -58,7 +57,8 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/skycoin/skywire-utilities v1.3.25 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect @@ -68,7 +68,6 @@ require ( golang.org/x/crypto v0.28.0 // indirect golang.org/x/text v0.19.0 // indirect google.golang.org/protobuf v1.35.1 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect mvdan.cc/sh/v3 v3.9.0 // indirect ) @@ -76,6 +75,7 @@ require ( // Uncomment for tests with alternate branches of 'skywire-utilities' //replace github.com/skycoin/skywire => ../skywire //replace github.com/skycoin/skywire => github.com/skycoin/skywire +//replace github.com/skycoin/skywire => github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb // replace github.com/skycoin/skywire-utilities => ../skywire-utilities // replace github.com/skycoin/skywire-utilities => github.com/skycoin/skywire-utilities diff --git a/go.sum b/go.sum index bc8e95f4b..4bf8bc681 100644 --- a/go.sum +++ b/go.sum @@ -3,20 +3,15 @@ github.com/ActiveState/termtest/conpty v0.5.0/go.mod h1:LO4208FLsxw6DcNZ1UtuGUMW github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/VictoriaMetrics/metrics v1.35.1 h1:o84wtBKQbzLdDy14XeskkCZih6anG+veZ1SwJHFGwrU= github.com/VictoriaMetrics/metrics v1.35.1/go.mod h1:r7hveu6xMdUACXvB8TYdAj8WEsKzWB0EkpJN+RDtOf8= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/bitfield/script v0.23.0 h1:N0R5yLEl6wJIS9PR/A6xXwjMsplMubyxdi05N5l0X28= github.com/bitfield/script v0.23.0/go.mod h1:fv+6x4OzVsRs6qAlc7wiGq8fq1b5orhtQdtW0dwjUHI= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/cenkalti/backoff v1.1.0/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chen3feng/safecast v0.0.0-20220908170618-81b2ecd47937 h1:gJMTUTnqa+f2GzdU1p3UVa3E39hogZdiRHEgBBnqtVc= @@ -34,16 +29,16 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/creack/pty v1.1.23 h1:4M6+isWdcStXEf15G/RbrMPOQj1dZ7HPZCGwE4kOeP0= github.com/creack/pty v1.1.23/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= -github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc= github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -66,11 +61,9 @@ github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -88,33 +81,22 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -126,48 +108,34 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pires/go-proxyproto v0.8.0 h1:5unRmEAPbHXHuLjDg01CxJWf91cw3lKHc/0xzKpXEe0= github.com/pires/go-proxyproto v0.8.0/go.mod h1:iknsfgnH8EkjrMeMyvfKByp9TiBZCKZM0jx2xmKqnVY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/sirupsen/logrus v1.1.1/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skycoin/encodertest v0.0.0-20190217072920-14c2e31898b9/go.mod h1:OQz8NXVJUWEw7PWYASZ/1BIw5GXgVMTGvrCGDlZa9+k= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0duwyG+7WliWz5u9kgk1h5MnLuA= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o= -github.com/skycoin/skycoin v0.28.0 h1:0TN2tsU8CbCnGANKKxMr4jcG8RuBa8hWREeYtjDDtlk= -github.com/skycoin/skycoin v0.28.0/go.mod h1:E9RvlMn8iQGX/upaIQvkHHcw/180JBqAQbRIzkLrkSQ= -github.com/skycoin/skywire v1.3.28 h1:CWg/GE2WV68TvPoIn2edqdq/pfu3a96hJF12ofNKb8U= -github.com/skycoin/skywire v1.3.28/go.mod h1:zmOIJReAmueQ6HHp6SbwCSWCS/CXBLpJN2LcWgnXsFI= +github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f h1:isCGulVHahQfFoS37B7JT3rb8n4Ih2o9oMg2p25D7o8= +github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f/go.mod h1:1iZLomiHUOEvmJaBNrzE+Tllf09uhrCZ5JLL3cHdKKQ= +github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb h1:QzsuvwRi+bAeIqtcwARqVsnhWRzCHxO38ZEdhdKEv78= +github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb/go.mod h1:QflvgSeNGMsDmiHUcFQt4AD2N+YG0VKeMHY2gUSI0bY= github.com/skycoin/skywire-utilities v1.3.25 h1:mk8dUonFdhVopFF3d9wbOyXXoiuAO+mN1y+ve6SzgX4= github.com/skycoin/skywire-utilities v1.3.25/go.mod h1:yFKWpL1bDRPKU3uK+cTF4PnYUMe+eyIj5N2bk4sF5Cw= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.2.1/go.mod h1:P4AexN0a+C9tGAnUFNwDMYYZv3pjFuvmeiMyKRaNVlI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -175,28 +143,20 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/toqueteos/webbrowser v1.1.0/go.mod h1:Hqqqmzj8AHn+VlZyVjaRWY20i25hoOZGAABCcg2el4A= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8= github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4= golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181023152157-44b849a8bc13/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200428200454-593003d681fa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -210,11 +170,10 @@ golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -222,7 +181,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/discmetrics/victoria_metrics.go b/internal/discmetrics/victoria_metrics.go index 777318a25..854afadb4 100644 --- a/internal/discmetrics/victoria_metrics.go +++ b/internal/discmetrics/victoria_metrics.go @@ -2,7 +2,7 @@ package discmetrics import ( - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" ) // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. diff --git a/internal/dmsg-discovery/api/api.go b/internal/dmsg-discovery/api/api.go index 1c2432fae..48cfd4d10 100644 --- a/internal/dmsg-discovery/api/api.go +++ b/internal/dmsg-discovery/api/api.go @@ -12,12 +12,12 @@ import ( "github.com/go-chi/chi/v5/middleware" jsoniter "github.com/json-iterator/go" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/networkmonitor" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor" "github.com/skycoin/dmsg/internal/discmetrics" "github.com/skycoin/dmsg/internal/dmsg-discovery/store" diff --git a/internal/dmsg-discovery/api/entries_endpoint_test.go b/internal/dmsg-discovery/api/entries_endpoint_test.go index 84c402255..4737190da 100644 --- a/internal/dmsg-discovery/api/entries_endpoint_test.go +++ b/internal/dmsg-discovery/api/entries_endpoint_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/require" "github.com/skycoin/dmsg/internal/discmetrics" diff --git a/internal/dmsg-discovery/api/get_available_servers_test.go b/internal/dmsg-discovery/api/get_available_servers_test.go index c071535f1..1f814058e 100644 --- a/internal/dmsg-discovery/api/get_available_servers_test.go +++ b/internal/dmsg-discovery/api/get_available_servers_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/require" "github.com/skycoin/dmsg/internal/discmetrics" diff --git a/internal/dmsg-discovery/store/redis.go b/internal/dmsg-discovery/store/redis.go index ce2203a12..a514a77f8 100644 --- a/internal/dmsg-discovery/store/redis.go +++ b/internal/dmsg-discovery/store/redis.go @@ -8,9 +8,9 @@ import ( "github.com/go-redis/redis/v8" jsoniter "github.com/json-iterator/go" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/internal/dmsg-discovery/store/redis_test.go b/internal/dmsg-discovery/store/redis_test.go index 945b2a673..cba0a6960 100644 --- a/internal/dmsg-discovery/store/redis_test.go +++ b/internal/dmsg-discovery/store/redis_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/dmsg-discovery/store/storer.go b/internal/dmsg-discovery/store/storer.go index 61fbee3d7..12cb9a82c 100644 --- a/internal/dmsg-discovery/store/storer.go +++ b/internal/dmsg-discovery/store/storer.go @@ -6,8 +6,8 @@ import ( "errors" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/internal/dmsg-discovery/store/testing.go b/internal/dmsg-discovery/store/testing.go index e619c3f84..7809b4e10 100644 --- a/internal/dmsg-discovery/store/testing.go +++ b/internal/dmsg-discovery/store/testing.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/internal/dmsg-server/api/api.go b/internal/dmsg-server/api/api.go index 4467bda5d..1276f431b 100644 --- a/internal/dmsg-server/api/api.go +++ b/internal/dmsg-server/api/api.go @@ -14,10 +14,10 @@ import ( "github.com/go-chi/chi/v5" "github.com/pires/go-proxyproto" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/internal/servermetrics" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/internal/servermetrics/victoria_metrics.go b/internal/servermetrics/victoria_metrics.go index 900acedf5..b02f8673c 100644 --- a/internal/servermetrics/victoria_metrics.go +++ b/internal/servermetrics/victoria_metrics.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/VictoriaMetrics/metrics" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" ) // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. diff --git a/pkg/direct/client.go b/pkg/direct/client.go index 2939b7ed5..9e878426e 100644 --- a/pkg/direct/client.go +++ b/pkg/direct/client.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/pkg/direct/direct.go b/pkg/direct/direct.go index 3c1310bae..ba8f7bcfb 100644 --- a/pkg/direct/direct.go +++ b/pkg/direct/direct.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/pkg/direct/entries.go b/pkg/direct/entries.go index 1f146d1d9..407f5521c 100644 --- a/pkg/direct/entries.go +++ b/pkg/direct/entries.go @@ -2,7 +2,7 @@ package direct import ( - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/pkg/disc/client.go b/pkg/disc/client.go index a74be3be4..5403d7bb5 100644 --- a/pkg/disc/client.go +++ b/pkg/disc/client.go @@ -11,8 +11,8 @@ import ( "time" jsoniter "github.com/json-iterator/go" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) var json = jsoniter.ConfigFastest diff --git a/pkg/disc/client_mock_test.go b/pkg/disc/client_mock_test.go index 5e75c4279..31a95a7f7 100644 --- a/pkg/disc/client_mock_test.go +++ b/pkg/disc/client_mock_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/disc/entry.go b/pkg/disc/entry.go index 365b270ce..705b4b373 100644 --- a/pkg/disc/entry.go +++ b/pkg/disc/entry.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) const ( diff --git a/pkg/disc/entry_test.go b/pkg/disc/entry_test.go index aba9a971d..7bc3fa4c7 100644 --- a/pkg/disc/entry_test.go +++ b/pkg/disc/entry_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/disc/testing.go b/pkg/disc/testing.go index 9ced8bd51..d1e3e2b15 100644 --- a/pkg/disc/testing.go +++ b/pkg/disc/testing.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) // MockClient is an APIClient mock. The mock doesn't reply with the same errors as the diff --git a/pkg/dmsg/client.go b/pkg/dmsg/client.go index 9b3fd8c99..99271f72b 100644 --- a/pkg/dmsg/client.go +++ b/pkg/dmsg/client.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/pkg/dmsg/client_session.go b/pkg/dmsg/client_session.go index ba3cfff3a..3a4f2edad 100644 --- a/pkg/dmsg/client_session.go +++ b/pkg/dmsg/client_session.go @@ -7,8 +7,8 @@ import ( "time" "github.com/hashicorp/yamux" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" ) // ClientSession represents a session from the perspective of a dmsg client. diff --git a/pkg/dmsg/entity_common.go b/pkg/dmsg/entity_common.go index 4779984ee..fe1ff56b8 100644 --- a/pkg/dmsg/entity_common.go +++ b/pkg/dmsg/entity_common.go @@ -9,9 +9,9 @@ import ( "time" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/pkg/dmsg/listener.go b/pkg/dmsg/listener.go index 292d37d21..24d01ce72 100644 --- a/pkg/dmsg/listener.go +++ b/pkg/dmsg/listener.go @@ -7,7 +7,7 @@ import ( "sync" "sync/atomic" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" ) // Listener listens for remote-initiated streams. diff --git a/pkg/dmsg/server.go b/pkg/dmsg/server.go index 9c8c461d7..77105b83c 100644 --- a/pkg/dmsg/server.go +++ b/pkg/dmsg/server.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/internal/servermetrics" "github.com/skycoin/dmsg/pkg/disc" diff --git a/pkg/dmsg/server_session.go b/pkg/dmsg/server_session.go index 4b8376eec..e92aa28b5 100644 --- a/pkg/dmsg/server_session.go +++ b/pkg/dmsg/server_session.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/yamux" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/internal/servermetrics" "github.com/skycoin/dmsg/pkg/noise" diff --git a/pkg/dmsg/session_common.go b/pkg/dmsg/session_common.go index d38afd1a7..69903a106 100644 --- a/pkg/dmsg/session_common.go +++ b/pkg/dmsg/session_common.go @@ -12,7 +12,7 @@ import ( "github.com/chen3feng/safecast" "github.com/hashicorp/yamux" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/noise" ) diff --git a/pkg/dmsg/stream.go b/pkg/dmsg/stream.go index 6bc61f1a2..69f1dfed9 100644 --- a/pkg/dmsg/stream.go +++ b/pkg/dmsg/stream.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/yamux" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/noise" ) diff --git a/pkg/dmsg/stream_test.go b/pkg/dmsg/stream_test.go index 67e7b95c0..d07a24be8 100644 --- a/pkg/dmsg/stream_test.go +++ b/pkg/dmsg/stream_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/pkg/dmsg/types.go b/pkg/dmsg/types.go index 9fbb2ca3c..d98ed2911 100644 --- a/pkg/dmsg/types.go +++ b/pkg/dmsg/types.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) const ( diff --git a/pkg/dmsgcurl/dmsgcurl.go b/pkg/dmsgcurl/dmsgcurl.go index 5a32d63f9..785c471d1 100644 --- a/pkg/dmsgcurl/dmsgcurl.go +++ b/pkg/dmsgcurl/dmsgcurl.go @@ -14,8 +14,8 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/pkg/dmsgcurl/dmsgcurl_test.go b/pkg/dmsgcurl/dmsgcurl_test.go index c46a570a0..5f5bf28ba 100644 --- a/pkg/dmsgcurl/dmsgcurl_test.go +++ b/pkg/dmsgcurl/dmsgcurl_test.go @@ -11,9 +11,9 @@ import ( "time" "github.com/go-chi/chi/v5" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/pkg/dmsgcurl/flags.go b/pkg/dmsgcurl/flags.go index 4a5264c61..79849afff 100644 --- a/pkg/dmsgcurl/flags.go +++ b/pkg/dmsgcurl/flags.go @@ -6,7 +6,7 @@ import ( "flag" "github.com/skycoin/skywire" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" ) // ExecName contains the execution name. diff --git a/pkg/dmsghttp/examples_test.go b/pkg/dmsghttp/examples_test.go index 4243ae5dd..6eadbe09b 100644 --- a/pkg/dmsghttp/examples_test.go +++ b/pkg/dmsghttp/examples_test.go @@ -9,9 +9,9 @@ import ( "github.com/go-chi/chi/v5" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "golang.org/x/net/nettest" "github.com/skycoin/dmsg/pkg/disc" diff --git a/pkg/dmsghttp/http.go b/pkg/dmsghttp/http.go index 95ed68a61..40f93f2c7 100644 --- a/pkg/dmsghttp/http.go +++ b/pkg/dmsghttp/http.go @@ -7,8 +7,8 @@ import ( "net/http" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/pkg/dmsghttp/http_test.go b/pkg/dmsghttp/http_test.go index 11a342a40..5af0fb17e 100644 --- a/pkg/dmsghttp/http_test.go +++ b/pkg/dmsghttp/http_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/go-chi/chi/v5" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/stretchr/testify/assert" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/pkg/dmsghttp/http_transport_test.go b/pkg/dmsghttp/http_transport_test.go index a7edcd3a6..41446ca38 100644 --- a/pkg/dmsghttp/http_transport_test.go +++ b/pkg/dmsghttp/http_transport_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/pkg/dmsghttp/util.go b/pkg/dmsghttp/util.go index a3ac740fd..e3565bfe7 100644 --- a/pkg/dmsghttp/util.go +++ b/pkg/dmsghttp/util.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/pkg/dmsgpty/cli.go b/pkg/dmsgpty/cli.go index eb9ca0225..cba702228 100644 --- a/pkg/dmsgpty/cli.go +++ b/pkg/dmsgpty/cli.go @@ -12,8 +12,8 @@ import ( "syscall" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) // CLI connects with and has ownership over a dmsgpty.Host. diff --git a/pkg/dmsgpty/host.go b/pkg/dmsgpty/host.go index 7ebaa9200..7e583a840 100644 --- a/pkg/dmsgpty/host.go +++ b/pkg/dmsgpty/host.go @@ -13,8 +13,8 @@ import ( "sync/atomic" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" dmsg "github.com/skycoin/dmsg/pkg/dmsg" ) diff --git a/pkg/dmsgpty/host_test.go b/pkg/dmsgpty/host_test.go index fd003f04f..24954fe31 100644 --- a/pkg/dmsgpty/host_test.go +++ b/pkg/dmsgpty/host_test.go @@ -10,8 +10,8 @@ import ( "runtime" "testing" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/pkg/dmsgpty/pty_client.go b/pkg/dmsgpty/pty_client.go index d6e10063b..058c757a3 100644 --- a/pkg/dmsgpty/pty_client.go +++ b/pkg/dmsgpty/pty_client.go @@ -8,8 +8,8 @@ import ( "sync" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) // PtyClient represents the client end of a dmsgpty session. diff --git a/pkg/dmsgpty/ui.go b/pkg/dmsgpty/ui.go index ba30e1ad2..42a0b1b63 100644 --- a/pkg/dmsgpty/ui.go +++ b/pkg/dmsgpty/ui.go @@ -14,8 +14,8 @@ import ( "github.com/coder/websocket" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) const ( diff --git a/pkg/dmsgpty/whitelist.go b/pkg/dmsgpty/whitelist.go index a944d23b3..a8bcfb4fb 100644 --- a/pkg/dmsgpty/whitelist.go +++ b/pkg/dmsgpty/whitelist.go @@ -12,7 +12,7 @@ import ( "sync" jsoniter "github.com/json-iterator/go" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) var ( diff --git a/pkg/dmsgpty/whitelist_client.go b/pkg/dmsgpty/whitelist_client.go index 7a7382e04..47b12416a 100644 --- a/pkg/dmsgpty/whitelist_client.go +++ b/pkg/dmsgpty/whitelist_client.go @@ -5,7 +5,7 @@ import ( "io" "net/rpc" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) // WhitelistClient interacts with a whitelist's API. diff --git a/pkg/dmsgpty/whitelist_gateway.go b/pkg/dmsgpty/whitelist_gateway.go index 0bd735466..b3c5527c2 100644 --- a/pkg/dmsgpty/whitelist_gateway.go +++ b/pkg/dmsgpty/whitelist_gateway.go @@ -2,7 +2,7 @@ package dmsgpty import ( - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) // WhitelistGateway is the configuration gateway. diff --git a/pkg/dmsgserver/config.go b/pkg/dmsgserver/config.go index 396c62580..e6daff4bf 100644 --- a/pkg/dmsgserver/config.go +++ b/pkg/dmsgserver/config.go @@ -7,7 +7,7 @@ import ( "time" "github.com/skycoin/skycoin/src/util/logging" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/dmsg" ) diff --git a/pkg/dmsgtest/dmsg_client_test.go b/pkg/dmsgtest/dmsg_client_test.go index ecb2fc7fd..4c47568ac 100644 --- a/pkg/dmsgtest/dmsg_client_test.go +++ b/pkg/dmsgtest/dmsg_client_test.go @@ -11,8 +11,8 @@ import ( "time" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/dmsgtest/env.go b/pkg/dmsgtest/env.go index 9a294ea84..5f4cf2343 100644 --- a/pkg/dmsgtest/env.go +++ b/pkg/dmsgtest/env.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "golang.org/x/net/nettest" "github.com/skycoin/dmsg/pkg/disc" diff --git a/pkg/ioutil/logging.go b/pkg/ioutil/logging.go index c6235e46f..36c4ce399 100644 --- a/pkg/ioutil/logging.go +++ b/pkg/ioutil/logging.go @@ -2,7 +2,7 @@ package ioutil import ( - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) var log = logging.MustGetLogger("ioutil") diff --git a/pkg/noise/net.go b/pkg/noise/net.go index 87f2561c6..4080fa0e1 100644 --- a/pkg/noise/net.go +++ b/pkg/noise/net.go @@ -9,7 +9,7 @@ import ( "time" "github.com/skycoin/noise" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) var ( diff --git a/pkg/noise/net_test.go b/pkg/noise/net_test.go index 70c09908d..596c84206 100644 --- a/pkg/noise/net_test.go +++ b/pkg/noise/net_test.go @@ -13,7 +13,7 @@ import ( "time" "github.com/skycoin/noise" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" ) diff --git a/pkg/noise/noise.go b/pkg/noise/noise.go index aa35d668f..66550f73f 100644 --- a/pkg/noise/noise.go +++ b/pkg/noise/noise.go @@ -8,8 +8,8 @@ import ( "fmt" "github.com/skycoin/noise" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) var noiseLogger = logging.MustGetLogger("noise") diff --git a/pkg/noise/noise_test.go b/pkg/noise/noise_test.go index dba0be58d..5e43cbadc 100644 --- a/pkg/noise/noise_test.go +++ b/pkg/noise/noise_test.go @@ -6,8 +6,8 @@ import ( "os" "testing" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/noise/read_writer.go b/pkg/noise/read_writer.go index a393266a1..c728eef6d 100644 --- a/pkg/noise/read_writer.go +++ b/pkg/noise/read_writer.go @@ -12,7 +12,7 @@ import ( "time" "github.com/chen3feng/safecast" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/ioutil" ) diff --git a/pkg/noise/read_writer_test.go b/pkg/noise/read_writer_test.go index cbc67c2d4..78c67569f 100644 --- a/pkg/noise/read_writer_test.go +++ b/pkg/noise/read_writer_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/vendor/github.com/fatih/color/README.md b/vendor/github.com/fatih/color/README.md index be82827ca..d135bfe02 100644 --- a/vendor/github.com/fatih/color/README.md +++ b/vendor/github.com/fatih/color/README.md @@ -9,7 +9,7 @@ suits you. ## Install -```bash +``` go get github.com/fatih/color ``` @@ -30,6 +30,18 @@ color.Magenta("And many others ..") ``` +### RGB colors + +If your terminal supports 24-bit colors, you can use RGB color codes. + +```go +color.RGB(255, 128, 0).Println("foreground orange") +color.RGB(230, 42, 42).Println("foreground red") + +color.BgRGB(255, 128, 0).Println("background orange") +color.BgRGB(230, 42, 42).Println("background red") +``` + ### Mix and reuse colors ```go @@ -49,6 +61,11 @@ boldRed.Println("This will print text in bold red.") whiteBackground := red.Add(color.BgWhite) whiteBackground.Println("Red text with white background.") + +// Mix with RGB color codes +color.RGB(255, 128, 0).AddBgRGB(0, 0, 0).Println("orange with black background") + +color.BgRGB(255, 128, 0).AddRGB(255, 255, 255).Println("orange background with white foreground") ``` ### Use your own output (io.Writer) @@ -161,10 +178,6 @@ c.Println("This prints again cyan...") To output color in GitHub Actions (or other CI systems that support ANSI colors), make sure to set `color.NoColor = false` so that it bypasses the check for non-tty output streams. -## Todo - -* Save/Return previous values -* Evaluate fmt.Formatter interface ## Credits diff --git a/vendor/github.com/fatih/color/color.go b/vendor/github.com/fatih/color/color.go index 81094e87c..ee39b408e 100644 --- a/vendor/github.com/fatih/color/color.go +++ b/vendor/github.com/fatih/color/color.go @@ -98,6 +98,9 @@ const ( FgMagenta FgCyan FgWhite + + // used internally for 256 and 24-bit coloring + foreground ) // Foreground Hi-Intensity text colors @@ -122,6 +125,9 @@ const ( BgMagenta BgCyan BgWhite + + // used internally for 256 and 24-bit coloring + background ) // Background Hi-Intensity text colors @@ -150,6 +156,30 @@ func New(value ...Attribute) *Color { return c } +// RGB returns a new foreground color in 24-bit RGB. +func RGB(r, g, b int) *Color { + return New(foreground, 2, Attribute(r), Attribute(g), Attribute(b)) +} + +// BgRGB returns a new background color in 24-bit RGB. +func BgRGB(r, g, b int) *Color { + return New(background, 2, Attribute(r), Attribute(g), Attribute(b)) +} + +// AddRGB is used to chain foreground RGB SGR parameters. Use as many as parameters to combine +// and create custom color objects. Example: .Add(34, 0, 12).Add(255, 128, 0). +func (c *Color) AddRGB(r, g, b int) *Color { + c.params = append(c.params, foreground, 2, Attribute(r), Attribute(g), Attribute(b)) + return c +} + +// AddRGB is used to chain background RGB SGR parameters. Use as many as parameters to combine +// and create custom color objects. Example: .Add(34, 0, 12).Add(255, 128, 0). +func (c *Color) AddBgRGB(r, g, b int) *Color { + c.params = append(c.params, background, 2, Attribute(r), Attribute(g), Attribute(b)) + return c +} + // Set sets the given parameters immediately. It will change the color of // output with the given SGR parameters until color.Unset() is called. func Set(p ...Attribute) *Color { @@ -401,7 +431,7 @@ func (c *Color) format() string { func (c *Color) unformat() string { //return fmt.Sprintf("%s[%dm", escape, Reset) - //for each element in sequence let's use the speficic reset escape, ou the generic one if not found + //for each element in sequence let's use the specific reset escape, or the generic one if not found format := make([]string, len(c.params)) for i, v := range c.params { format[i] = strconv.Itoa(int(Reset)) diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/base58/base58_old.go b/vendor/github.com/skycoin/skycoin/src/cipher/base58/base58_old.go index ffa4bca5c..cd051e0ff 100644 --- a/vendor/github.com/skycoin/skycoin/src/cipher/base58/base58_old.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/base58/base58_old.go @@ -11,7 +11,7 @@ import ( "math/big" ) -//alphabet used by Bitcoins +// alphabet used by Bitcoins var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" var ( @@ -26,7 +26,7 @@ var ( // oldBase58 type to hold the oldBase58 string type oldBase58 string -//reverse alphabet used for quckly converting base58 strings into numbers +// reverse alphabet used for quckly converting base58 strings into numbers var revalp = map[string]int{ "1": 0, "2": 1, "3": 2, "4": 3, "5": 4, "6": 5, "7": 6, "8": 7, "9": 8, "A": 9, "B": 10, "C": 11, "D": 12, "E": 13, "F": 14, "G": 15, "H": 16, "J": 17, "K": 18, "L": 19, @@ -76,7 +76,7 @@ func (b oldBase58) ToInt() (int, error) { return answer, nil } -//ToHex converts base58 to hex bytes +// ToHex converts base58 to hex bytes func (b oldBase58) ToHex() ([]byte, error) { value, err := b.ToBig() //convert to big.Int if err != nil { diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/crypto.go b/vendor/github.com/skycoin/skycoin/src/cipher/crypto.go index 53bce1fe7..60c24fa9f 100644 --- a/vendor/github.com/skycoin/skycoin/src/cipher/crypto.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/crypto.go @@ -270,7 +270,7 @@ func (sk SecKey) Null() bool { return sk == SecKey{} } -//ECDH generates a shared secret +// ECDH generates a shared secret // A: pub1,sec1 // B: pub2,sec2 // person A sends their public key pub1 diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go index 1cbb4ae33..db8f044ee 100644 --- a/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go @@ -22,8 +22,8 @@ func initConstants() { 0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B, 0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41}) TheCurve.halfOrder.SetBytes([]byte{ - 0X7F, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, - 0X5D, 0X57, 0X6E, 0X73, 0X57, 0XA4, 0X50, 0X1D, 0XDF, 0XE9, 0X2F, 0X46, 0X68, 0X1B, 0X20, 0XA0}) + 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x5D, 0x57, 0x6E, 0x73, 0x57, 0xA4, 0x50, 0x1D, 0xDF, 0xE9, 0x2F, 0x46, 0x68, 0x1B, 0x20, 0xA0}) TheCurve.p.SetBytes([]byte{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go index a6f9d6c89..afdd64efa 100644 --- a/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go @@ -86,7 +86,7 @@ func (xy XY) Bytes() []byte { } // BytesUncompressed returns serialized key in uncompressed format "<04> " -//65 bytes +// 65 bytes func (xy *XY) BytesUncompressed() (raw []byte) { xy.X.Normalize() // See https://github.com/piotrnar/gocoin/issues/15 xy.Y.Normalize() // See https://github.com/piotrnar/gocoin/issues/15 diff --git a/vendor/github.com/skycoin/skywire/.golangci.yml b/vendor/github.com/skycoin/skywire/.golangci.yml index 60bac5731..96968553d 100644 --- a/vendor/github.com/skycoin/skywire/.golangci.yml +++ b/vendor/github.com/skycoin/skywire/.golangci.yml @@ -159,6 +159,9 @@ linters: - ineffassign - typecheck - gosec + - gosimple + - staticcheck + - unused - misspell - nakedret enable-all: false diff --git a/vendor/github.com/skycoin/skywire/CHANGELOG.md b/vendor/github.com/skycoin/skywire/CHANGELOG.md index 1a2f050cf..0c61d7953 100644 --- a/vendor/github.com/skycoin/skywire/CHANGELOG.md +++ b/vendor/github.com/skycoin/skywire/CHANGELOG.md @@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. updates may be generated with `scripts/changelog.sh ` +## 1.3.29 + +- Fix Mac installer issue [#1900](https://github.com/skycoin/skywire/pull/1900) +- Fix WIX issue on versioning of Windows installer [#1899](https://github.com/skycoin/skywire/pull/1899) +- Fix issue on release workflow [#1896](https://github.com/skycoin/skywire/pull/1896) +- Improve Mac survey [#1895](https://github.com/skycoin/skywire/pull/1895) +- Improve Windows installer [#1894](https://github.com/skycoin/skywire/pull/1894) +- Reward on Windows [#1892](https://github.com/skycoin/skywire/pull/1892) +- Embed scripts for reward system [#1888](https://github.com/skycoin/skywire/pull/1888) +- Fix codebase issues [#1885](https://github.com/skycoin/skywire/pull/1885) +- Update Reward Calculation Cli & UI [#1884](https://github.com/skycoin/skywire/pull/1884) +- Update dependencies [#1880](https://github.com/skycoin/skywire/pull/1880) +- Fix dmsghttp config gen logic [#1877](https://github.com/skycoin/skywire/pull/1877) +- Fix services-config.json path reference for `skywire cli config gen` [#1875](https://github.com/skycoin/skywire/pull/1875) + ## 1.3.26 - Embed Deployment Configuration [#1873](https://github.com/skycoin/skywire/pull/1873) diff --git a/vendor/github.com/skycoin/skywire/Makefile b/vendor/github.com/skycoin/skywire/Makefile index 917533f07..fa16cf702 100644 --- a/vendor/github.com/skycoin/skywire/Makefile +++ b/vendor/github.com/skycoin/skywire/Makefile @@ -132,8 +132,14 @@ check-windows: lint-windows test-windows ## Run linters and tests on windows ima build: clean build-merged ## Install dependencies, build apps and binaries. `go build` with ${OPTS} +print-build: ## Print the command used to build the binary + @echo "${OPTS} go build ${BUILD_OPTS} -o $(BUILD_PATH)skywire ./cmd/skywire" + +print-run-source: ## Print the command used to go run from source + @echo "${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go cli config gen -n | sudo ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go visor -n || true" + build-merged: ## Install dependencies, build apps and binaries. `go build` with ${OPTS} - ${OPTS} go build ${BUILD_OPTS} -o $(BUILD_PATH)skywire ./cmd/skywire + ${OPTS} go build ${BUILD_OPTS} -o $(BUILD_PATH)skywire ./cmd/skycoin-skywire build-merged-windows: clean-windows powershell '${OPTS} go build ${BUILD_OPTS} -o $(BUILD_PATH)skywire.exe ./cmd/skywire' @@ -177,10 +183,16 @@ lint: ## Run linters. Use make install-linters first ${OPTS} golangci-lint run -c .golangci.yml ./pkg/... ${OPTS} golangci-lint run -c .golangci.yml ./... +gocyclo: ## Run gocyclo + gocyclo -over 14 . + lint-windows: ## Run linters. Use make install-linters-windows first powershell 'golangci-lint --version' powershell 'golangci-lint run -c .golangci.yml ./...' +gocyclo-windows: ## Run gocyclo on windows + powershell 'gocyclo -over 14 .' + test: ## Run tests -go clean -testcache &>/dev/null ${OPTS} go test ${TEST_OPTS} ./internal/... ./pkg/... ./cmd/... @@ -259,7 +271,7 @@ build-race: ## Build for testing Docker images CGO_ENABLED=1 ${OPTS} go build -tags netgo ${BUILD_OPTS} -race -o /release/skywire ./cmd/skywire github-prepare-release: - $(eval GITHUB_TAG=$(shell git describe --abbrev=0 --tags | cut -c 2-6)) + $(eval GITHUB_TAG=$(shell git describe --abbrev=0 --tags | sed 's/-.*//')) sed '/^## ${GITHUB_TAG}$$/,/^## .*/!d;//d;/^$$/d' ./CHANGELOG.md > releaseChangelog.md github-release: github-prepare-release @@ -321,19 +333,19 @@ prepare: run-source: prepare ## Run skywire from source, without compiling binaries - go run ./cmd/skywire/skywire.go cli config gen -in | sudo go run ./cmd/skywire/skywire.go visor -n || true + ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go cli config gen -n | sudo ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go visor -n || true run-systray: prepare ## Run skywire from source, with vpn server enabled - go run ./cmd/skywire/skywire.go cli config gen -ni | sudo go run ./cmd/skywire/skywire.go visor -n --systray || true + ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go cli config gen -n | sudo ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go visor -n --systray || true run-vpnsrv: prepare ## Run skywire from source, without compiling binaries - go run ./cmd/skywire/skywire.go cli config gen -in --servevpn | sudo go run ./cmd/skywire/skywire.go visor -n || true + ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go cli config gen -n --servevpn | sudo ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go visor -n || true run-source-dmsghttp: prepare ## Run skywire from source with dmsghttp config - go run ./cmd/skywire/skywire.go cli config gen -din | sudo go run ./cmd/skywire/skywire.go visor -n || true + ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go cli config gen -dn | sudo ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go visor -n || true run-vpnsrv-dmsghttp: prepare ## Run skywire from source with dmsghttp config and vpn server - go run ./cmd/skywire/skywire.go cli config gen -din --servevpn | sudo go run ./cmd/skywire/skywire.go visor -n || true + ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go cli config gen -dn --servevpn | sudo ${OPTS} go run ${BUILD_OPTS} ./cmd/skywire/skywire.go visor -n || true lint-ui: ## Lint the UI code cd $(MANAGER_UI_DIR) && npm run lint @@ -374,7 +386,6 @@ windows-installer-release: $(eval GITHUB_TAG=$(shell git describe --abbrev=0 --tags)) make win-installer CUSTOM_VERSION=$(GITHUB_TAG) gh release upload --repo skycoin/skywire ${GITHUB_TAG} ./skywire-installer-${GITHUB_TAG}-windows-amd64.msi - gh release upload --repo skycoin/skywire ${GITHUB_TAG} ./skywire-installer-${GITHUB_TAG}-windows-386.msi # useful commands #dmsghttp-update: ## update dmsghttp config diff --git a/vendor/github.com/skycoin/skywire/mainnet_rules.md b/vendor/github.com/skycoin/skywire/mainnet_rules.md index 68e8d5df1..937069e03 100644 --- a/vendor/github.com/skycoin/skywire/mainnet_rules.md +++ b/vendor/github.com/skycoin/skywire/mainnet_rules.md @@ -11,43 +11,31 @@ The required minimum Skywire version will be incremented periodically. -#### Table of Contents -* [Introduction](#introduction) -* [Uptime Reward Pool](#uptime-reward-pool) -* [Rules & Requirements](#rules--requirements) -* [Exceptions](#exceptions-for-deployment-changes-with-dmsghttp-config-chinese-users) -* [Verifying Requirements & Eligibility](#verifying-requirements--eligibility) - * [Version](#version) - * [Deployment](#deployment) - * [Uptime](#uptime) - * [Deployment](#deployment) - * [Skycoin Address](#skycoin-address) - * [Connection to DMSG network](#connection-to-dmsg-network) - * [Verifying other requirements](#verifying-other-requirements) -* [Reward System Overview](#reward-system-overview) -* ~~[Hardware](#hardware)~~ - ## Introduction
Updates to this article will be followed by a notification via the official Skywire PSA channel on Telegram.

-All information about rewards will be published here. Please ask for clarification in the [@skywire](https://t.me/skywire) Telegram channel if some things appear to not be covered. Please join [@SkywirePSA](https://t.me/SkywirePSA) for public service announcements (PSA) regarding the skywire network, update notices, changes to this article, etc. +All information about rewards will be published here. Please ask for clarification in the [@skywire](https://t.me/skywire) Telegram channel if some things appear to not be covered. + +Please join [@SkywirePSA](https://t.me/SkywirePSA) for public service announcements (PSA) regarding the skywire network, update notices, changes to this article, etc. Reward distribution notifications are on telegram [@skywire_reward](https://t.me/skywire_reward). Information about reward distribution as well as other metrics for the skywire network can be found at [fiber.skywire.dev](https://fiber.skywire.dev) -# Uptime Reward Pool +# Uptime Reward Pools -408000 Skycoin are distributed annually to those visors which meet the mimimum uptime and the other requirements listed below. +816000 Skycoin are distributed annually to those visors which meet the mimimum uptime and the other requirements listed below, in two equally sized reward pools. -The reward amount for a day is evenly divided among those eligible participants on the basis of having met uptime and other requirements, for the previous day. +The reward amount for a day is evenly divided among those eligible participants for a given reward pool on the basis of having met uptime and other requirements, for the previous day. -A total of up to ~1117.808 Skycoin are distributed daily in non leap-years. +A total of up to ~1117.808 Skycoin __per pool__ are distributed daily in non leap-years. -A total of up to ~1114.754 Skycoin are distributed daily in leap-years. +A total of up to ~1114.754 Skycoin __per pool__ are distributed daily in leap-years. + +The two reward pools are differentiated by architecture ; one pool for ARM / RISC / MIPS architectures, the other pool for AMD64 / x86_64 / i686 architecture machines. The requirements are otherwise identical for reward eligibility in these pools. ## Rules & Requirements @@ -58,7 +46,7 @@ To receive Skycoin rewards for running skywire, the following requirements must * 2) **75% [uptime](#uptime) per day** minimum is required to be eligible to receive rewards -* 3) The visor must be an **ARM or RISC architecture SBC** ~running on approved [hardware](#hardware)~ +* 3) ~The visor must be an **ARM or RISC architecture SBC** running on approved [hardware](#hardware)~ * 4) Visors must be running on **[the skywire production deployment](#deployment)** with a config that is updated on every version. No default keys or addresses of this configuration may be removed - but you can add keys where applicable. @@ -85,17 +73,25 @@ To receive Skycoin rewards for running skywire, the following requirements must All the production deployment services may be accessed by the visor over the dmsg network when the visor runs with a dmsghttp config. -This type of config is generated automatically based on region (via `skywire cli config gen -b --bestproto`), to circumvent ISP blocking of http requests. +This type of config is generated automatically based on region via: +``` +skywire cli config gen -b --bestproto +``` +to circumvent ISP blocking of http requests. -In order to bootstrap the visor's to connection to the dmsg network (via TCP connection to an individual dmsg server) the `dmsghttp-config.json` is provided with the skywire binary release. +In order to bootstrap the visor's to connection to the dmsg network (via TCP connection to an individual dmsg server) the [dmsghttp-config.json](/dmsghttp-config.json) is provided with the skywire binary release. -In the instance that the skywire production deployment changes - specifically the dmsg servers - it will be necessary to update to the next version or package release which fixes the dmsg servers - or else to manually update the `dmsghttp-config.json` which is provided by your skywire installation. +In the instance that the skywire production deployment changes - specifically the dmsg servers: +* it will be necessary to update to the next version or package release which fixes the dmsg servers. +OR +* it will be necessary to manually update the [dmsghttp-config.json](/dmsghttp-config.json) which is provided by your skywire installation. Currently, **there is no mechanism for updating the dmsghttp-config.json which does not require an http request** ; a request which may be blocked depending on region. -In this instance, the visor will not connect to any service because it is not connected to the dmsg network, so it will not be possible for the visor to accumulate uptime or for the reward system to collect the survey, which are prerequisite for reward eligibility. +In this instance, the visor will not connect to any service because it is not connected to the dmsg network, so it will not be possible for the visor to accumulate uptime or for the reward system to collect the survey, which are prerequisites for reward eligibility. -As a consequence of this; any visors running a dmsghttp-config, and hence any visors running in regions such as China, the minimum version requirement for obtaining rewards is not only the latest available version, but __the latest release of the package__ unless the dmsghttp-config.json is updated manually. +As a consequence of this; any visors running a dmsghttp-config, and hence any visors running in regions such as China, the minimum version requirement for obtaining rewards is not only the latest available version, +but __the latest release of the package__ unless the dmsghttp-config.json is updated manually within your installation. ## Verifying Requirements & Eligibility @@ -124,7 +120,7 @@ Rewards Cutoff date for updating 10-1-2024 ### Deployment -The deployment your visor is running on can be verified by comparing the services configured in the visor's `.json` config against [conf.skywire.skycoin.com](https://conf.skywire.skycoin.com) +The deployment your visor is running on can be verified by comparing the services configured in the visor's .json config against [conf.skywire.skycoin.com](https://conf.skywire.skycoin.com) ``` cat /opt/skywire/skywire.json @@ -134,13 +130,27 @@ The service configuration will be automatically updated any time a config is gen For those visors in china or those running a dmsghttp-config, compare the dmsghttp-config of your current installation with the dmsghttp-config on the develop branch of [github.com/skycoin/skywire](https://github.com/skycoin/skywire) +The same data in a different format should be displayed in the [dmsg-discovery all_servers](https://dmsgd.skywire.skycoin.com/dmsg-discovery/all_servers) page. Ensure that the dmsghttp-config.json in your installation has the same ip addresses and ports for the dmsg server keys. + +The data from the dmsg discovery should be considered authoritative or current. ### Uptime Daily uptime statistics for all visors may be accessed via the + - [uptime tracker](https://ut.skywire.skycoin.com/uptimes?v=v2) + or using skywire cli -- `skywire cli ut -n0 -k ` + +``` +skywire cli ut -n0 -k +``` + +For example with a locally running visor: +``` +skywire cli ut -n0 -k $(skywire cli visor pk) +``` + ### Skycoin Address @@ -153,23 +163,76 @@ skywire cli reward ![image](https://user-images.githubusercontent.com/36607567/213941582-f57213b8-2acd-4c9a-a2c0-9089a8c2604e.png) +``` +$ skywire cli reward --help + + reward address setting + + Sets the skycoin reward address for the visor. + The config is written to the root of the default local directory + + this config is served via dmsghttp along with transport logs + and the system hardware survey for automating reward distribution + +Flags: + --all show all flags + +``` + +``` +$ skywire cli reward 2jBbGxZRGoQG1mqhPBnXnLTxK6oxsTf8os6 +Reward address: + 2jBbGxZRGoQG1mqhPBnXnLTxK6oxsTf8os6 +``` + +``` +$ skywire cli reward --help + + skycoin reward address set to: + 2jBbGxZRGoQG1mqhPBnXnLTxK6oxsTf8os6 + +Flags: + --all show all flags +``` + or via the hypervisor UI. ![image](https://user-images.githubusercontent.com/36607567/213941478-34c81493-9c3c-40c2-ac22-e33e3683a16f.png) the example above shows the genesis address for the skycoin blockchain. **Please do not use the genesis address.** -It is __highly recommended__ to set the reward address in the file `/etc/skywire.conf` by adding this line to the file: +It is __highly recommended__ to set the reward address in the file '/etc/skywire.conf' by adding this line to the file: + +``` +echo "REWARDSKYADDR=('2jBbGxZRGoQG1mqhPBnXnLTxK6oxsTf8os6')" | sudo tee -a /etc/skywire.conf +``` + +**PLEASE DO NOT USE THE GENESIS ADDRESS!** + +Add your skycoin address there and run: ``` -REWARDSKYADDR=('') +skywire-autoconfig ``` -Add your skycoin address there and run `skywire-autoconfig` on linux (assumes you have installed the package) +on linux (assumes you have installed the package) -If this file does not exist for you, it can be created with `skywire cli config gen -q | tee /etc/skywire.conf` +If this file does not exist for you, it can be created with +``` +skywire cli config gen -q | sudo tee /etc/skywire.conf +``` -**If you do this, please uncomment `PKGENV=true` before saving the file** +**If you do this, YOU MUST UNCOMMENT THE FOLLOWING LINES OF THE FILE:** +``` +PKGENV=true +BESTPROTO=TRUE +``` + +you can open the file in an editor to make that change, for instance nano + +``` +sudo nano /etc/skywire.conf +``` ### Connection to DMSG network @@ -179,6 +242,12 @@ This can be verified by examining the visor's logging: ![image](https://github.com/skycoin/skywire/assets/36607567/eb66bca1-fc9e-4c80-a38a-e00a73f675d0) +``` +[DMSGHTTP] 2024/10/09 - 22:31:45 | 200 | 47.2µs | | 03714c8bdaee0fb48f47babbc47c33e1880752b6620317c9d56b30f3b0ff58a9c3:51405 | GET /health +[DMSGHTTP] 2024/10/09 - 22:31:46 | 200 | 193.325µs | | 03714c8bdaee0fb48f47babbc47c33e1880752b6620317c9d56b30f3b0ff58a9c3:51457 | GET /node-info +[DMSGHTTP] 2024/10/09 - 22:31:47 | 200 | 98.93µs | | 03714c8bdaee0fb48f47babbc47c33e1880752b6620317c9d56b30f3b0ff58a9c3:51503 | GET /2024-10-10.csv +``` + The collected surveys and transport bandwidth log files should be visible in the survey index here: [fiber.skywire.dev/log-collection/tree](https://fiber.skywire.dev/log-collection/tree) @@ -205,11 +274,16 @@ If your visor is not generating such logging or errors are indicated, please rea ### Transportability -It is not required that a visor run any service, such as a vpn or socks5 proxy server, whichpermitsdirect access tothe internet from yor ip address. However, it is required that the visor is able to act as a hop along a route. A module is active at runtime which checks that transports may be established to that visor - the visor crates a dmsg transport to itself every few minutes to ensure transportability. If it's not possible to create a dmsg transport to the same visor after three attempts,the visor will shut down automatically. **It is expected that the visor will be restarted by a process control mechanism if the visor shuts down for any reason.** In the officially supported linux packages, systemd will restart the visor if it stops; regardless of the exit status of the process. +It is not required that a visor run any service, such as a vpn or socks5 proxy server, which permits direct access to the internet from your ip address. +However, it is required that the visor is able to act as a hop along a route. +A module is active at runtime which checks that transports may be established to that visor - the visor creates a dmsg transport to itself every few minutes to ensure transportability. +If it's not possible to create a dmsg transport to the same visor after three attempts,the visor will shut down automatically. +**It is expected that the visor will be restarted by a process control mechanism if the visor shuts down for any reason.** In the officially supported linux packages, systemd will restart the visor if it stops; regardless of the exit status of the process. ### Transport setup node -Previously, the transport setup node was run continuously as part of the reward system to ensure that visors were responding as expected to transport setup-node requests. However, there were intermittent issues with reliability of the results ; because there is no caching mechanism for responsiveness to transport setup-node requests as there exists for uptime. +Previously, the transport setup node was run continuously as part of the reward system to ensure that visors were responding as expected to transport setup-node requests. +However, there were intermittent issues with reliability of the results ; because there is no caching mechanism for responsiveness to transport setup-node requests as there exists for uptime. Currently, the transport setup-nodes which are configured for the visor are included in the survey and verified as an eligibility requirement for rewards by the reward system. @@ -225,12 +299,21 @@ In the future, it is anticipated that the transport bandwidth logs and ping metr ### Survey -On setting the skycoin reward address, the visor will generate and serve a sysytem survey over dmsg. Only keys which are whitelisted in the survey_whitelist array of the visor's config will have access to collect the survey. +On setting the skycoin reward address, the visor will generate and serve a system survey over dmsg. -To print the survey (approximately) as it would be served, one can use `skywire cli survey` +Only keys which are whitelisted in the survey_whitelist array of the visor's config will have access to collect the survey. + +To print the survey (approximately) as it would be served, one can use: +``` +skywire cli survey -p +``` **The purpose of the survey is strictly for checking [eligibility requirements](#rules--requirements) numbers 3 through 7.** +**Setting a skycoin address is considered as consent for collecting the survey ; the survey is not generated unless you set a skycoin address** + +We respect your privacy. + ### Verifying other requirements If the visor is not able to meet the [eligibility requirements](#rules--requirements) numbers 8 through 13, that is usually not the fault of the user - nor is it something the user is expected to troubleshoot on their own at this time. Please ask for assistance on telegram [@skywire](https://t.me/skywire) @@ -243,9 +326,11 @@ The skycoin reward address is in a text file contained in the "local" folder (lo The skycoin reward address is also included with the [system hardware survey](https://github.com/skycoin/skywire/tree/develop/cmd/skywire/README.md#survey) and served, along with transport logs, via dmsghttp. -The system survey (`local/node-info.json`) is fetched hourly by the reward system via `skywire cli log`; along with transport bandwidth logs. - -A survey of transports which have been set by transport setup-nodes are also collected hourly, from all visors which have had surveys collected +The system survey ('local/node-info.json') is fetched hourly by the reward system via +``` +skywire cli log +``` +along with transport bandwidth logs. The index of the collected files may be viewed at [fiber.skywire.dev/log-collection/tree](https://fiber.skywire.dev/log-collection/tree) @@ -259,7 +344,11 @@ The public keys which require to be whitelisted in order to collect the surveys, ## Reward System Funding & Distributions -The reward system is funded on a monthly basis. Sometimes there are unexpected or unavoidable delays in the funding. In these instances, rewards will be distributed based on the data generated wen the system is funded +The reward system is funded on a monthly basis. **Sometimes there are unexpected or unavoidable delays in the funding.** In these instances, rewards will be distributed based on the data generated when the system is funded. +In some instances, it's necessary to discard previous reward data and do multiple distributions to handle backlog of reward system funds. + +**We do our best to ensure fair reward distribution** - but the system itself is not infinitely flexible. +If there is no good way to rectify historical or undistributed rewards backlog, it will be distributed going forward as multiple distributions on the same day to those current active participants in the network. ## Deployment Outages @@ -269,166 +358,6 @@ The policy for handling rewards in the instance of a deployment outage is to rep ## Hardware -**Virtual Machines, servers, and personal computers are currently not eligible to collect rewards** - -_NOTE: this list of hardware was used with the initial implementation of the reward system - which required an application with pictures to be submitted. This no longer applies. The new reward system does not differentiate hardware except by architecture - only x86_64 / amd64 hardware is excluded from rewards currently. Every visor will receive the same reward amount, regardless of the hardware specs. It should be noted that the main difference between using cheap or low-end hardware and high-end hardware is the ease of maintenance and speed of updates for the node operator._ - -The following hardware is eligible for rewards: - -#### Orange Pi - - Prime - - 2G-IOT - - 4G-IOT - - i96 - - Lite - - Lite2 - - One - - One-Plus - - PC - - PC-Plus - - PC2 - - Plus - - Plus2 - - Plus2E - - RK3399 - - Win - - Win-Plus - - Zero - - Zero LTS - - Zero-Plus - - Zero-Plus2 - - 3 - -#### Raspberry Pi - - 1-Model-A+ - - 1-Model-B+ - - 2-Model-B - - 3-Model-B - - 3-Model-B+ - - 4-Model-B - - Compute Module 3 - - Compute Module 4 - - Zero-W - - Zero - -#### Asus - - Tinkerboard - -#### Banana Pi - - BPI-D1 - - BPI-G1 - - BPI-M1 - - BPI-M1+ - - BPI-M2 - - BPI-M2+ - - BPI-M2-Berry - - BPI-M2M - - BPI-M2U - - BPI-M64 - - BPI-R2 - - BPI-R3 - - BPI-Zero - -#### Beelink - - X2 - -#### Cubieboard - - Cubietruck - - Cubietruck-Plus - - 1 - - 2 - - 4 - -#### Geniatech - - Developer Board IV - -#### Helios - - 4 - -#### Libre Computer - - Le-Potato-AML-S905X-CC - - Renegade-ROC-RK3328-CC - - Tritium-ALL-H3-CC - -#### MQMaker - - MiQi - -#### NanoPi - - NanoPi - - 2 - - 2-Fire - - A64 - - K2 - - M1 - - M1-plus - - M2 - - M2A - - M3 - - M4 - - NEO - - NEO-Air - - NEO-Core - - NEO-Core2 - - NEO2 - - NEO2-Black - - S2 - - Smart4418 - -#### Odroid - - C2 - - C4 - - HC1 - - HC2 - - MC1 - - XU4 - -#### Olimex - - Lime1 - - Lime2 - - Lime2-eMMC - - LimeA33 - - Micro - -#### Pine - - Pine-A64 - - Pinebook-A64 - - Sopine-A64 - - Rock64 - - ROCKPro64 - -#### ROCKPI - - Rockpi 4 - - Rockpi S - - Rockpi E - - Rockpi N10 - -#### SolidRun - - CuBox-i - - CuBox-Pulse - - Humming-Board - - Humming-Board-Pulse - - ClearCloud-8K - - ClearFog-A38 - - ClearFog-GT-8K - -#### Udoo - - Blu - - Bricks - - Dual - - Neo - - Quad - - X86 - -#### X96 Android TV Box - - X96 mini - -#### Dolamee - - A95X F1 Smart TV Box - -#### Radxa - - ROCK Pi S - -#### ZTE - - ZXV10 B860H - -~~If you would like to use other boards please contact the team first for approval ; only the boards on the list are guaranteed to be eligible for rewards.~~ +As of November 2024, skywire rewards are open to all computer hardware and architectures. + +If there is not a release for your desired architecture, we can attempt to add it, on request. diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo/buildinfo.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo/buildinfo.go new file mode 100644 index 000000000..a807e6422 --- /dev/null +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo/buildinfo.go @@ -0,0 +1,81 @@ +// Package buildinfo pkg/buildinfo/buildinfo.go +package buildinfo + +import ( + "encoding/json" + "fmt" + "io" +) + +const unknown = "unknown" + +//$ go build -mod=vendor -ldflags="-X 'github.com/skycoin/skywire-utilities/pkg/buildinfo.version=$(git describe)' -X 'github.com/skycoin/skywire-utilities/pkg/buildinfo.date=$(date -u "+%Y-%m-%dT%H:%M:%SZ")' -X 'github.com/skycoin/skywire-utilities/pkg/buildinfo.commit=$(git rev-list -1 HEAD)'" . + +var ( + version = unknown + commit = unknown + date = unknown +) + +// $ go build -ldflags="-X 'github.com/skycoin/skywire-utilities/pkg/buildinfo.golist=$(go list -m -json -mod=mod github.com/skycoin/@)' -X 'github.com/skycoin/skywire-utilities/pkg/buildinfo.date=$(date -u "+%Y-%m-%dT%H:%M:%SZ")'" . +var golist string + +// ModuleInfo represents the JSON structure returned by `go list -m -json`. +type ModuleInfo struct { + Version string `json:"Version"` + Origin struct { + Hash string `json:"Hash"` + } `json:"Origin"` +} + +func init() { + if golist != "" { + var mInfo ModuleInfo + if err := json.Unmarshal([]byte(golist), &mInfo); err == nil { + if mInfo.Version != "" && version == unknown { + version = mInfo.Version + } + if mInfo.Origin.Hash != "" && commit == unknown { + commit = mInfo.Origin.Hash + } + } + } +} + +// Version returns version from the parsed module info. +func Version() string { + return version +} + +// Commit returns commit hash from the parsed module info. +func Commit() string { + return commit +} + +// Date returns date of build in RFC3339 format. +func Date() string { + return date +} + +// Get returns build info summary. +func Get() *Info { + return &Info{ + Version: Version(), + Commit: Commit(), + Date: Date(), + } +} + +// Info is build info summary. +type Info struct { + Version string `json:"version"` + Commit string `json:"commit"` + Date string `json:"date"` +} + +// WriteTo writes build info summary to io.Writer. +func (info *Info) WriteTo(w io.Writer) (int64, error) { + msg := fmt.Sprintf("Version %q built on %q against commit %q\n", info.Version, info.Date, info.Commit) + n, err := w.Write([]byte(msg)) + return int64(n), err +} diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher/cipher.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher/cipher.go new file mode 100644 index 000000000..9b140badf --- /dev/null +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher/cipher.go @@ -0,0 +1,266 @@ +// Package cipher implements common golang encoding interfaces for +// github.com/skycoin/skycoin/src/cipher +package cipher + +import ( + "bytes" + "fmt" + "math/big" + "strings" + + "github.com/skycoin/skycoin/src/cipher" +) + +func init() { + cipher.DebugLevel2 = false // DebugLevel2 causes ECDH to be really slow +} + +// GenerateKeyPair creates key pair +func GenerateKeyPair() (PubKey, SecKey) { + pk, sk := cipher.GenerateKeyPair() + return PubKey(pk), SecKey(sk) +} + +// GenerateDeterministicKeyPair generates deterministic key pair +func GenerateDeterministicKeyPair(seed []byte) (PubKey, SecKey, error) { + pk, sk, err := cipher.GenerateDeterministicKeyPair(seed) + return PubKey(pk), SecKey(sk), err +} + +// NewPubKey converts []byte to a PubKey +func NewPubKey(b []byte) (PubKey, error) { + pk, err := cipher.NewPubKey(b) + return PubKey(pk), err +} + +// PubKey is a wrapper type for cipher.PubKey that implements common +// golang interfaces. +type PubKey cipher.PubKey + +// Hex returns a hex encoded PubKey string +func (pk PubKey) Hex() string { + return cipher.PubKey(pk).Hex() +} + +// Null returns true if PubKey is the null PubKey +func (pk PubKey) Null() bool { + return cipher.PubKey(pk).Null() +} + +// String implements fmt.Stringer for PubKey. Returns Hex representation. +func (pk PubKey) String() string { + return pk.Hex() +} + +// Big returns the big.Int representation of the public key. +func (pk PubKey) Big() *big.Int { + return new(big.Int).SetBytes(pk[:]) +} + +// Set implements pflag.Value for PubKey. +func (pk *PubKey) Set(s string) error { + cPK, err := cipher.PubKeyFromHex(s) + if err != nil { + return err + } + *pk = PubKey(cPK) + return nil +} + +// Type implements pflag.Value for PubKey. +func (pk PubKey) Type() string { + return "cipher.PubKey" +} + +// MarshalText implements encoding.TextMarshaler. +func (pk PubKey) MarshalText() ([]byte, error) { + return []byte(pk.Hex()), nil +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (pk *PubKey) UnmarshalText(data []byte) error { + if bytes.Count(data, []byte("0")) == len(data) { + return nil + } + + dPK, err := cipher.PubKeyFromHex(string(data)) + if err == nil { + *pk = PubKey(dPK) + } + return err +} + +// MarshalBinary implements encoding.BinaryMarshaler. +func (pk PubKey) MarshalBinary() ([]byte, error) { + return pk[:], nil +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler. +func (pk *PubKey) UnmarshalBinary(data []byte) error { + dPK, err := cipher.NewPubKey(data) + if err == nil { + *pk = PubKey(dPK) + } + return err +} + +// PubKeys represents a slice of PubKeys. +type PubKeys []PubKey + +// String implements stringer for PubKeys. +func (p PubKeys) String() string { + res := "public keys:\n" + for _, pk := range p { + res += fmt.Sprintf("\t%s\n", pk) + } + return res +} + +// Set implements pflag.Value for PubKeys. +func (p *PubKeys) Set(list string) error { + *p = PubKeys{} + for _, s := range strings.Split(list, ",") { + var pk PubKey + if err := pk.Set(strings.TrimSpace(s)); err != nil { + return err + } + *p = append(*p, pk) + } + return nil +} + +// Type implements pflag.Value for PubKeys. +func (p PubKeys) Type() string { + return "cipher.PubKeys" +} + +// SecKey is a wrapper type for cipher.SecKey that implements common +// golang interfaces. +type SecKey cipher.SecKey + +// Hex returns a hex encoded SecKey string +func (sk SecKey) Hex() string { + return cipher.SecKey(sk).Hex() +} + +// Null returns true if SecKey is the null SecKey. +func (sk SecKey) Null() bool { + return cipher.SecKey(sk).Null() +} + +// String implements fmt.Stringer for SecKey. Returns Hex representation. +func (sk SecKey) String() string { + return sk.Hex() +} + +// Set implements pflag.Value for SecKey. +func (sk *SecKey) Set(s string) error { + cSK, err := cipher.SecKeyFromHex(s) + if err != nil { + return err + } + *sk = SecKey(cSK) + return nil +} + +// Type implements pflag.Value for SecKey. +func (sk *SecKey) Type() string { + return "cipher.SecKey" +} + +// MarshalText implements encoding.TextMarshaler. +func (sk SecKey) MarshalText() ([]byte, error) { + return []byte(sk.Hex()), nil +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (sk *SecKey) UnmarshalText(data []byte) error { + dSK, err := cipher.SecKeyFromHex(string(data)) + if err == nil { + *sk = SecKey(dSK) + } + return err +} + +// MarshalBinary implements encoding.BinaryMarshaler. +func (sk SecKey) MarshalBinary() ([]byte, error) { + return sk[:], nil +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler. +func (sk *SecKey) UnmarshalBinary(data []byte) error { + dSK, err := cipher.NewSecKey(data) + if err == nil { + *sk = SecKey(dSK) + } + return err +} + +// PubKey recovers the public key for a secret key +func (sk SecKey) PubKey() (PubKey, error) { + pk, err := cipher.PubKeyFromSecKey(cipher.SecKey(sk)) + return PubKey(pk), err +} + +// Sig is a wrapper type for cipher.Sig that implements common golang interfaces. +type Sig cipher.Sig + +// Hex returns a hex encoded Sig string +func (sig Sig) Hex() string { + return cipher.Sig(sig).Hex() +} + +// String implements fmt.Stringer for Sig. Returns Hex representation. +func (sig Sig) String() string { + return sig.Hex() +} + +// Null returns true if Sig is a null Sig +func (sig Sig) Null() bool { + return sig == Sig{} +} + +// MarshalText implements encoding.TextMarshaler. +func (sig Sig) MarshalText() ([]byte, error) { + return []byte(sig.Hex()), nil +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (sig *Sig) UnmarshalText(data []byte) error { + dSig, err := cipher.SigFromHex(string(data)) + if err == nil { + *sig = Sig(dSig) + } + return err +} + +// SignPayload creates Sig for payload using SHA256 +func SignPayload(payload []byte, sec SecKey) (Sig, error) { + sig, err := cipher.SignHash(cipher.SumSHA256(payload), cipher.SecKey(sec)) + return Sig(sig), err +} + +// VerifyPubKeySignedPayload verifies that SHA256 hash of the payload was signed by PubKey +func VerifyPubKeySignedPayload(pubkey PubKey, sig Sig, payload []byte) error { + return cipher.VerifyPubKeySignedHash(cipher.PubKey(pubkey), cipher.Sig(sig), cipher.SumSHA256(payload)) +} + +// RandByte returns rand N bytes +func RandByte(n int) []byte { + return cipher.RandByte(n) +} + +// SHA256 is a wrapper type for cipher.SHA256 that implements common +// golang interfaces. +type SHA256 cipher.SHA256 + +// SHA256FromBytes converts []byte to SHA256 +func SHA256FromBytes(b []byte) (SHA256, error) { + h, err := cipher.SHA256FromBytes(b) + return SHA256(h), err +} + +// SumSHA256 sum sha256 +func SumSHA256(b []byte) SHA256 { + return SHA256(cipher.SumSHA256(b)) +} diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher/utils_pubkey.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher/utils_pubkey.go new file mode 100644 index 000000000..aa694719b --- /dev/null +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher/utils_pubkey.go @@ -0,0 +1,24 @@ +// Package cipher pkg/cipher/ustils_pubkey.go +package cipher + +// SamePubKeys returns true when the provided public key slices have the same keys. +// The slices do not need to be in the same order. +// It is assumed that there are no duplicate elements within the slices. +func SamePubKeys(pks1, pks2 []PubKey) bool { + if len(pks1) != len(pks2) { + return false + } + + m := make(map[PubKey]struct{}, len(pks1)) + for _, pk := range pks1 { + m[pk] = struct{}{} + } + + for _, pk := range pks2 { + if _, ok := m[pk]; !ok { + return false + } + } + + return true +} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/catch.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/catch.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/catch.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/catch.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/cmd_name.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/cmd_name.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/cmd_name.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/cmd_name.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/service_flags.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/service_flags.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/service_flags.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/service_flags.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_context.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/signal_context.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_context.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/signal_context.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_unix.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/signal_unix.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_unix.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/signal_unix.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_windows.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/signal_windows.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_windows.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/signal_windows.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_unix.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_unix.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_unix.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_unix.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_windows.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_windows.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_windows.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_windows.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/dmsghttp.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/dmsghttp.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/httputil/dmsghttp.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/dmsghttp.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/error.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/error.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/httputil/error.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/error.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/health.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/health.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/httputil/health.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/health.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/httputil.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/httputil.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/httputil/httputil.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/httputil.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/log.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/log.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/httputil/log.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/log.go diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/formatter.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/formatter.go new file mode 100644 index 000000000..60b998045 --- /dev/null +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/formatter.go @@ -0,0 +1,449 @@ +// Package logging pkg/logging/formatter.go +package logging + +import ( + "bytes" + "fmt" + "io" + "os" + "sort" + "strings" + "sync" + "time" + + "github.com/mgutz/ansi" + "github.com/sirupsen/logrus" + "golang.org/x/term" +) + +const defaultTimestampFormat = time.RFC3339 + +var ( + baseTimestamp = time.Now() + defaultColorScheme = &ColorScheme{ + InfoLevelStyle: "green", + WarnLevelStyle: "yellow", + ErrorLevelStyle: "red", + FatalLevelStyle: "red", + PanicLevelStyle: "red", + DebugLevelStyle: "blue", + TraceLevelStyle: "black", + PrefixStyle: "cyan", + TimestampStyle: "black+h", + CallContextStyle: "black+h", + CriticalStyle: "magenta+h", + } + noColorsColorScheme = &compiledColorScheme{ + InfoLevelColor: ansi.ColorFunc(""), + WarnLevelColor: ansi.ColorFunc(""), + ErrorLevelColor: ansi.ColorFunc(""), + FatalLevelColor: ansi.ColorFunc(""), + PanicLevelColor: ansi.ColorFunc(""), + DebugLevelColor: ansi.ColorFunc(""), + TraceLevelColor: ansi.ColorFunc(""), + PrefixColor: ansi.ColorFunc(""), + TimestampColor: ansi.ColorFunc(""), + CallContextColor: ansi.ColorFunc(""), + CriticalColor: ansi.ColorFunc(""), + } + defaultCompiledColorScheme = compileColorScheme(defaultColorScheme) +) + +func miniTS() int { + return int(time.Since(baseTimestamp) / time.Second) +} + +// ColorScheme configures the logging output colors +type ColorScheme struct { + InfoLevelStyle string + WarnLevelStyle string + ErrorLevelStyle string + FatalLevelStyle string + PanicLevelStyle string + DebugLevelStyle string + TraceLevelStyle string + PrefixStyle string + TimestampStyle string + CallContextStyle string + CriticalStyle string +} + +type compiledColorScheme struct { + InfoLevelColor func(string) string + WarnLevelColor func(string) string + ErrorLevelColor func(string) string + FatalLevelColor func(string) string + PanicLevelColor func(string) string + DebugLevelColor func(string) string + TraceLevelColor func(string) string + PrefixColor func(string) string + TimestampColor func(string) string + CallContextColor func(string) string + CriticalColor func(string) string +} + +// TextFormatter formats log output +type TextFormatter struct { + // Set to true to bypass checking for a TTY before outputting colors. + ForceColors bool + + // Force disabling colors. For a TTY colors are enabled by default. + DisableColors bool + + // Force formatted layout, even for non-TTY output. + ForceFormatting bool + + // Disable timestamp logging. useful when output is redirected to logging + // system that already adds timestamps. + DisableTimestamp bool + + // Disable the conversion of the log levels to uppercase + DisableUppercase bool + + // Enable logging the full timestamp when a TTY is attached instead of just + // the time passed since beginning of execution. + FullTimestamp bool + + // Timestamp format to use for display when a full timestamp is printed. + TimestampFormat string + + // The fields are sorted by default for a consistent output. For applications + // that log extremely frequently and don't use the JSON formatter this may not + // be desired. + DisableSorting bool + + // Wrap empty fields in quotes if true. + QuoteEmptyFields bool + + // Can be set to the override the default quoting character " + // with something else. For example: ', or `. + QuoteCharacter string + + // Pad msg field with spaces on the right for display. + // The value for this parameter will be the size of padding. + // Its default value is zero, which means no padding will be applied for msg. + SpacePadding int + + // Always use quotes for string values (except for empty fields) + AlwaysQuoteStrings bool + + // Color scheme to use. + colorScheme *compiledColorScheme + + // Whether the logger's out is to a terminal. + isTerminal bool + + sync.Once +} + +func getCompiledColor(main string, fallback string) func(string) string { + var style string + if main != "" { + style = main + } else { + style = fallback + } + return ansi.ColorFunc(style) +} + +func compileColorScheme(s *ColorScheme) *compiledColorScheme { + return &compiledColorScheme{ + InfoLevelColor: getCompiledColor(s.InfoLevelStyle, defaultColorScheme.InfoLevelStyle), + WarnLevelColor: getCompiledColor(s.WarnLevelStyle, defaultColorScheme.WarnLevelStyle), + ErrorLevelColor: getCompiledColor(s.ErrorLevelStyle, defaultColorScheme.ErrorLevelStyle), + FatalLevelColor: getCompiledColor(s.FatalLevelStyle, defaultColorScheme.FatalLevelStyle), + PanicLevelColor: getCompiledColor(s.PanicLevelStyle, defaultColorScheme.PanicLevelStyle), + DebugLevelColor: getCompiledColor(s.DebugLevelStyle, defaultColorScheme.DebugLevelStyle), + TraceLevelColor: getCompiledColor(s.TraceLevelStyle, defaultColorScheme.TraceLevelStyle), + PrefixColor: getCompiledColor(s.PrefixStyle, defaultColorScheme.PrefixStyle), + TimestampColor: getCompiledColor(s.TimestampStyle, defaultColorScheme.TimestampStyle), + CallContextColor: getCompiledColor(s.CallContextStyle, defaultColorScheme.CallContextStyle), + CriticalColor: getCompiledColor(s.CriticalStyle, defaultColorScheme.CriticalStyle), + } +} + +func (f *TextFormatter) init(entry *logrus.Entry) { + if len(f.QuoteCharacter) == 0 { + f.QuoteCharacter = "\"" + } + if entry.Logger != nil { + f.isTerminal = f.checkIfTerminal(entry.Logger.Out) + } +} + +func (f *TextFormatter) checkIfTerminal(w io.Writer) bool { + switch v := w.(type) { + case *os.File: + return term.IsTerminal(int(v.Fd())) + default: + return false + } +} + +// SetColorScheme sets the TextFormatter's color scheme configuration +func (f *TextFormatter) SetColorScheme(colorScheme *ColorScheme) { + f.colorScheme = compileColorScheme(colorScheme) +} + +// Format formats a logrus.Entry +func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error) { + var b *bytes.Buffer + keys := make([]string, 0, len(entry.Data)) + for k := range entry.Data { + keys = append(keys, k) + } + lastKeyIdx := len(keys) - 1 + + if !f.DisableSorting { + sort.Strings(keys) + } + if entry.Buffer != nil { + b = entry.Buffer + } else { + b = &bytes.Buffer{} + } + + f.Do(func() { f.init(entry) }) + + isFormatted := f.ForceFormatting || f.isTerminal + + timestampFormat := f.TimestampFormat + if timestampFormat == "" { + timestampFormat = defaultTimestampFormat + } + if isFormatted { + isColored := (f.ForceColors || f.isTerminal) && !f.DisableColors + var colorScheme *compiledColorScheme + if isColored { + if f.colorScheme == nil { + colorScheme = defaultCompiledColorScheme + } else { + colorScheme = f.colorScheme + } + } else { + colorScheme = noColorsColorScheme + } + f.printColored(b, entry, keys, timestampFormat, colorScheme) + } else { + if !f.DisableTimestamp { + f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat), true) + } + f.appendKeyValue(b, "level", entry.Level.String(), true) + if entry.Message != "" { + f.appendKeyValue(b, "msg", entry.Message, lastKeyIdx >= 0) + } + for i, key := range keys { + f.appendKeyValue(b, key, entry.Data[key], lastKeyIdx != i) + } + } + + b.WriteByte('\n') //nolint:gosec + return b.Bytes(), nil +} + +func (f *TextFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, keys []string, timestampFormat string, colorScheme *compiledColorScheme) { + var levelColor func(string) string + var levelText string + switch entry.Level { + case logrus.InfoLevel: + levelColor = colorScheme.InfoLevelColor + case logrus.WarnLevel: + levelColor = colorScheme.WarnLevelColor + case logrus.ErrorLevel: + levelColor = colorScheme.ErrorLevelColor + case logrus.FatalLevel: + levelColor = colorScheme.FatalLevelColor + case logrus.PanicLevel: + levelColor = colorScheme.PanicLevelColor + case logrus.TraceLevel: + levelColor = colorScheme.TraceLevelColor + default: + levelColor = colorScheme.DebugLevelColor + } + + priority, ok := entry.Data[logPriorityKey] + hasPriority := ok && priority == logPriorityCritical + + if entry.Level != logrus.WarnLevel { + levelText = entry.Level.String() + } else { + levelText = "warn" + } + + if !f.DisableUppercase { + levelText = strings.ToUpper(levelText) + } + + level := levelColor(levelText) + message := entry.Message + prefix := "" + + prefixText := extractPrefix(entry) + if prefixText != "" { + prefixText = " " + prefixText + ":" + prefix = colorScheme.PrefixColor(prefixText) + } + + messageFormat := "%s" + if f.SpacePadding != 0 { + messageFormat = fmt.Sprintf("%%-%ds", f.SpacePadding) + } + if message != "" { + messageFormat = " " + messageFormat + } + + callContextParts := []string{} + if ifile, ok := entry.Data["file"]; ok { + if sfile, ok := ifile.(string); ok && sfile != "" { + callContextParts = append(callContextParts, sfile) + } + } + if ifunc, ok := entry.Data["func"]; ok { + if sfunc, ok := ifunc.(string); ok && sfunc != "" { + callContextParts = append(callContextParts, sfunc) + } + } + if iline, ok := entry.Data["line"]; ok { + sline := "" + switch iline := iline.(type) { + case string: + sline = iline + case int, uint, int32, int64, uint32, uint64: + sline = fmt.Sprint(iline) + } + if sline != "" { + callContextParts = append(callContextParts, fmt.Sprint(sline)) + } + } + callContextText := strings.Join(callContextParts, ":") + callContext := colorScheme.CallContextColor(callContextText) + if callContext != "" { + callContext = " " + callContext + } + + if f.DisableTimestamp { + if hasPriority { + str := fmt.Sprintf("%s%s%s"+messageFormat, levelText, callContextText, prefixText, message) + fmt.Fprint(b, colorScheme.CriticalColor(str)) + } else { + fmt.Fprintf(b, "%s%s%s"+messageFormat, level, callContext, prefix, message) + } + } else { + var timestamp string + if !f.FullTimestamp { + timestamp = fmt.Sprintf("[%04d]", miniTS()) + } else { + timestamp = fmt.Sprintf("[%s]", entry.Time.Format(timestampFormat)) + } + + coloredTimestamp := colorScheme.TimestampColor(timestamp) + + if hasPriority { + str := fmt.Sprintf("%s %s%s%s"+messageFormat, timestamp, levelText, callContextText, prefixText, message) + fmt.Fprint(b, colorScheme.CriticalColor(str)) + } else { + fmt.Fprintf(b, "%s %s%s%s"+messageFormat, coloredTimestamp, level, callContext, prefix, message) + } + } + + for _, k := range keys { + if k != "prefix" && k != "file" && k != "func" && k != "line" && k != logPriorityKey && k != logModuleKey { + v := entry.Data[k] + fmt.Fprintf(b, " %s", f.formatKeyValue(levelColor(k), v)) + } + } +} + +func (f *TextFormatter) needsQuoting(text string) bool { + if len(text) == 0 { + return f.QuoteEmptyFields + } + + if f.AlwaysQuoteStrings { + return true + } + + for _, ch := range text { + if !((ch >= 'a' && ch <= 'z') || + (ch >= 'A' && ch <= 'Z') || + (ch >= '0' && ch <= '9') || + ch == '-' || ch == '.') { + return true + } + } + + return false +} + +func extractPrefix(e *logrus.Entry) string { + var module string + if iModule, ok := e.Data[logModuleKey]; ok { + module, _ = iModule.(string) + } + + var priority string + if iPriority, ok := e.Data[logPriorityKey]; ok { + priority, _ = iPriority.(string) + } + + switch { + case priority == "": + return fmt.Sprintf("[%s]", module) + case module == "": + return fmt.Sprintf("[%s]", priority) + default: + return fmt.Sprintf("[%s:%s]", module, priority) + } +} + +func (f *TextFormatter) formatKeyValue(key string, value interface{}) string { + return fmt.Sprintf("%s=%s", key, f.formatValue(value)) +} + +func (f *TextFormatter) formatValue(value interface{}) string { + switch value := value.(type) { + case string: + if f.needsQuoting(value) { + return fmt.Sprintf("%s%+v%s", f.QuoteCharacter, value, f.QuoteCharacter) + } + return value + case error: + errmsg := value.Error() + if f.needsQuoting(errmsg) { + return fmt.Sprintf("%s%+v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter) + } + return errmsg + default: + return fmt.Sprintf("%+v", value) + } +} + +func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}, appendSpace bool) { + b.WriteString(key) //nolint:gosec + b.WriteByte('=') //nolint:gosec + f.appendValue(b, value) //nolint:gosec + + if appendSpace { + b.WriteByte(' ') //nolint:gosec + } +} + +func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { + switch value := value.(type) { + case string: + if f.needsQuoting(value) { + fmt.Fprintf(b, "%s%+v%s", f.QuoteCharacter, value, f.QuoteCharacter) + } else { + b.WriteString(value) //nolint:gosec + } + case error: + errmsg := value.Error() + if f.needsQuoting(errmsg) { + fmt.Fprintf(b, "%s%+v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter) + } else { + b.WriteString(errmsg) //nolint:gosec + } + default: + fmt.Fprint(b, value) + } +} diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/hooks.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/hooks.go new file mode 100644 index 000000000..8a74fbf2b --- /dev/null +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/hooks.go @@ -0,0 +1,45 @@ +// Package logging pkg/logging/hooks.go +package logging + +import ( + "io" + + "github.com/sirupsen/logrus" +) + +// WriteHook is a logrus.Hook that logs to an io.Writer +type WriteHook struct { + w io.Writer + formatter logrus.Formatter +} + +// NewWriteHook returns a new WriteHook +func NewWriteHook(w io.Writer) *WriteHook { + return &WriteHook{ + w: w, + formatter: &TextFormatter{ + DisableColors: true, + FullTimestamp: true, + AlwaysQuoteStrings: true, + QuoteEmptyFields: true, + ForceFormatting: true, + }, + } +} + +// Levels returns Levels accepted by the WriteHook. +// All logrus.Levels are returned. +func (f *WriteHook) Levels() []logrus.Level { + return logrus.AllLevels +} + +// Fire writes a logrus.Entry to the file +func (f *WriteHook) Fire(e *logrus.Entry) error { + b, err := f.formatter.Format(e) + if err != nil { + return err + } + + _, err = f.w.Write(b) + return err +} diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/logger.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/logger.go new file mode 100644 index 000000000..5f2f3f13a --- /dev/null +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/logger.go @@ -0,0 +1,69 @@ +// Package logging pkg/logging/logger.go +package logging + +import ( + "os" + "time" + + "github.com/sirupsen/logrus" +) + +// Logger wraps logrus.FieldLogger +type Logger struct { + logrus.FieldLogger +} + +// Critical adds special critical-level fields for specially highlighted logging, +// since logrus lacks a distinct critical field and does not have configurable log levels +func (logger *Logger) Critical() logrus.FieldLogger { + return logger.WithField(logPriorityKey, logPriorityCritical) +} + +// WithTime overrides time, used by logger. +func (logger *Logger) WithTime(t time.Time) *logrus.Entry { + return logger.WithFields(logrus.Fields{}).WithTime(t) +} + +// MasterLogger wraps logrus.Logger and is able to create new package-aware loggers +type MasterLogger struct { + *logrus.Logger +} + +// NewMasterLogger creates a new package-aware logger with formatting string +func NewMasterLogger() *MasterLogger { + hooks := make(logrus.LevelHooks) + + return &MasterLogger{ + Logger: &logrus.Logger{ + Out: os.Stdout, + Formatter: &TextFormatter{ + FullTimestamp: true, + AlwaysQuoteStrings: true, + QuoteEmptyFields: true, + ForceFormatting: true, + DisableColors: false, + ForceColors: false, + TimestampFormat: "2006-01-02T15:04:05.999999999Z07:00", + }, + Hooks: hooks, + Level: logrus.DebugLevel, + }, + } +} + +// PackageLogger instantiates a package-aware logger +func (logger *MasterLogger) PackageLogger(moduleName string) *Logger { + return &Logger{ + FieldLogger: logger.WithField(logModuleKey, moduleName), + } +} + +// EnableColors enables colored logging +func (logger *MasterLogger) EnableColors() { + logger.Formatter.(*TextFormatter).DisableColors = false +} + +// DisableColors disables colored logging +func (logger *MasterLogger) DisableColors() { + logger.Formatter.(*TextFormatter).DisableColors = true +} diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/logging.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/logging.go new file mode 100644 index 000000000..cd0d2a352 --- /dev/null +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging/logging.go @@ -0,0 +1,85 @@ +/* +Package logging provides application logging utilities +*/ +package logging + +import ( + "errors" + "io" + "strings" + + "github.com/sirupsen/logrus" +) + +var log = NewMasterLogger() + +const ( + // logModuleKey is the key used for the module name data entry + logModuleKey = "_module" + // logPriorityKey is the log entry key for priority log statements + logPriorityKey = "_priority" + // logPriorityCritical is the log entry value for priority log statements + logPriorityCritical = "CRITICAL" +) + +// LevelFromString returns a logrus.Level from a string identifier +func LevelFromString(s string) (logrus.Level, error) { + switch strings.ToLower(s) { + case "debug": + return logrus.DebugLevel, nil + case "info", "notice": + return logrus.InfoLevel, nil + case "warn", "warning": + return logrus.WarnLevel, nil + case "error": + return logrus.ErrorLevel, nil + case "fatal", "critical": + return logrus.FatalLevel, nil + case "panic": + return logrus.PanicLevel, nil + case "trace": + return logrus.TraceLevel, nil + default: + return logrus.DebugLevel, errors.New("could not convert string to log level") + } +} + +// MustGetLogger returns a package-aware logger from the master logger +func MustGetLogger(module string) *Logger { + return log.PackageLogger(module) +} + +// AddHook adds a hook to the global logger +func AddHook(hook logrus.Hook) { + log.AddHook(hook) +} + +// EnableColors enables colored logging +func EnableColors() { + log.EnableColors() +} + +// DisableColors disables colored logging +func DisableColors() { + log.DisableColors() +} + +// SetLevel sets the logger's minimum log level +func SetLevel(level logrus.Level) { + log.SetLevel(level) +} + +// GetLevel returns the logger level +func GetLevel() logrus.Level { + return log.GetLevel() +} + +// SetOutputTo sets the logger's output to an io.Writer +func SetOutputTo(w io.Writer) { + log.Out = w +} + +// Disable disables the logger completely +func Disable() { + log.Out = io.Discard +} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/http.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/http.go similarity index 92% rename from vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/http.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/http.go index 2515cdabf..6957dc290 100644 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/http.go +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/http.go @@ -12,7 +12,7 @@ import ( // AddMetricsHandler adds a prometheus-format Handle at '/metrics' to the provided serve mux. func AddMetricsHandler(mux *chi.Mux) { - mux.HandleFunc("/metrics", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/metrics", func(w http.ResponseWriter, _ *http.Request) { metrics.WritePrometheus(w, true) }) } diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/request_duration_middleware.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/request_duration_middleware.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/request_duration_middleware.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/request_duration_middleware.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/requests_in_flight_count_middleware.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/requests_in_flight_count_middleware.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/requests_in_flight_count_middleware.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/requests_in_flight_count_middleware.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/status_response_writer.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/status_response_writer.go similarity index 97% rename from vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/status_response_writer.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/status_response_writer.go index 578de4317..a2fd762ef 100644 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/status_response_writer.go +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/status_response_writer.go @@ -1,7 +1,9 @@ // Package metricsutil pkg/metricsutil/status_response_writer.go package metricsutil -import "net/http" +import ( + "net/http" +) // StatusResponseWriter wraps `http.ResponseWriter` but stores status code // on call to `WriteHeader`. diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/copy.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/copy.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/netutil/copy.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/copy.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net.go similarity index 97% rename from vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net.go index f629b999e..fe5e56893 100644 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net.go +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net.go @@ -126,9 +126,9 @@ func HasPublicIP() (bool, error) { func ExtractPort(addr net.Addr) (uint16, error) { switch address := addr.(type) { case *net.TCPAddr: - return uint16(address.Port), nil + return uint16(address.Port), nil //nolint case *net.UDPAddr: - return uint16(address.Port), nil + return uint16(address.Port), nil //nolint default: return 0, fmt.Errorf("extract port: invalid address: %s", addr.String()) } diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_darwin.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net_darwin.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_darwin.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net_darwin.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_linux.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net_linux.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_linux.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net_linux.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_windows.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net_windows.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_windows.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/net_windows.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/porter.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/porter.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/netutil/porter.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/porter.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/retrier.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/retrier.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/netutil/retrier.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil/retrier.go diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/networkmonitor/networkmonitor.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor/networkmonitor.go similarity index 100% rename from vendor/github.com/skycoin/skywire-utilities/pkg/networkmonitor/networkmonitor.go rename to vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor/networkmonitor.go diff --git a/vendor/github.com/skycoin/skywire/skywire.go b/vendor/github.com/skycoin/skywire/skywire.go index ee99b8062..47a18175b 100644 --- a/vendor/github.com/skycoin/skywire/skywire.go +++ b/vendor/github.com/skycoin/skywire/skywire.go @@ -1,4 +1,6 @@ -// Package skywire skywire.go +// Package skywire github.com/skycoin/skywire/skywire.go +// +//go:generate go run cmd/gen/gen.go -jo arches.json package skywire import ( @@ -25,6 +27,22 @@ var ServicesJSON []byte //go:embed dmsghttp-config.json var DmsghttpJSON []byte +// ArchesJSON is the embedded arches.json file +// go run cmd/gen/gen.go -jo arches.json +// ["amd64","arm64","386","arm","ppc64","riscv64","wasm","loong64","mips","mips64","mips64le","mipsle","ppc64le","s390x"] +// +//go:embed arches.json +var ArchesJSON []byte + +// Architectures is an array of GOARCH architectures +var Architectures []string + +// MainnetRules is the mainnet_rules.md ; it shouldn't have to be embedded here but goland doesn't allow 'embed ../../../../mainnet_rules.md' +// print the mainnet rules with `skywire cli reward rules` +// +//go:embed mainnet_rules.md +var MainnetRules string + // EnvServices is the wrapper struct for the outer JSON - i.e. 'prod' or 'test' deployment config type EnvServices struct { Test json.RawMessage `json:"test"` @@ -64,8 +82,12 @@ var Test Services var TestConf Conf func init() { + err := json.Unmarshal(ArchesJSON, &Architectures) + if err != nil { + log.Panic("arches.json ", err) + } var js interface{} - err := json.Unmarshal([]byte(ServicesJSON), &js) + err = json.Unmarshal([]byte(ServicesJSON), &js) if err != nil { log.Panic("services-config.json ", err) } diff --git a/vendor/modules.txt b/vendor/modules.txt index e2e1ba942..3cbc2e5c7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -76,13 +76,13 @@ github.com/confiant-inc/go-socks5 # github.com/creack/pty v1.1.23 ## explicit; go 1.18 github.com/creack/pty -# github.com/davecgh/go-spew v1.1.1 +# github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit github.com/davecgh/go-spew/spew # github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f ## explicit github.com/dgryski/go-rendezvous -# github.com/fatih/color v1.17.0 +# github.com/fatih/color v1.18.0 ## explicit; go 1.17 github.com/fatih/color # github.com/gabriel-vasile/mimetype v1.4.6 @@ -186,7 +186,7 @@ github.com/pelletier/go-toml/v2/unstable # github.com/pires/go-proxyproto v0.8.0 ## explicit; go 1.18 github.com/pires/go-proxyproto -# github.com/pmezard/go-difflib v1.0.0 +# github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 ## explicit github.com/pmezard/go-difflib/difflib # github.com/sirupsen/logrus v1.9.3 @@ -196,27 +196,30 @@ github.com/sirupsen/logrus/hooks/syslog # github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 ## explicit github.com/skycoin/noise -# github.com/skycoin/skycoin v0.28.0 -## explicit; go 1.14 +# github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f +## explicit; go 1.22.0 github.com/skycoin/skycoin/src/cipher github.com/skycoin/skycoin/src/cipher/base58 github.com/skycoin/skycoin/src/cipher/ripemd160 github.com/skycoin/skycoin/src/cipher/secp256k1-go github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2 github.com/skycoin/skycoin/src/util/logging -# github.com/skycoin/skywire v1.3.28 -## explicit; go 1.21 +# github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb +## explicit; go 1.23 github.com/skycoin/skywire +github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo +github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher +github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil +github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil +github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging +github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil +github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil +github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor # github.com/skycoin/skywire-utilities v1.3.25 ## explicit; go 1.21 github.com/skycoin/skywire-utilities/pkg/buildinfo github.com/skycoin/skywire-utilities/pkg/cipher -github.com/skycoin/skywire-utilities/pkg/cmdutil -github.com/skycoin/skywire-utilities/pkg/httputil github.com/skycoin/skywire-utilities/pkg/logging -github.com/skycoin/skywire-utilities/pkg/metricsutil -github.com/skycoin/skywire-utilities/pkg/netutil -github.com/skycoin/skywire-utilities/pkg/networkmonitor # github.com/spf13/cobra v1.8.1 ## explicit; go 1.15 github.com/spf13/cobra @@ -316,8 +319,6 @@ google.golang.org/protobuf/proto google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface -# gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c -## explicit; go 1.11 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 From 77e9406ab44b2bc4822dc36b369cc2bd58faf222 Mon Sep 17 00:00:00 2001 From: Moses Narrow Date: Tue, 17 Dec 2024 13:26:47 -0600 Subject: [PATCH 2/2] update vendor deps --- go.mod | 5 +- go.sum | 6 +- .../pkg/buildinfo/buildinfo.go | 53 --- .../skywire-utilities/pkg/cipher/cipher.go | 266 ----------- .../pkg/cipher/utils_pubkey.go | 24 - .../pkg/logging/formatter.go | 449 ------------------ .../skywire-utilities/pkg/logging/hooks.go | 45 -- .../skywire-utilities/pkg/logging/logger.go | 69 --- .../skywire-utilities/pkg/logging/logging.go | 85 ---- .../pkg/cmdutil/service_flags.go | 2 +- .../pkg/cmdutil/sysloghook_unix.go | 2 +- .../pkg/cmdutil/sysloghook_windows.go | 2 +- .../skywire-utilities/pkg/httputil/health.go | 2 +- .../pkg/httputil/httputil.go | 2 +- vendor/github.com/skycoin/skywire/skywire.go | 2 +- vendor/modules.txt | 7 +- 16 files changed, 11 insertions(+), 1010 deletions(-) delete mode 100644 vendor/github.com/skycoin/skywire-utilities/pkg/buildinfo/buildinfo.go delete mode 100644 vendor/github.com/skycoin/skywire-utilities/pkg/cipher/cipher.go delete mode 100644 vendor/github.com/skycoin/skywire-utilities/pkg/cipher/utils_pubkey.go delete mode 100644 vendor/github.com/skycoin/skywire-utilities/pkg/logging/formatter.go delete mode 100644 vendor/github.com/skycoin/skywire-utilities/pkg/logging/hooks.go delete mode 100644 vendor/github.com/skycoin/skywire-utilities/pkg/logging/logger.go delete mode 100644 vendor/github.com/skycoin/skywire-utilities/pkg/logging/logging.go diff --git a/go.mod b/go.mod index e0652386b..e9bc821ec 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f - github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb + github.com/skycoin/skywire v1.3.29-rc1.0.20241217192205-cb65518c5522 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 golang.org/x/net v0.30.0 @@ -58,7 +58,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/skycoin/skywire-utilities v1.3.25 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect @@ -75,7 +74,7 @@ require ( // Uncomment for tests with alternate branches of 'skywire-utilities' //replace github.com/skycoin/skywire => ../skywire //replace github.com/skycoin/skywire => github.com/skycoin/skywire -//replace github.com/skycoin/skywire => github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb +//replace github.com/skycoin/skywire => github.com/skycoin/skywire v1.3.29-rc1.0.20241217192205-cb65518c5522 // replace github.com/skycoin/skywire-utilities => ../skywire-utilities // replace github.com/skycoin/skywire-utilities => github.com/skycoin/skywire-utilities diff --git a/go.sum b/go.sum index 4bf8bc681..92f98a257 100644 --- a/go.sum +++ b/go.sum @@ -124,10 +124,8 @@ github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0 github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o= github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f h1:isCGulVHahQfFoS37B7JT3rb8n4Ih2o9oMg2p25D7o8= github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f/go.mod h1:1iZLomiHUOEvmJaBNrzE+Tllf09uhrCZ5JLL3cHdKKQ= -github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb h1:QzsuvwRi+bAeIqtcwARqVsnhWRzCHxO38ZEdhdKEv78= -github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb/go.mod h1:QflvgSeNGMsDmiHUcFQt4AD2N+YG0VKeMHY2gUSI0bY= -github.com/skycoin/skywire-utilities v1.3.25 h1:mk8dUonFdhVopFF3d9wbOyXXoiuAO+mN1y+ve6SzgX4= -github.com/skycoin/skywire-utilities v1.3.25/go.mod h1:yFKWpL1bDRPKU3uK+cTF4PnYUMe+eyIj5N2bk4sF5Cw= +github.com/skycoin/skywire v1.3.29-rc1.0.20241217192205-cb65518c5522 h1:P79IKUboXySZWCjxBn1cOOUZh0r5c27UXZtdp6jabY0= +github.com/skycoin/skywire v1.3.29-rc1.0.20241217192205-cb65518c5522/go.mod h1:IPjjLQ/fcE6EKgNQffCEGWP3oUf+VnTDXxl6+rTjk5E= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/buildinfo/buildinfo.go b/vendor/github.com/skycoin/skywire-utilities/pkg/buildinfo/buildinfo.go deleted file mode 100644 index 4c4ade605..000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/buildinfo/buildinfo.go +++ /dev/null @@ -1,53 +0,0 @@ -// Package buildinfo pkg/buildinfo/buildinfo.go -package buildinfo - -import ( - "fmt" - "io" -) - -const unknown = "unknown" - -var ( - version = unknown - commit = unknown - date = unknown -) - -// Version returns version from git describe. -func Version() string { - return version -} - -// Commit returns commit hash. -func Commit() string { - return commit -} - -// Date returns date of build in RFC3339 format. -func Date() string { - return date -} - -// Get returns build info summary. -func Get() *Info { - return &Info{ - Version: Version(), - Commit: Commit(), - Date: Date(), - } -} - -// Info is build info summary. -type Info struct { - Version string `json:"version"` - Commit string `json:"commit"` - Date string `json:"date"` -} - -// WriteTo writes build info summary to io.Writer. -func (info *Info) WriteTo(w io.Writer) (int64, error) { - msg := fmt.Sprintf("Version %q built on %q against commit %q\n", info.Version, info.Date, info.Commit) - n, err := w.Write([]byte(msg)) - return int64(n), err -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/cipher.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/cipher.go deleted file mode 100644 index 9b140badf..000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/cipher.go +++ /dev/null @@ -1,266 +0,0 @@ -// Package cipher implements common golang encoding interfaces for -// github.com/skycoin/skycoin/src/cipher -package cipher - -import ( - "bytes" - "fmt" - "math/big" - "strings" - - "github.com/skycoin/skycoin/src/cipher" -) - -func init() { - cipher.DebugLevel2 = false // DebugLevel2 causes ECDH to be really slow -} - -// GenerateKeyPair creates key pair -func GenerateKeyPair() (PubKey, SecKey) { - pk, sk := cipher.GenerateKeyPair() - return PubKey(pk), SecKey(sk) -} - -// GenerateDeterministicKeyPair generates deterministic key pair -func GenerateDeterministicKeyPair(seed []byte) (PubKey, SecKey, error) { - pk, sk, err := cipher.GenerateDeterministicKeyPair(seed) - return PubKey(pk), SecKey(sk), err -} - -// NewPubKey converts []byte to a PubKey -func NewPubKey(b []byte) (PubKey, error) { - pk, err := cipher.NewPubKey(b) - return PubKey(pk), err -} - -// PubKey is a wrapper type for cipher.PubKey that implements common -// golang interfaces. -type PubKey cipher.PubKey - -// Hex returns a hex encoded PubKey string -func (pk PubKey) Hex() string { - return cipher.PubKey(pk).Hex() -} - -// Null returns true if PubKey is the null PubKey -func (pk PubKey) Null() bool { - return cipher.PubKey(pk).Null() -} - -// String implements fmt.Stringer for PubKey. Returns Hex representation. -func (pk PubKey) String() string { - return pk.Hex() -} - -// Big returns the big.Int representation of the public key. -func (pk PubKey) Big() *big.Int { - return new(big.Int).SetBytes(pk[:]) -} - -// Set implements pflag.Value for PubKey. -func (pk *PubKey) Set(s string) error { - cPK, err := cipher.PubKeyFromHex(s) - if err != nil { - return err - } - *pk = PubKey(cPK) - return nil -} - -// Type implements pflag.Value for PubKey. -func (pk PubKey) Type() string { - return "cipher.PubKey" -} - -// MarshalText implements encoding.TextMarshaler. -func (pk PubKey) MarshalText() ([]byte, error) { - return []byte(pk.Hex()), nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (pk *PubKey) UnmarshalText(data []byte) error { - if bytes.Count(data, []byte("0")) == len(data) { - return nil - } - - dPK, err := cipher.PubKeyFromHex(string(data)) - if err == nil { - *pk = PubKey(dPK) - } - return err -} - -// MarshalBinary implements encoding.BinaryMarshaler. -func (pk PubKey) MarshalBinary() ([]byte, error) { - return pk[:], nil -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler. -func (pk *PubKey) UnmarshalBinary(data []byte) error { - dPK, err := cipher.NewPubKey(data) - if err == nil { - *pk = PubKey(dPK) - } - return err -} - -// PubKeys represents a slice of PubKeys. -type PubKeys []PubKey - -// String implements stringer for PubKeys. -func (p PubKeys) String() string { - res := "public keys:\n" - for _, pk := range p { - res += fmt.Sprintf("\t%s\n", pk) - } - return res -} - -// Set implements pflag.Value for PubKeys. -func (p *PubKeys) Set(list string) error { - *p = PubKeys{} - for _, s := range strings.Split(list, ",") { - var pk PubKey - if err := pk.Set(strings.TrimSpace(s)); err != nil { - return err - } - *p = append(*p, pk) - } - return nil -} - -// Type implements pflag.Value for PubKeys. -func (p PubKeys) Type() string { - return "cipher.PubKeys" -} - -// SecKey is a wrapper type for cipher.SecKey that implements common -// golang interfaces. -type SecKey cipher.SecKey - -// Hex returns a hex encoded SecKey string -func (sk SecKey) Hex() string { - return cipher.SecKey(sk).Hex() -} - -// Null returns true if SecKey is the null SecKey. -func (sk SecKey) Null() bool { - return cipher.SecKey(sk).Null() -} - -// String implements fmt.Stringer for SecKey. Returns Hex representation. -func (sk SecKey) String() string { - return sk.Hex() -} - -// Set implements pflag.Value for SecKey. -func (sk *SecKey) Set(s string) error { - cSK, err := cipher.SecKeyFromHex(s) - if err != nil { - return err - } - *sk = SecKey(cSK) - return nil -} - -// Type implements pflag.Value for SecKey. -func (sk *SecKey) Type() string { - return "cipher.SecKey" -} - -// MarshalText implements encoding.TextMarshaler. -func (sk SecKey) MarshalText() ([]byte, error) { - return []byte(sk.Hex()), nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (sk *SecKey) UnmarshalText(data []byte) error { - dSK, err := cipher.SecKeyFromHex(string(data)) - if err == nil { - *sk = SecKey(dSK) - } - return err -} - -// MarshalBinary implements encoding.BinaryMarshaler. -func (sk SecKey) MarshalBinary() ([]byte, error) { - return sk[:], nil -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler. -func (sk *SecKey) UnmarshalBinary(data []byte) error { - dSK, err := cipher.NewSecKey(data) - if err == nil { - *sk = SecKey(dSK) - } - return err -} - -// PubKey recovers the public key for a secret key -func (sk SecKey) PubKey() (PubKey, error) { - pk, err := cipher.PubKeyFromSecKey(cipher.SecKey(sk)) - return PubKey(pk), err -} - -// Sig is a wrapper type for cipher.Sig that implements common golang interfaces. -type Sig cipher.Sig - -// Hex returns a hex encoded Sig string -func (sig Sig) Hex() string { - return cipher.Sig(sig).Hex() -} - -// String implements fmt.Stringer for Sig. Returns Hex representation. -func (sig Sig) String() string { - return sig.Hex() -} - -// Null returns true if Sig is a null Sig -func (sig Sig) Null() bool { - return sig == Sig{} -} - -// MarshalText implements encoding.TextMarshaler. -func (sig Sig) MarshalText() ([]byte, error) { - return []byte(sig.Hex()), nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (sig *Sig) UnmarshalText(data []byte) error { - dSig, err := cipher.SigFromHex(string(data)) - if err == nil { - *sig = Sig(dSig) - } - return err -} - -// SignPayload creates Sig for payload using SHA256 -func SignPayload(payload []byte, sec SecKey) (Sig, error) { - sig, err := cipher.SignHash(cipher.SumSHA256(payload), cipher.SecKey(sec)) - return Sig(sig), err -} - -// VerifyPubKeySignedPayload verifies that SHA256 hash of the payload was signed by PubKey -func VerifyPubKeySignedPayload(pubkey PubKey, sig Sig, payload []byte) error { - return cipher.VerifyPubKeySignedHash(cipher.PubKey(pubkey), cipher.Sig(sig), cipher.SumSHA256(payload)) -} - -// RandByte returns rand N bytes -func RandByte(n int) []byte { - return cipher.RandByte(n) -} - -// SHA256 is a wrapper type for cipher.SHA256 that implements common -// golang interfaces. -type SHA256 cipher.SHA256 - -// SHA256FromBytes converts []byte to SHA256 -func SHA256FromBytes(b []byte) (SHA256, error) { - h, err := cipher.SHA256FromBytes(b) - return SHA256(h), err -} - -// SumSHA256 sum sha256 -func SumSHA256(b []byte) SHA256 { - return SHA256(cipher.SumSHA256(b)) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/utils_pubkey.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/utils_pubkey.go deleted file mode 100644 index aa694719b..000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/utils_pubkey.go +++ /dev/null @@ -1,24 +0,0 @@ -// Package cipher pkg/cipher/ustils_pubkey.go -package cipher - -// SamePubKeys returns true when the provided public key slices have the same keys. -// The slices do not need to be in the same order. -// It is assumed that there are no duplicate elements within the slices. -func SamePubKeys(pks1, pks2 []PubKey) bool { - if len(pks1) != len(pks2) { - return false - } - - m := make(map[PubKey]struct{}, len(pks1)) - for _, pk := range pks1 { - m[pk] = struct{}{} - } - - for _, pk := range pks2 { - if _, ok := m[pk]; !ok { - return false - } - } - - return true -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/formatter.go b/vendor/github.com/skycoin/skywire-utilities/pkg/logging/formatter.go deleted file mode 100644 index 60b998045..000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/formatter.go +++ /dev/null @@ -1,449 +0,0 @@ -// Package logging pkg/logging/formatter.go -package logging - -import ( - "bytes" - "fmt" - "io" - "os" - "sort" - "strings" - "sync" - "time" - - "github.com/mgutz/ansi" - "github.com/sirupsen/logrus" - "golang.org/x/term" -) - -const defaultTimestampFormat = time.RFC3339 - -var ( - baseTimestamp = time.Now() - defaultColorScheme = &ColorScheme{ - InfoLevelStyle: "green", - WarnLevelStyle: "yellow", - ErrorLevelStyle: "red", - FatalLevelStyle: "red", - PanicLevelStyle: "red", - DebugLevelStyle: "blue", - TraceLevelStyle: "black", - PrefixStyle: "cyan", - TimestampStyle: "black+h", - CallContextStyle: "black+h", - CriticalStyle: "magenta+h", - } - noColorsColorScheme = &compiledColorScheme{ - InfoLevelColor: ansi.ColorFunc(""), - WarnLevelColor: ansi.ColorFunc(""), - ErrorLevelColor: ansi.ColorFunc(""), - FatalLevelColor: ansi.ColorFunc(""), - PanicLevelColor: ansi.ColorFunc(""), - DebugLevelColor: ansi.ColorFunc(""), - TraceLevelColor: ansi.ColorFunc(""), - PrefixColor: ansi.ColorFunc(""), - TimestampColor: ansi.ColorFunc(""), - CallContextColor: ansi.ColorFunc(""), - CriticalColor: ansi.ColorFunc(""), - } - defaultCompiledColorScheme = compileColorScheme(defaultColorScheme) -) - -func miniTS() int { - return int(time.Since(baseTimestamp) / time.Second) -} - -// ColorScheme configures the logging output colors -type ColorScheme struct { - InfoLevelStyle string - WarnLevelStyle string - ErrorLevelStyle string - FatalLevelStyle string - PanicLevelStyle string - DebugLevelStyle string - TraceLevelStyle string - PrefixStyle string - TimestampStyle string - CallContextStyle string - CriticalStyle string -} - -type compiledColorScheme struct { - InfoLevelColor func(string) string - WarnLevelColor func(string) string - ErrorLevelColor func(string) string - FatalLevelColor func(string) string - PanicLevelColor func(string) string - DebugLevelColor func(string) string - TraceLevelColor func(string) string - PrefixColor func(string) string - TimestampColor func(string) string - CallContextColor func(string) string - CriticalColor func(string) string -} - -// TextFormatter formats log output -type TextFormatter struct { - // Set to true to bypass checking for a TTY before outputting colors. - ForceColors bool - - // Force disabling colors. For a TTY colors are enabled by default. - DisableColors bool - - // Force formatted layout, even for non-TTY output. - ForceFormatting bool - - // Disable timestamp logging. useful when output is redirected to logging - // system that already adds timestamps. - DisableTimestamp bool - - // Disable the conversion of the log levels to uppercase - DisableUppercase bool - - // Enable logging the full timestamp when a TTY is attached instead of just - // the time passed since beginning of execution. - FullTimestamp bool - - // Timestamp format to use for display when a full timestamp is printed. - TimestampFormat string - - // The fields are sorted by default for a consistent output. For applications - // that log extremely frequently and don't use the JSON formatter this may not - // be desired. - DisableSorting bool - - // Wrap empty fields in quotes if true. - QuoteEmptyFields bool - - // Can be set to the override the default quoting character " - // with something else. For example: ', or `. - QuoteCharacter string - - // Pad msg field with spaces on the right for display. - // The value for this parameter will be the size of padding. - // Its default value is zero, which means no padding will be applied for msg. - SpacePadding int - - // Always use quotes for string values (except for empty fields) - AlwaysQuoteStrings bool - - // Color scheme to use. - colorScheme *compiledColorScheme - - // Whether the logger's out is to a terminal. - isTerminal bool - - sync.Once -} - -func getCompiledColor(main string, fallback string) func(string) string { - var style string - if main != "" { - style = main - } else { - style = fallback - } - return ansi.ColorFunc(style) -} - -func compileColorScheme(s *ColorScheme) *compiledColorScheme { - return &compiledColorScheme{ - InfoLevelColor: getCompiledColor(s.InfoLevelStyle, defaultColorScheme.InfoLevelStyle), - WarnLevelColor: getCompiledColor(s.WarnLevelStyle, defaultColorScheme.WarnLevelStyle), - ErrorLevelColor: getCompiledColor(s.ErrorLevelStyle, defaultColorScheme.ErrorLevelStyle), - FatalLevelColor: getCompiledColor(s.FatalLevelStyle, defaultColorScheme.FatalLevelStyle), - PanicLevelColor: getCompiledColor(s.PanicLevelStyle, defaultColorScheme.PanicLevelStyle), - DebugLevelColor: getCompiledColor(s.DebugLevelStyle, defaultColorScheme.DebugLevelStyle), - TraceLevelColor: getCompiledColor(s.TraceLevelStyle, defaultColorScheme.TraceLevelStyle), - PrefixColor: getCompiledColor(s.PrefixStyle, defaultColorScheme.PrefixStyle), - TimestampColor: getCompiledColor(s.TimestampStyle, defaultColorScheme.TimestampStyle), - CallContextColor: getCompiledColor(s.CallContextStyle, defaultColorScheme.CallContextStyle), - CriticalColor: getCompiledColor(s.CriticalStyle, defaultColorScheme.CriticalStyle), - } -} - -func (f *TextFormatter) init(entry *logrus.Entry) { - if len(f.QuoteCharacter) == 0 { - f.QuoteCharacter = "\"" - } - if entry.Logger != nil { - f.isTerminal = f.checkIfTerminal(entry.Logger.Out) - } -} - -func (f *TextFormatter) checkIfTerminal(w io.Writer) bool { - switch v := w.(type) { - case *os.File: - return term.IsTerminal(int(v.Fd())) - default: - return false - } -} - -// SetColorScheme sets the TextFormatter's color scheme configuration -func (f *TextFormatter) SetColorScheme(colorScheme *ColorScheme) { - f.colorScheme = compileColorScheme(colorScheme) -} - -// Format formats a logrus.Entry -func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error) { - var b *bytes.Buffer - keys := make([]string, 0, len(entry.Data)) - for k := range entry.Data { - keys = append(keys, k) - } - lastKeyIdx := len(keys) - 1 - - if !f.DisableSorting { - sort.Strings(keys) - } - if entry.Buffer != nil { - b = entry.Buffer - } else { - b = &bytes.Buffer{} - } - - f.Do(func() { f.init(entry) }) - - isFormatted := f.ForceFormatting || f.isTerminal - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = defaultTimestampFormat - } - if isFormatted { - isColored := (f.ForceColors || f.isTerminal) && !f.DisableColors - var colorScheme *compiledColorScheme - if isColored { - if f.colorScheme == nil { - colorScheme = defaultCompiledColorScheme - } else { - colorScheme = f.colorScheme - } - } else { - colorScheme = noColorsColorScheme - } - f.printColored(b, entry, keys, timestampFormat, colorScheme) - } else { - if !f.DisableTimestamp { - f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat), true) - } - f.appendKeyValue(b, "level", entry.Level.String(), true) - if entry.Message != "" { - f.appendKeyValue(b, "msg", entry.Message, lastKeyIdx >= 0) - } - for i, key := range keys { - f.appendKeyValue(b, key, entry.Data[key], lastKeyIdx != i) - } - } - - b.WriteByte('\n') //nolint:gosec - return b.Bytes(), nil -} - -func (f *TextFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, keys []string, timestampFormat string, colorScheme *compiledColorScheme) { - var levelColor func(string) string - var levelText string - switch entry.Level { - case logrus.InfoLevel: - levelColor = colorScheme.InfoLevelColor - case logrus.WarnLevel: - levelColor = colorScheme.WarnLevelColor - case logrus.ErrorLevel: - levelColor = colorScheme.ErrorLevelColor - case logrus.FatalLevel: - levelColor = colorScheme.FatalLevelColor - case logrus.PanicLevel: - levelColor = colorScheme.PanicLevelColor - case logrus.TraceLevel: - levelColor = colorScheme.TraceLevelColor - default: - levelColor = colorScheme.DebugLevelColor - } - - priority, ok := entry.Data[logPriorityKey] - hasPriority := ok && priority == logPriorityCritical - - if entry.Level != logrus.WarnLevel { - levelText = entry.Level.String() - } else { - levelText = "warn" - } - - if !f.DisableUppercase { - levelText = strings.ToUpper(levelText) - } - - level := levelColor(levelText) - message := entry.Message - prefix := "" - - prefixText := extractPrefix(entry) - if prefixText != "" { - prefixText = " " + prefixText + ":" - prefix = colorScheme.PrefixColor(prefixText) - } - - messageFormat := "%s" - if f.SpacePadding != 0 { - messageFormat = fmt.Sprintf("%%-%ds", f.SpacePadding) - } - if message != "" { - messageFormat = " " + messageFormat - } - - callContextParts := []string{} - if ifile, ok := entry.Data["file"]; ok { - if sfile, ok := ifile.(string); ok && sfile != "" { - callContextParts = append(callContextParts, sfile) - } - } - if ifunc, ok := entry.Data["func"]; ok { - if sfunc, ok := ifunc.(string); ok && sfunc != "" { - callContextParts = append(callContextParts, sfunc) - } - } - if iline, ok := entry.Data["line"]; ok { - sline := "" - switch iline := iline.(type) { - case string: - sline = iline - case int, uint, int32, int64, uint32, uint64: - sline = fmt.Sprint(iline) - } - if sline != "" { - callContextParts = append(callContextParts, fmt.Sprint(sline)) - } - } - callContextText := strings.Join(callContextParts, ":") - callContext := colorScheme.CallContextColor(callContextText) - if callContext != "" { - callContext = " " + callContext - } - - if f.DisableTimestamp { - if hasPriority { - str := fmt.Sprintf("%s%s%s"+messageFormat, levelText, callContextText, prefixText, message) - fmt.Fprint(b, colorScheme.CriticalColor(str)) - } else { - fmt.Fprintf(b, "%s%s%s"+messageFormat, level, callContext, prefix, message) - } - } else { - var timestamp string - if !f.FullTimestamp { - timestamp = fmt.Sprintf("[%04d]", miniTS()) - } else { - timestamp = fmt.Sprintf("[%s]", entry.Time.Format(timestampFormat)) - } - - coloredTimestamp := colorScheme.TimestampColor(timestamp) - - if hasPriority { - str := fmt.Sprintf("%s %s%s%s"+messageFormat, timestamp, levelText, callContextText, prefixText, message) - fmt.Fprint(b, colorScheme.CriticalColor(str)) - } else { - fmt.Fprintf(b, "%s %s%s%s"+messageFormat, coloredTimestamp, level, callContext, prefix, message) - } - } - - for _, k := range keys { - if k != "prefix" && k != "file" && k != "func" && k != "line" && k != logPriorityKey && k != logModuleKey { - v := entry.Data[k] - fmt.Fprintf(b, " %s", f.formatKeyValue(levelColor(k), v)) - } - } -} - -func (f *TextFormatter) needsQuoting(text string) bool { - if len(text) == 0 { - return f.QuoteEmptyFields - } - - if f.AlwaysQuoteStrings { - return true - } - - for _, ch := range text { - if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.') { - return true - } - } - - return false -} - -func extractPrefix(e *logrus.Entry) string { - var module string - if iModule, ok := e.Data[logModuleKey]; ok { - module, _ = iModule.(string) - } - - var priority string - if iPriority, ok := e.Data[logPriorityKey]; ok { - priority, _ = iPriority.(string) - } - - switch { - case priority == "": - return fmt.Sprintf("[%s]", module) - case module == "": - return fmt.Sprintf("[%s]", priority) - default: - return fmt.Sprintf("[%s:%s]", module, priority) - } -} - -func (f *TextFormatter) formatKeyValue(key string, value interface{}) string { - return fmt.Sprintf("%s=%s", key, f.formatValue(value)) -} - -func (f *TextFormatter) formatValue(value interface{}) string { - switch value := value.(type) { - case string: - if f.needsQuoting(value) { - return fmt.Sprintf("%s%+v%s", f.QuoteCharacter, value, f.QuoteCharacter) - } - return value - case error: - errmsg := value.Error() - if f.needsQuoting(errmsg) { - return fmt.Sprintf("%s%+v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter) - } - return errmsg - default: - return fmt.Sprintf("%+v", value) - } -} - -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}, appendSpace bool) { - b.WriteString(key) //nolint:gosec - b.WriteByte('=') //nolint:gosec - f.appendValue(b, value) //nolint:gosec - - if appendSpace { - b.WriteByte(' ') //nolint:gosec - } -} - -func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { - switch value := value.(type) { - case string: - if f.needsQuoting(value) { - fmt.Fprintf(b, "%s%+v%s", f.QuoteCharacter, value, f.QuoteCharacter) - } else { - b.WriteString(value) //nolint:gosec - } - case error: - errmsg := value.Error() - if f.needsQuoting(errmsg) { - fmt.Fprintf(b, "%s%+v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter) - } else { - b.WriteString(errmsg) //nolint:gosec - } - default: - fmt.Fprint(b, value) - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/hooks.go b/vendor/github.com/skycoin/skywire-utilities/pkg/logging/hooks.go deleted file mode 100644 index 8a74fbf2b..000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/hooks.go +++ /dev/null @@ -1,45 +0,0 @@ -// Package logging pkg/logging/hooks.go -package logging - -import ( - "io" - - "github.com/sirupsen/logrus" -) - -// WriteHook is a logrus.Hook that logs to an io.Writer -type WriteHook struct { - w io.Writer - formatter logrus.Formatter -} - -// NewWriteHook returns a new WriteHook -func NewWriteHook(w io.Writer) *WriteHook { - return &WriteHook{ - w: w, - formatter: &TextFormatter{ - DisableColors: true, - FullTimestamp: true, - AlwaysQuoteStrings: true, - QuoteEmptyFields: true, - ForceFormatting: true, - }, - } -} - -// Levels returns Levels accepted by the WriteHook. -// All logrus.Levels are returned. -func (f *WriteHook) Levels() []logrus.Level { - return logrus.AllLevels -} - -// Fire writes a logrus.Entry to the file -func (f *WriteHook) Fire(e *logrus.Entry) error { - b, err := f.formatter.Format(e) - if err != nil { - return err - } - - _, err = f.w.Write(b) - return err -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logger.go b/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logger.go deleted file mode 100644 index 5f2f3f13a..000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logger.go +++ /dev/null @@ -1,69 +0,0 @@ -// Package logging pkg/logging/logger.go -package logging - -import ( - "os" - "time" - - "github.com/sirupsen/logrus" -) - -// Logger wraps logrus.FieldLogger -type Logger struct { - logrus.FieldLogger -} - -// Critical adds special critical-level fields for specially highlighted logging, -// since logrus lacks a distinct critical field and does not have configurable log levels -func (logger *Logger) Critical() logrus.FieldLogger { - return logger.WithField(logPriorityKey, logPriorityCritical) -} - -// WithTime overrides time, used by logger. -func (logger *Logger) WithTime(t time.Time) *logrus.Entry { - return logger.WithFields(logrus.Fields{}).WithTime(t) -} - -// MasterLogger wraps logrus.Logger and is able to create new package-aware loggers -type MasterLogger struct { - *logrus.Logger -} - -// NewMasterLogger creates a new package-aware logger with formatting string -func NewMasterLogger() *MasterLogger { - hooks := make(logrus.LevelHooks) - - return &MasterLogger{ - Logger: &logrus.Logger{ - Out: os.Stdout, - Formatter: &TextFormatter{ - FullTimestamp: true, - AlwaysQuoteStrings: true, - QuoteEmptyFields: true, - ForceFormatting: true, - DisableColors: false, - ForceColors: false, - TimestampFormat: "2006-01-02T15:04:05.999999999Z07:00", - }, - Hooks: hooks, - Level: logrus.DebugLevel, - }, - } -} - -// PackageLogger instantiates a package-aware logger -func (logger *MasterLogger) PackageLogger(moduleName string) *Logger { - return &Logger{ - FieldLogger: logger.WithField(logModuleKey, moduleName), - } -} - -// EnableColors enables colored logging -func (logger *MasterLogger) EnableColors() { - logger.Formatter.(*TextFormatter).DisableColors = false -} - -// DisableColors disables colored logging -func (logger *MasterLogger) DisableColors() { - logger.Formatter.(*TextFormatter).DisableColors = true -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logging.go b/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logging.go deleted file mode 100644 index cd0d2a352..000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logging.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Package logging provides application logging utilities -*/ -package logging - -import ( - "errors" - "io" - "strings" - - "github.com/sirupsen/logrus" -) - -var log = NewMasterLogger() - -const ( - // logModuleKey is the key used for the module name data entry - logModuleKey = "_module" - // logPriorityKey is the log entry key for priority log statements - logPriorityKey = "_priority" - // logPriorityCritical is the log entry value for priority log statements - logPriorityCritical = "CRITICAL" -) - -// LevelFromString returns a logrus.Level from a string identifier -func LevelFromString(s string) (logrus.Level, error) { - switch strings.ToLower(s) { - case "debug": - return logrus.DebugLevel, nil - case "info", "notice": - return logrus.InfoLevel, nil - case "warn", "warning": - return logrus.WarnLevel, nil - case "error": - return logrus.ErrorLevel, nil - case "fatal", "critical": - return logrus.FatalLevel, nil - case "panic": - return logrus.PanicLevel, nil - case "trace": - return logrus.TraceLevel, nil - default: - return logrus.DebugLevel, errors.New("could not convert string to log level") - } -} - -// MustGetLogger returns a package-aware logger from the master logger -func MustGetLogger(module string) *Logger { - return log.PackageLogger(module) -} - -// AddHook adds a hook to the global logger -func AddHook(hook logrus.Hook) { - log.AddHook(hook) -} - -// EnableColors enables colored logging -func EnableColors() { - log.EnableColors() -} - -// DisableColors disables colored logging -func DisableColors() { - log.DisableColors() -} - -// SetLevel sets the logger's minimum log level -func SetLevel(level logrus.Level) { - log.SetLevel(level) -} - -// GetLevel returns the logger level -func GetLevel() logrus.Level { - return log.GetLevel() -} - -// SetOutputTo sets the logger's output to an io.Writer -func SetOutputTo(w io.Writer) { - log.Out = w -} - -// Disable disables the logger completely -func Disable() { - log.Out = io.Discard -} diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/service_flags.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/service_flags.go index c8a8d7c98..e8823d42c 100644 --- a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/service_flags.go +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/service_flags.go @@ -12,7 +12,7 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/spf13/cobra" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) // Associated errors. diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_unix.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_unix.go index 0a9028109..e9184ebd5 100644 --- a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_unix.go +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_unix.go @@ -11,7 +11,7 @@ import ( "github.com/sirupsen/logrus" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) func (sf *ServiceFlags) sysLogHook(log *logging.Logger, sysLvl int) { diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_windows.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_windows.go index 83ddf4f8d..9690fb7d5 100644 --- a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_windows.go +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil/sysloghook_windows.go @@ -9,7 +9,7 @@ import ( "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) func (sf *ServiceFlags) sysLogHook(_ *logging.Logger, _ int) { diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/health.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/health.go index 015071d7e..38737f96f 100644 --- a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/health.go +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/health.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" ) var path = "/health" diff --git a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/httputil.go b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/httputil.go index f63b08baa..758362244 100644 --- a/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/httputil.go +++ b/vendor/github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil/httputil.go @@ -12,7 +12,7 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) var json = jsoniter.ConfigFastest diff --git a/vendor/github.com/skycoin/skywire/skywire.go b/vendor/github.com/skycoin/skywire/skywire.go index 47a18175b..9eade5859 100644 --- a/vendor/github.com/skycoin/skywire/skywire.go +++ b/vendor/github.com/skycoin/skywire/skywire.go @@ -8,7 +8,7 @@ import ( "encoding/json" "log" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) /* diff --git a/vendor/modules.txt b/vendor/modules.txt index 3cbc2e5c7..35dc699b8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -204,7 +204,7 @@ github.com/skycoin/skycoin/src/cipher/ripemd160 github.com/skycoin/skycoin/src/cipher/secp256k1-go github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2 github.com/skycoin/skycoin/src/util/logging -# github.com/skycoin/skywire v1.3.29-rc1.0.20241216202341-36a0a20ceafb +# github.com/skycoin/skywire v1.3.29-rc1.0.20241217192205-cb65518c5522 ## explicit; go 1.23 github.com/skycoin/skywire github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo @@ -215,11 +215,6 @@ github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor -# github.com/skycoin/skywire-utilities v1.3.25 -## explicit; go 1.21 -github.com/skycoin/skywire-utilities/pkg/buildinfo -github.com/skycoin/skywire-utilities/pkg/cipher -github.com/skycoin/skywire-utilities/pkg/logging # github.com/spf13/cobra v1.8.1 ## explicit; go 1.15 github.com/spf13/cobra