diff --git a/go.mod b/go.mod index 02712018..c35d3c37 100644 --- a/go.mod +++ b/go.mod @@ -51,21 +51,14 @@ require ( require ( github.com/hashicorp/go-retryablehttp v0.7.7 - github.com/threefoldtech/tfgrid-sdk-go/node-registrar v0.0.0-20250122120625-1b1ffe1a231d + github.com/lib/pq v1.10.9 ) require ( - github.com/KyleBanks/depth v1.2.1 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect github.com/Microsoft/hcsshim v0.8.25 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect github.com/alexflint/go-filemutex v1.1.0 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect - github.com/cloudwego/base64x v0.1.4 // indirect - github.com/cloudwego/iasm v0.2.0 // indirect github.com/containerd/cgroups v1.0.3 // indirect github.com/containerd/containerd v1.5.18 // indirect github.com/containerd/continuity v0.3.0 // indirect @@ -82,19 +75,9 @@ require ( github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/ethereum/go-ethereum v1.11.6 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect github.com/gin-gonic/gin v1.10.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.6 // indirect - github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/swag v0.19.15 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.20.0 // indirect github.com/go-stack/stack v1.8.1 // indirect - github.com/goccy/go-json v0.10.2 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -111,20 +94,8 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/holiman/uint256 v1.2.3 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/pgx/v5 v5.5.5 // indirect - github.com/jackc/puddle/v2 v2.2.1 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jinzhu/now v1.1.5 // indirect - github.com/josharian/intern v1.0.0 // indirect github.com/josharian/native v0.0.0-20200817173448-b6b71def0850 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.16.7 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect - github.com/leodido/go-urn v1.4.0 // indirect - github.com/lib/pq v1.10.9 // indirect - github.com/mailru/easyjson v0.7.6 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect @@ -134,8 +105,6 @@ require ( github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/sys/mountinfo v0.6.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/ncruces/go-strftime v0.1.9 // indirect github.com/nsf/termbox-go v1.1.1 // indirect github.com/nxadm/tail v1.4.11 // indirect @@ -145,7 +114,6 @@ require ( github.com/opencontainers/runc v1.1.2 // indirect github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect github.com/opencontainers/selinux v1.10.0 // indirect - github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/philhofer/fwd v1.1.1 // indirect github.com/pierrec/lz4 v2.3.0+incompatible // indirect github.com/pierrec/xxHash v0.1.5 // indirect @@ -159,17 +127,11 @@ require ( github.com/safchain/ethtool v0.0.0-20201023143004-874930cb3ce0 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/stretchr/objx v0.5.2 // indirect - github.com/swaggo/files v1.0.1 // indirect - github.com/swaggo/gin-swagger v1.6.0 // indirect - github.com/swaggo/swag v1.16.4 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect - github.com/ugorji/go/codec v1.2.12 // indirect github.com/ulikunitz/xz v0.5.8 // indirect github.com/vedhavyas/go-subkey v1.0.3 // indirect - github.com/vedhavyas/go-subkey/v2 v2.0.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/whs/nacl-sealed-box v0.0.0-20180930164530-92b9ba845d8d // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect @@ -178,7 +140,6 @@ require ( github.com/yusufpapurcu/wmi v1.2.2 // indirect go.opencensus.io v0.23.0 // indirect go.uber.org/atomic v1.9.0 // indirect - golang.org/x/arch v0.8.0 // indirect golang.org/x/net v0.26.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/text v0.21.0 // indirect @@ -193,8 +154,6 @@ require ( gopkg.in/djherbis/times.v1 v1.2.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gorm.io/driver/postgres v1.5.11 // indirect - gorm.io/gorm v1.25.12 // indirect modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect modernc.org/libc v1.49.3 // indirect modernc.org/mathutil v1.6.0 // indirect @@ -209,5 +168,3 @@ require ( replace github.com/docker/distribution v2.7.1+incompatible => github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible replace github.com/threefoldtech/zosbase => ../zosbase - -replace github.com/threefoldtech/tfgrid-sdk-go/node-registrar => ../../tfgrid-sdk-go/node-registrar diff --git a/go.sum b/go.sum index 2b8dabc8..8a7f5873 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,6 @@ github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/ChainSafe/go-schnorrkel v1.1.0 h1:rZ6EU+CZFCjB4sHUE1jIu8VDoB/wRKZxoe1tkcO71Wk= github.com/ChainSafe/go-schnorrkel v1.1.0/go.mod h1:ABkENxiP+cvjFiByMIZ9LYbRoNNLeBLiakC1XeTFxfE= -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= -github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= @@ -19,10 +17,6 @@ github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXn github.com/Microsoft/hcsshim v0.8.25 h1:fRMwXiwk3qDwc0P05eHnh+y2v07JdtsfQ1fuAc69m9g= github.com/Microsoft/hcsshim v0.8.25/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= @@ -171,8 +165,6 @@ github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcP github.com/garyburd/redigo v1.6.2 h1:yE/pwKCrbLpLpQICzYTeZ7JsTA/C53wFTJHaEtRqniM= github.com/garyburd/redigo v1.6.2/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= -github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= @@ -187,19 +179,7 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -337,28 +317,14 @@ github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZm github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= -github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= -github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= -github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww= github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= github.com/jbenet/go-base58 v0.0.0-20150317085156-6237cf65f3a6 h1:4zOlv2my+vf98jT1nQt4bT/yKWUImevYPJ2H344CloE= github.com/jbenet/go-base58 v0.0.0-20150317085156-6237cf65f3a6/go.mod h1:r/8JmuR0qjuCiEhAolkfvdZgmPiHTnJaG0UXCSeR1Zo= github.com/jgautheron/goconst v0.0.0-20170703170152-9740945f5dcb/go.mod h1:82TxjOpWQiPmywlbIaB2ZkqJoSYJdLGPgAJDvM3PbKc= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/joncrlsn/dque v0.0.0-20200702023911-3e80e3146ce5 h1:bo1aoO6l128nKJCBrFflOj9s+KPqMM7ErNyB5GGBNDs= github.com/joncrlsn/dque v0.0.0-20200702023911-3e80e3146ce5/go.mod h1:dNKs71rs2VJGBAmttu7fouEsRQlRjxy0p1Sx+T5wbpY= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/josharian/native v0.0.0-20200817173448-b6b71def0850 h1:uhL5Gw7BINiiPAo24A2sxkcDI0Jt/sqp1v5xQCniEFA= github.com/josharian/native v0.0.0-20200817173448-b6b71def0850/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= @@ -380,10 +346,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= github.com/klauspost/cpuid/v2 v2.2.7/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 v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -405,10 +369,6 @@ github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lxn/walk v0.0.0-20210112085537-c389da54e794/go.mod h1:E23UucZGqpuUANJooIbHWCufXvOcT6E7Stq81gU+CSQ= github.com/lxn/win v0.0.0-20210218163916-a377121e959e/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.8/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= @@ -468,7 +428,6 @@ github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= github.com/nsf/termbox-go v1.1.1 h1:nksUPLCb73Q++DwbYUBEglYBRPZyoXJdrj5L+TkjyZY= github.com/nsf/termbox-go v1.1.1/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo= @@ -503,6 +462,7 @@ github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuh github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= @@ -546,8 +506,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -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/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= @@ -592,19 +552,10 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ 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= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stripe/safesql v0.2.0/go.mod h1:q7b2n0JmzM1mVGfcYpanfVb2j23cXZeWFxcILPn3JV4= -github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= -github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= -github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M= -github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= -github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A= -github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/threefoldtech/0-fs v1.3.1-0.20240424140157-b488dfedcc56 h1:uWd8JfE8N3IM6Zw/LMr0+sRJl+G0YgqQmNDP8xXR0vw= github.com/threefoldtech/0-fs v1.3.1-0.20240424140157-b488dfedcc56/go.mod h1:lZjR32SiNo3dP70inVFxaLMyZjmKX1ucS+5O31dbPNM= @@ -627,6 +578,7 @@ github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2 github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= @@ -640,8 +592,6 @@ github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bC github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= github.com/vedhavyas/go-subkey v1.0.3 h1:iKR33BB/akKmcR2PMlXPBeeODjWLM90EL98OrOGs8CA= github.com/vedhavyas/go-subkey v1.0.3/go.mod h1:CloUaFQSSTdWnINfBRFjVMkWXZANW+nd8+TI5jYcl6Y= -github.com/vedhavyas/go-subkey/v2 v2.0.0 h1:LemDIsrVtRSOkp0FA8HxP6ynfKjeOj3BY2U9UNfeDMA= -github.com/vedhavyas/go-subkey/v2 v2.0.0/go.mod h1:95aZ+XDCWAUUynjlmi7BtPExjXgXxByE0WfBwbmIRH4= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 h1:cPXZWzzG0NllBLdjWoD1nDfaqu98YMv+OneaKc8sPOA= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= @@ -665,7 +615,6 @@ github.com/yggdrasil-network/yggdrasil-go v0.4.0/go.mod h1:/iMJjOrXRsjlFgqhWOPhe github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= @@ -680,7 +629,6 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -695,7 +643,6 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -711,7 +658,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -742,11 +688,8 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -760,7 +703,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -809,36 +751,28 @@ golang.org/x/sys v0.0.0-20210309040221-94ec62e08169/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210611083646-a4fc73990273/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -858,7 +792,6 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -920,7 +853,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/djherbis/times.v1 v1.2.0 h1:UCvDKl1L/fmBygl2Y7hubXCnY7t4Yj46ZrBFNUipFbM= @@ -943,13 +875,8 @@ gopkg.in/yaml.v2 v2.3.0/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= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.5.11 h1:ubBVAfbKEUld/twyKZ0IYn9rSQh448EdelLYk9Mv314= -gorm.io/driver/postgres v1.5.11/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI= -gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= -gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= @@ -987,7 +914,5 @@ mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIa mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= zombiezen.com/go/capnproto2 v2.18.0+incompatible h1:mwfXZniffG5mXokQGHUJWGnqIBggoPfT/CEwon9Yess= zombiezen.com/go/capnproto2 v2.18.0+incompatible/go.mod h1:XO5Pr2SbXgqZwn0m0Ru54QBqpOf4K5AYBO+8LAOBQEQ= diff --git a/pkg/identity/identityd.go b/pkg/identity/identityd.go index d43e353b..e5df2744 100644 --- a/pkg/identity/identityd.go +++ b/pkg/identity/identityd.go @@ -7,8 +7,8 @@ import ( "github.com/rs/zerolog/log" - "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/db" registrargw "github.com/threefoldtech/zos4/pkg/registrar_gateway" + "github.com/threefoldtech/zos4/pkg/types" "github.com/threefoldtech/zosbase/pkg/crypto" "github.com/threefoldtech/zosbase/pkg/identity/store" @@ -114,7 +114,7 @@ func (d *identityManager) Farm() (name string, err error) { defer resp.Body.Close() - var farm db.Farm + var farm types.Farm err = json.NewDecoder(resp.Body).Decode(&farm) if err != nil { return diff --git a/pkg/power/power.go b/pkg/power/power.go index f77442a3..c76859be 100644 --- a/pkg/power/power.go +++ b/pkg/power/power.go @@ -9,8 +9,8 @@ import ( "github.com/pkg/errors" "github.com/rs/zerolog/log" - "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/db" "github.com/threefoldtech/zos4/pkg/stubs" + "github.com/threefoldtech/zos4/pkg/types" "github.com/threefoldtech/zosbase/pkg" "github.com/threefoldtech/zosbase/pkg/events" "github.com/threefoldtech/zosbase/pkg/network/bridge" @@ -132,7 +132,7 @@ func (p *PowerServer) syncSelf() error { return nil } -func (p *PowerServer) powerUp(node *db.Node, reason string) error { +func (p *PowerServer) powerUp(node *types.Node, reason string) error { log.Info().Uint64("node", node.NodeID).Str("reason", reason).Msg("powering on node") mac := "" diff --git a/pkg/registrar_api_gateway.go b/pkg/registrar_api_gateway.go index 0d6a8883..ff68b75c 100644 --- a/pkg/registrar_api_gateway.go +++ b/pkg/registrar_api_gateway.go @@ -3,34 +3,33 @@ package pkg import ( "time" - "github.com/centrifuge/go-substrate-rpc-client/v4/types" + substrateTypes "github.com/centrifuge/go-substrate-rpc-client/v4/types" substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go" - "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/db" - "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/server" + "github.com/threefoldtech/zos4/pkg/types" "github.com/threefoldtech/zosbase/pkg" ) //go:generate zbusc -module registrar-gateway -version 0.0.1 -name registrar-gateway -package stubs github.com/threefoldtech/zos4/pkg+RegistrarGateway stubs/registrar-gateway.go type RegistrarGateway interface { - CreateNode(node server.NodeRegistrationRequest) (uint64, error) + CreateNode(node types.NodeRegistrationRequest) (uint64, error) CreateTwin(relay string, pk []byte) (uint64, error) - EnsureAccount(twinID uint64, pk []byte) (twin db.Account, err error) + EnsureAccount(twinID uint64, pk []byte) (twin types.Account, err error) GetContract(id uint64) (substrate.Contract, pkg.SubstrateError) GetContractIDByNameRegistration(name string) (uint64, pkg.SubstrateError) GetNodeRentContract(node uint32) (uint64, pkg.SubstrateError) - GetFarm(id uint64) (db.Farm, error) - GetNode(id uint64) (db.Node, error) + GetFarm(id uint64) (types.Farm, error) + GetNode(id uint64) (types.Node, error) GetNodeByTwinID(twin uint64) (uint64, error) - GetNodeContracts(node uint32) ([]types.U64, error) + GetNodeContracts(node uint32) ([]substrateTypes.U64, error) GetNodes(farmID uint32) ([]uint32, error) GetPowerTarget() (power substrate.NodePower, err error) - GetTwin(id uint64) (db.Account, error) + GetTwin(id uint64) (types.Account, error) GetTwinByPubKey(pk []byte) (uint64, error) - Report(consumptions []substrate.NruConsumption) (types.Hash, error) + Report(consumptions []substrate.NruConsumption) (substrateTypes.Hash, error) SetContractConsumption(resources ...substrate.ContractResources) error - SetNodePowerState(up bool) (hash types.Hash, err error) - UpdateNode(node server.NodeRegistrationRequest) (uint64, error) + SetNodePowerState(up bool) (hash substrateTypes.Hash, err error) + UpdateNode(node types.NodeRegistrationRequest) (uint64, error) UpdateNodeUptimeV2(uptime uint64, timestampHint uint64) (err error) GetTime() (time.Time, error) GetZosVersion() (string, error) diff --git a/pkg/registrar_gateway/registrar_gateway.go b/pkg/registrar_gateway/registrar_gateway.go index 2dfa26ae..e058bc08 100644 --- a/pkg/registrar_gateway/registrar_gateway.go +++ b/pkg/registrar_gateway/registrar_gateway.go @@ -14,14 +14,13 @@ import ( "sync" "time" - "github.com/centrifuge/go-substrate-rpc-client/v4/types" + subTypes "github.com/centrifuge/go-substrate-rpc-client/v4/types" "github.com/rs/zerolog/log" substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go" - "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/db" - "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/server" "github.com/threefoldtech/zbus" zos4Pkg "github.com/threefoldtech/zos4/pkg" "github.com/threefoldtech/zos4/pkg/stubs" + "github.com/threefoldtech/zos4/pkg/types" "github.com/threefoldtech/zosbase/pkg" "github.com/threefoldtech/zosbase/pkg/environment" "github.com/threefoldtech/zosbase/pkg/gridtypes" @@ -70,7 +69,7 @@ func (r *registrarGateway) GetZosVersion() (string, error) { return r.getZosVersion(url) } -func (r *registrarGateway) CreateNode(node server.NodeRegistrationRequest) (uint64, error) { +func (r *registrarGateway) CreateNode(node types.NodeRegistrationRequest) (uint64, error) { url := fmt.Sprintf("%s/v1/nodes", r.baseURL) log.Debug(). Str("url", url). @@ -98,7 +97,7 @@ func (g *registrarGateway) CreateTwin(relay string, pk []byte) (uint64, error) { return id, err } -func (g *registrarGateway) EnsureAccount(twinID uint64, pk []byte) (twin db.Account, err error) { +func (g *registrarGateway) EnsureAccount(twinID uint64, pk []byte) (twin types.Account, err error) { url := fmt.Sprintf("%s/v1/accounts", g.baseURL) log.Debug().Str("url", url).Msg("ensure account") @@ -127,14 +126,14 @@ func (g *registrarGateway) GetContractIDByNameRegistration(name string) (result return contractID, serr } -func (r *registrarGateway) GetFarm(id uint64) (farm db.Farm, err error) { +func (r *registrarGateway) GetFarm(id uint64) (farm types.Farm, err error) { url := fmt.Sprintf("%s/v1/farms/%d", r.baseURL, id) log.Trace().Str("url", url).Uint64("id", id).Msg("get farm") return r.getFarm(url) } -func (r *registrarGateway) GetNode(id uint64) (node db.Node, err error) { +func (r *registrarGateway) GetNode(id uint64) (node types.Node, err error) { url := fmt.Sprintf("%s/v1/nodes/%d", r.baseURL, id) log.Trace().Str("url", url).Uint64("id", id).Msg("get node") @@ -148,7 +147,7 @@ func (r *registrarGateway) GetNodeByTwinID(twin uint64) (result uint64, err erro return r.getNodeByTwinID(url, twin) } -func (g *registrarGateway) GetNodeContracts(node uint32) ([]types.U64, error) { +func (g *registrarGateway) GetNodeContracts(node uint32) ([]subTypes.U64, error) { log.Trace().Str("method", "GetNodeContracts").Uint32("node", node).Msg("method called") return g.sub.GetNodeContracts(node) } @@ -173,7 +172,7 @@ func (g *registrarGateway) GetPowerTarget() (power substrate.NodePower, err erro return g.sub.GetPowerTarget(uint32(g.nodeID)) } -func (r *registrarGateway) GetTwin(id uint64) (result db.Account, err error) { +func (r *registrarGateway) GetTwin(id uint64) (result types.Account, err error) { url := fmt.Sprintf("%s/v1/accounts/", r.baseURL) log.Trace().Str("url", "url").Uint64("id", id).Msg("get account") @@ -187,7 +186,7 @@ func (r *registrarGateway) GetTwinByPubKey(pk []byte) (result uint64, err error) return r.getTwinByPubKey(url, pk) } -func (r *registrarGateway) Report(consumptions []substrate.NruConsumption) (types.Hash, error) { +func (r *registrarGateway) Report(consumptions []substrate.NruConsumption) (subTypes.Hash, error) { contractIDs := make([]uint64, 0, len(consumptions)) for _, v := range consumptions { contractIDs = append(contractIDs, uint64(v.ContractID)) @@ -202,7 +201,7 @@ func (r *registrarGateway) Report(consumptions []substrate.NruConsumption) (type var body bytes.Buffer _, err := r.httpClient.Post(url, "application/json", &body) if err != nil { - return types.Hash{}, err + return subTypes.Hash{}, err } // I need to know what is hash to be able to respond with it @@ -220,14 +219,14 @@ func (g *registrarGateway) SetContractConsumption(resources ...substrate.Contrac return g.sub.SetContractConsumption(g.identity, resources...) } -func (g *registrarGateway) SetNodePowerState(up bool) (hash types.Hash, err error) { +func (g *registrarGateway) SetNodePowerState(up bool) (hash subTypes.Hash, err error) { log.Debug().Str("method", "SetNodePowerState").Bool("up", up).Msg("method called") g.mu.Lock() defer g.mu.Unlock() return g.sub.SetNodePowerState(g.identity, up) } -func (r *registrarGateway) UpdateNode(node server.NodeRegistrationRequest) (uint64, error) { +func (r *registrarGateway) UpdateNode(node types.NodeRegistrationRequest) (uint64, error) { url := fmt.Sprintf("%s/v1/nodes/%d", r.baseURL, r.nodeID) log.Debug().Str("method", "UpdateNode").Msg("method called") r.mu.Lock() @@ -312,7 +311,7 @@ func (g *registrarGateway) createTwin(url string, relayURL []string, pk []byte) publicKeyBase64 := base64.StdEncoding.EncodeToString(pk) signature := getNodeSignature(pk, g.privKey) - account := server.AccountCreationRequest{ + account := types.AccountCreationRequest{ PublicKey: publicKeyBase64, Signature: signature, Timestamp: time.Now().Unix(), @@ -344,17 +343,17 @@ func (g *registrarGateway) createTwin(url string, relayURL []string, pk []byte) return twinID, err } -func (g *registrarGateway) ensureAccount(twinID uint64, relay string, pk []byte) (db.Account, error) { +func (g *registrarGateway) ensureAccount(twinID uint64, relay string, pk []byte) (types.Account, error) { twin, err := g.GetTwin(twinID) if err != nil { if !errors.Is(err, ErrorRecordNotFound) { - return db.Account{}, err + return types.Account{}, err } // account not found, create the account twinID, err = g.CreateTwin(relay, pk) if err != nil { - return db.Account{}, err + return types.Account{}, err } twin, err = g.GetTwin(twinID) @@ -363,7 +362,7 @@ func (g *registrarGateway) ensureAccount(twinID uint64, relay string, pk []byte) return twin, err } -func (r *registrarGateway) getTwin(url string, twinID uint64) (result db.Account, err error) { +func (r *registrarGateway) getTwin(url string, twinID uint64) (result types.Account, err error) { req, err := http.NewRequest("GET", url, nil) if err != nil { return @@ -449,7 +448,7 @@ func (r *registrarGateway) getZosVersion(url string) (string, error) { return version.Version, err } -func (r *registrarGateway) createNode(url string, node server.NodeRegistrationRequest) (nodeID uint64, err error) { +func (r *registrarGateway) createNode(url string, node types.NodeRegistrationRequest) (nodeID uint64, err error) { var body bytes.Buffer err = json.NewEncoder(&body).Encode(node) if err != nil { @@ -479,7 +478,7 @@ func (r *registrarGateway) createNode(url string, node server.NodeRegistrationRe return nodeID, err } -func (r *registrarGateway) getFarm(url string) (farm db.Farm, err error) { +func (r *registrarGateway) getFarm(url string) (farm types.Farm, err error) { resp, err := r.httpClient.Get(url) if err != nil { return @@ -503,7 +502,7 @@ func (r *registrarGateway) getFarm(url string) (farm db.Farm, err error) { return } -func (r *registrarGateway) getNode(url string) (node db.Node, err error) { +func (r *registrarGateway) getNode(url string) (node types.Node, err error) { resp, err := r.httpClient.Get(url) if err != nil { return @@ -556,7 +555,7 @@ func (r *registrarGateway) getNodeByTwinID(url string, twin uint64) (result uint defer resp.Body.Close() - var nodes []db.Node + var nodes []types.Node err = json.NewDecoder(resp.Body).Decode(&nodes) if err != nil { return @@ -589,7 +588,7 @@ func (r *registrarGateway) getNodesInFarm(url string, farmID uint32) (nodeIDs [] defer resp.Body.Close() - var nodes []db.Node + var nodes []types.Node err = json.NewDecoder(resp.Body).Decode(&nodes) if err != nil { return @@ -602,7 +601,7 @@ func (r *registrarGateway) getNodesInFarm(url string, farmID uint32) (nodeIDs [] return nodeIDs, nil } -func (r *registrarGateway) updateNode(twinID uint64, url string, node server.NodeRegistrationRequest) (uint64, error) { +func (r *registrarGateway) updateNode(twinID uint64, url string, node types.NodeRegistrationRequest) (uint64, error) { var body bytes.Buffer err := json.NewEncoder(&body).Encode(node) if err != nil { @@ -637,7 +636,7 @@ func (r *registrarGateway) updateNode(twinID uint64, url string, node server.Nod } func (r *registrarGateway) updateNodeUptimeV2(twinID uint64, url string, uptime uint64) (err error) { - report := server.UptimeReportRequest{Uptime: time.Duration(uptime), Timestamp: time.Now()} + report := types.UptimeReportRequest{Uptime: time.Duration(uptime), Timestamp: time.Now()} var body bytes.Buffer err = json.NewEncoder(&body).Encode(report) diff --git a/pkg/registrar_light/register.go b/pkg/registrar_light/register.go index ac71465e..fbfdd465 100644 --- a/pkg/registrar_light/register.go +++ b/pkg/registrar_light/register.go @@ -10,11 +10,10 @@ import ( "github.com/pkg/errors" "github.com/rs/zerolog/log" - "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/db" - "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/server" "github.com/threefoldtech/zbus" registrargw "github.com/threefoldtech/zos4/pkg/registrar_gateway" zos4Stubs "github.com/threefoldtech/zos4/pkg/stubs" + "github.com/threefoldtech/zos4/pkg/types" "github.com/threefoldtech/zosbase/pkg/environment" "github.com/threefoldtech/zosbase/pkg/geoip" gridtypes "github.com/threefoldtech/zosbase/pkg/gridtypes" @@ -112,7 +111,7 @@ func registerNode( return 0, 0, errors.Wrap(err, "failed to get zos bridge information") } - interfaces := db.Interface{ + interfaces := types.Interface{ Name: infs.Interfaces["zos"].Name, Mac: infs.Interfaces["zos"].Mac, IPs: func() string { @@ -124,14 +123,14 @@ func registerNode( }(), } - resources := db.Resources{ + resources := types.Resources{ HRU: uint64(info.Capacity.HRU), SRU: uint64(info.Capacity.SRU), CRU: info.Capacity.CRU, MRU: uint64(info.Capacity.MRU), } - location := db.Location{ + location := types.Location{ Longitude: fmt.Sprint(info.Location.Longitude), Latitude: fmt.Sprint(info.Location.Latitude), Country: info.Location.Country, @@ -158,17 +157,17 @@ func registerNode( // serial = gridtypes.OptionBoardSerial{HasValue: true, AsValue: info.SerialNumber} // } - real := db.Node{ + real := types.Node{ FarmID: uint64(env.FarmID), TwinID: twinID, Resources: resources, Location: location, - Interfaces: []db.Interface{interfaces}, + Interfaces: []types.Interface{interfaces}, SecureBoot: info.SecureBoot, Virtualized: info.Virtualized, } - req := server.NodeRegistrationRequest{ + req := types.NodeRegistrationRequest{ FarmID: real.FarmID, TwinID: real.TwinID, Resources: real.Resources, @@ -192,7 +191,7 @@ func registerNode( } // node exists - var onChain db.Node + var onChain types.Node onChain, err = registrarGateway.GetNode(ctx, nodeID) if err != nil { return 0, 0, errors.Wrapf(err, "failed to get node with id: %d", nodeID) diff --git a/pkg/stubs/registrar-gateway.go b/pkg/stubs/registrar-gateway.go index 8365f6f3..81c16868 100644 --- a/pkg/stubs/registrar-gateway.go +++ b/pkg/stubs/registrar-gateway.go @@ -6,11 +6,10 @@ package stubs import ( "context" - types "github.com/centrifuge/go-substrate-rpc-client/v4/types" + types1 "github.com/centrifuge/go-substrate-rpc-client/v4/types" tfchainclientgo "github.com/threefoldtech/tfchain/clients/tfchain-client-go" - db "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/db" - server "github.com/threefoldtech/tfgrid-sdk-go/node-registrar/pkg/server" zbus "github.com/threefoldtech/zbus" + types "github.com/threefoldtech/zos4/pkg/types" pkg "github.com/threefoldtech/zosbase/pkg" "time" ) @@ -32,7 +31,7 @@ func NewRegistrarGatewayStub(client zbus.Client) *RegistrarGatewayStub { } } -func (s *RegistrarGatewayStub) CreateNode(ctx context.Context, arg0 server.NodeRegistrationRequest) (ret0 uint64, ret1 error) { +func (s *RegistrarGatewayStub) CreateNode(ctx context.Context, arg0 types.NodeRegistrationRequest) (ret0 uint64, ret1 error) { args := []interface{}{arg0} result, err := s.client.RequestContext(ctx, s.module, s.object, "CreateNode", args...) if err != nil { @@ -66,7 +65,7 @@ func (s *RegistrarGatewayStub) CreateTwin(ctx context.Context, arg0 string, arg1 return } -func (s *RegistrarGatewayStub) EnsureAccount(ctx context.Context, arg0 uint64, arg1 []uint8) (ret0 db.Account, ret1 error) { +func (s *RegistrarGatewayStub) EnsureAccount(ctx context.Context, arg0 uint64, arg1 []uint8) (ret0 types.Account, ret1 error) { args := []interface{}{arg0, arg1} result, err := s.client.RequestContext(ctx, s.module, s.object, "EnsureAccount", args...) if err != nil { @@ -117,7 +116,7 @@ func (s *RegistrarGatewayStub) GetContractIDByNameRegistration(ctx context.Conte return } -func (s *RegistrarGatewayStub) GetFarm(ctx context.Context, arg0 uint64) (ret0 db.Farm, ret1 error) { +func (s *RegistrarGatewayStub) GetFarm(ctx context.Context, arg0 uint64) (ret0 types.Farm, ret1 error) { args := []interface{}{arg0} result, err := s.client.RequestContext(ctx, s.module, s.object, "GetFarm", args...) if err != nil { @@ -134,7 +133,7 @@ func (s *RegistrarGatewayStub) GetFarm(ctx context.Context, arg0 uint64) (ret0 d return } -func (s *RegistrarGatewayStub) GetNode(ctx context.Context, arg0 uint64) (ret0 db.Node, ret1 error) { +func (s *RegistrarGatewayStub) GetNode(ctx context.Context, arg0 uint64) (ret0 types.Node, ret1 error) { args := []interface{}{arg0} result, err := s.client.RequestContext(ctx, s.module, s.object, "GetNode", args...) if err != nil { @@ -168,7 +167,7 @@ func (s *RegistrarGatewayStub) GetNodeByTwinID(ctx context.Context, arg0 uint64) return } -func (s *RegistrarGatewayStub) GetNodeContracts(ctx context.Context, arg0 uint32) (ret0 []types.U64, ret1 error) { +func (s *RegistrarGatewayStub) GetNodeContracts(ctx context.Context, arg0 uint32) (ret0 []types1.U64, ret1 error) { args := []interface{}{arg0} result, err := s.client.RequestContext(ctx, s.module, s.object, "GetNodeContracts", args...) if err != nil { @@ -253,7 +252,7 @@ func (s *RegistrarGatewayStub) GetTime(ctx context.Context) (ret0 time.Time, ret return } -func (s *RegistrarGatewayStub) GetTwin(ctx context.Context, arg0 uint64) (ret0 db.Account, ret1 error) { +func (s *RegistrarGatewayStub) GetTwin(ctx context.Context, arg0 uint64) (ret0 types.Account, ret1 error) { args := []interface{}{arg0} result, err := s.client.RequestContext(ctx, s.module, s.object, "GetTwin", args...) if err != nil { @@ -304,7 +303,7 @@ func (s *RegistrarGatewayStub) GetZosVersion(ctx context.Context) (ret0 string, return } -func (s *RegistrarGatewayStub) Report(ctx context.Context, arg0 []tfchainclientgo.NruConsumption) (ret0 types.Hash, ret1 error) { +func (s *RegistrarGatewayStub) Report(ctx context.Context, arg0 []tfchainclientgo.NruConsumption) (ret0 types1.Hash, ret1 error) { args := []interface{}{arg0} result, err := s.client.RequestContext(ctx, s.module, s.object, "Report", args...) if err != nil { @@ -339,7 +338,7 @@ func (s *RegistrarGatewayStub) SetContractConsumption(ctx context.Context, arg0 return } -func (s *RegistrarGatewayStub) SetNodePowerState(ctx context.Context, arg0 bool) (ret0 types.Hash, ret1 error) { +func (s *RegistrarGatewayStub) SetNodePowerState(ctx context.Context, arg0 bool) (ret0 types1.Hash, ret1 error) { args := []interface{}{arg0} result, err := s.client.RequestContext(ctx, s.module, s.object, "SetNodePowerState", args...) if err != nil { @@ -356,7 +355,7 @@ func (s *RegistrarGatewayStub) SetNodePowerState(ctx context.Context, arg0 bool) return } -func (s *RegistrarGatewayStub) UpdateNode(ctx context.Context, arg0 server.NodeRegistrationRequest) (ret0 uint64, ret1 error) { +func (s *RegistrarGatewayStub) UpdateNode(ctx context.Context, arg0 types.NodeRegistrationRequest) (ret0 uint64, ret1 error) { args := []interface{}{arg0} result, err := s.client.RequestContext(ctx, s.module, s.object, "UpdateNode", args...) if err != nil { diff --git a/pkg/types/types.go b/pkg/types/types.go new file mode 100644 index 00000000..d73c418c --- /dev/null +++ b/pkg/types/types.go @@ -0,0 +1,125 @@ +package types + +import ( + "time" + + "github.com/lib/pq" +) + +type NodeRegistrationRequest struct { + TwinID uint64 `json:"twin_id" binding:"required,min=1"` + FarmID uint64 `json:"farm_id" binding:"required,min=1"` + Resources Resources `json:"resources" binding:"required"` + Location Location `json:"location" binding:"required"` + Interfaces []Interface `json:"interfaces" binding:"required,min=1,dive"` + SecureBoot bool `json:"secure_boot"` + Virtualized bool `json:"virtualized"` + SerialNumber string `json:"serial_number" binding:"required"` +} + +type UpdateNodeRequest struct { + FarmID uint64 `json:"farm_id" binding:"required,min=1"` + Resources Resources `json:"resources" binding:"required,min=1"` + Location Location `json:"location" binding:"required"` + Interfaces []Interface `json:"interfaces" binding:"required,dive"` + SecureBoot bool `json:"secure_boot" binding:"required"` + Virtualized bool `json:"virtualized" binding:"required"` + SerialNumber string `json:"serial_number" binding:"required"` +} + +type UpdateAccountRequest struct { + Relays pq.StringArray `json:"relays"` + RMBEncKey string `json:"rmb_enc_key"` +} +type AccountCreationRequest struct { + Timestamp int64 `json:"timestamp" binding:"required"` + PublicKey string `json:"public_key" binding:"required"` // base64 encoded + // the registrar expect a signature of a message with format `timestampStr:publicKeyBase64` + // - signature format: base64(ed25519_or_sr22519_signature) + Signature string `json:"signature" binding:"required"` + Relays []string `json:"relays,omitempty"` + RMBEncKey string `json:"rmb_enc_key,omitempty"` +} +type UptimeReportRequest struct { + Uptime time.Duration `json:"uptime" binding:"required"` + Timestamp time.Time `json:"timestamp" binding:"required"` +} +type Account struct { + TwinID uint64 `gorm:"primaryKey;autoIncrement"` + Relays pq.StringArray `gorm:"type:text[];default:'{}'" json:"relays"` // Optional list of relay domains + RMBEncKey string `gorm:"type:text" json:"rmb_enc_key"` // Optional base64 encoded public key for rmb communication + CreatedAt time.Time + UpdatedAt time.Time + // The public key (ED25519 for nodes, ED25519 or SR25519 for farmers) in the more standard base64 since we are moving from substrate echo system? + // (still SS58 can be used or plain base58 ,TBD) + PublicKey string `gorm:"type:text;not null;unique"` + // Relations | likely we need to use OnDelete:RESTRICT (Prevent Twin deletion if farms exist) + Farms []Farm `gorm:"foreignKey:TwinID;references:TwinID;constraint:OnDelete:RESTRICT"` +} + +type Farm struct { + FarmID uint64 `gorm:"primaryKey;autoIncrement" json:"farm_id"` + FarmName string `gorm:"size:40;not null;unique;check:farm_name <> ''" json:"farm_name"` + TwinID uint64 `json:"twin_id" gorm:"not null;check:twin_id > 0"` // Farmer account reference + Dedicated bool `json:"dedicated"` + CreatedAt time.Time + UpdatedAt time.Time + + Nodes []Node `gorm:"foreignKey:FarmID;references:FarmID;constraint:OnDelete:RESTRICT" json:"nodes"` +} + +type Node struct { + NodeID uint64 `json:"node_id" gorm:"primaryKey;autoIncrement"` + // Constraints set to prevents unintended account deletion if linked Farms/nodes exist. + FarmID uint64 `json:"farm_id" gorm:"not null;check:farm_id> 0;foreignKey:FarmID;references:FarmID;constraint:OnDelete:RESTRICT"` + TwinID uint64 `json:"twin_id" gorm:"not null;unique;check:twin_id > 0;foreignKey:TwinID;references:TwinID;constraint:OnDelete:RESTRICT"` // Node account reference + + Location Location `json:"location" gorm:"not null;type:json"` + + // PublicConfig PublicConfig `json:"public_config" gorm:"type:json"` + Resources Resources `json:"resources" gorm:"not null;type:json"` + Interfaces []Interface `json:"interface" gorm:"not null;type:json"` + SecureBoot bool + Virtualized bool + SerialNumber string + + UptimeReports []UptimeReport `json:"uptime" gorm:"foreignKey:NodeID;references:NodeID;constraint:OnDelete:CASCADE"` + + CreatedAt time.Time + UpdatedAt time.Time + Approved bool +} + +type UptimeReport struct { + ID uint64 `gorm:"primaryKey;autoIncrement"` + NodeID uint64 `gorm:"index"` + Duration time.Duration // Uptime duration for this period + Timestamp time.Time `gorm:"index"` + WasRestart bool // True if this report followed a restart + CreatedAt time.Time +} + +type ZosVersion struct { + Key string `gorm:"primaryKey;size:50"` + Version string `gorm:"not null"` +} + +type Interface struct { + Name string `json:"name"` + Mac string `json:"mac"` + IPs string `json:"ips"` +} + +type Resources struct { + HRU uint64 `json:"hru"` + SRU uint64 `json:"sru"` + CRU uint64 `json:"cru"` + MRU uint64 `json:"mru"` +} + +type Location struct { + Country string `json:"country" gorm:"not null"` + City string `json:"city" gorm:"not null"` + Longitude string `json:"longitude" gorm:"not null"` + Latitude string `json:"latitude" gorm:"not null"` +}