Repository: threefoldtech/zos
Pull request #1954 (2023-04-25 11:26:50)

Switch sub client


Patch:
diff --git a/cmds/modules/noded/main.go b/cmds/modules/noded/main.go
index 7893d5d3..524f50a7 100644
--- a/cmds/modules/noded/main.go
+++ b/cmds/modules/noded/main.go
@@ -13,7 +13,7 @@ import (
 	"github.com/urfave/cli/v2"
 
 	"github.com/threefoldtech/rmb-sdk-go"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg/app"
 	"github.com/threefoldtech/zos/pkg/capacity"
 	"github.com/threefoldtech/zos/pkg/environment"
diff --git a/cmds/modules/noded/public.go b/cmds/modules/noded/public.go
index eeb303d1..d568d4ba 100644
--- a/cmds/modules/noded/public.go
+++ b/cmds/modules/noded/public.go
@@ -6,7 +6,7 @@ import (
 
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zbus"
 	"github.com/threefoldtech/zos/pkg"
 	"github.com/threefoldtech/zos/pkg/environment"
diff --git a/cmds/modules/powerd/main.go b/cmds/modules/powerd/main.go
index 3c7b734a..9a8c2cab 100644
--- a/cmds/modules/powerd/main.go
+++ b/cmds/modules/powerd/main.go
@@ -5,7 +5,7 @@ import (
 
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zbus"
 	"github.com/threefoldtech/zos/pkg/environment"
 	"github.com/threefoldtech/zos/pkg/events"
diff --git a/cmds/modules/provisiond/cap.go b/cmds/modules/provisiond/cap.go
index 64b07369..eb9e011b 100644
--- a/cmds/modules/provisiond/cap.go
+++ b/cmds/modules/provisiond/cap.go
@@ -7,7 +7,7 @@ import (
 	"github.com/cenkalti/backoff/v3"
 	"github.com/centrifuge/go-substrate-rpc-client/v4/types"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg/gridtypes"
 	"github.com/threefoldtech/zos/pkg/provision"
 )
diff --git a/cmds/modules/provisiond/events.go b/cmds/modules/provisiond/events.go
index bf232ee9..1a94233e 100644
--- a/cmds/modules/provisiond/events.go
+++ b/cmds/modules/provisiond/events.go
@@ -6,7 +6,7 @@ import (
 
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg/events"
 	"github.com/threefoldtech/zos/pkg/gridtypes"
 	"github.com/threefoldtech/zos/pkg/provision"
diff --git a/cmds/modules/provisiond/main.go b/cmds/modules/provisiond/main.go
index 38720f68..1152b5f0 100644
--- a/cmds/modules/provisiond/main.go
+++ b/cmds/modules/provisiond/main.go
@@ -15,7 +15,7 @@ import (
 	"github.com/pkg/errors"
 	"github.com/rusart/muxprom"
 	"github.com/threefoldtech/rmb-sdk-go"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg"
 	"github.com/threefoldtech/zos/pkg/app"
 	"github.com/threefoldtech/zos/pkg/capacity"
diff --git a/cmds/modules/provisiond/reporter.go b/cmds/modules/provisiond/reporter.go
index 626a4ad8..b844fea5 100644
--- a/cmds/modules/provisiond/reporter.go
+++ b/cmds/modules/provisiond/reporter.go
@@ -11,7 +11,7 @@ import (
 	"github.com/joncrlsn/dque"
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zbus"
 	"github.com/threefoldtech/zos/pkg"
 	"github.com/threefoldtech/zos/pkg/environment"
diff --git a/go.mod b/go.mod
index f77e2234..b0d03965 100644
--- a/go.mod
+++ b/go.mod
@@ -43,7 +43,6 @@ require (
 	github.com/stretchr/testify v1.7.0
 	github.com/threefoldtech/0-fs v1.3.1-0.20201203163303-d963de9adea7
 	github.com/threefoldtech/rmb-sdk-go v0.0.0-20230214123537-4833a4e157e6
-	github.com/threefoldtech/substrate-client v0.1.5
 	github.com/threefoldtech/zbus v1.0.1
 	github.com/tyler-smith/go-bip39 v1.1.0
 	github.com/urfave/cli/v2 v2.3.0
@@ -132,6 +131,7 @@ require (
 	github.com/safchain/ethtool v0.0.0-20201023143004-874930cb3ce0 // indirect
 	github.com/sirupsen/logrus v1.8.1 // indirect
 	github.com/stretchr/objx v0.3.0 // indirect
+	github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20230425112357-f35e342c2193 // indirect
 	github.com/tinylib/msgp v1.1.5 // indirect
 	github.com/tklauser/go-sysconf v0.3.9 // indirect
 	github.com/tklauser/numcpus v0.3.0 // indirect
diff --git a/go.sum b/go.sum
index a0a3e8a6..14775ebe 100644
--- a/go.sum
+++ b/go.sum
@@ -753,6 +753,10 @@ github.com/threefoldtech/substrate-client v0.1.2 h1:9Xl13AYaspViKSjII18NgJWdA/9c
 github.com/threefoldtech/substrate-client v0.1.2/go.mod h1:ys/GJLeLmNX8E36UFMeR0yZC5Lo4PufYtfwsVX8H/AM=
 github.com/threefoldtech/substrate-client v0.1.5 h1:yYmWaJCMoJO0ieaO6eu3vIK0agehSw4OhSXlGydmv/E=
 github.com/threefoldtech/substrate-client v0.1.5/go.mod h1:ys/GJLeLmNX8E36UFMeR0yZC5Lo4PufYtfwsVX8H/AM=
+github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20230417112020-958303130d16 h1:WfuWTGBoZfo/RqELGu02Gz+E593QCCw9PdMhA3UQZgk=
+github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20230417112020-958303130d16/go.mod h1:8lQl+GDNxfXBwDYCTRdww2Ca5HH1Tc3Lv8AWwxPS7ak=
+github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20230425112357-f35e342c2193 h1:ejksDW2ZrffCrOpyyy4/DJyTsCdHgG1xxufW2P1IP3M=
+github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20230425112357-f35e342c2193/go.mod h1:8lQl+GDNxfXBwDYCTRdww2Ca5HH1Tc3Lv8AWwxPS7ak=
 github.com/threefoldtech/zbus v1.0.1 h1:3KaEpyOiDYAw+lrAyoQUGIvY9BcjVRXlQ1beBRqhRNk=
 github.com/threefoldtech/zbus v1.0.1/go.mod h1:E/v/xEvG/l6z/Oj0aDkuSUXFm/1RVJkhKBwDTAIdsHo=
 github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
diff --git a/pkg/environment/environment.go b/pkg/environment/environment.go
index b4987dce..98510ae6 100644
--- a/pkg/environment/environment.go
+++ b/pkg/environment/environment.go
@@ -6,7 +6,7 @@ import (
 	"sync"
 
 	"github.com/pkg/errors"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg"
 
 	"github.com/threefoldtech/zos/pkg/kernel"
diff --git a/pkg/events.go b/pkg/events.go
index 9c60f879..9a6385af 100644
--- a/pkg/events.go
+++ b/pkg/events.go
@@ -1,7 +1,7 @@
 package pkg
 
 import (
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 )
 
 // PublicConfigEvent pubic config event received. The type specify if this is just notification
diff --git a/pkg/events/events.go b/pkg/events/events.go
index f8dc8cfa..789045c1 100644
--- a/pkg/events/events.go
+++ b/pkg/events/events.go
@@ -11,7 +11,7 @@ import (
 	"github.com/centrifuge/go-substrate-rpc-client/v4/types"
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 )
 
 // State is used to track the blocks already processed by the processor
diff --git a/pkg/events/redis.go b/pkg/events/redis.go
index 054316a1..1c41b573 100644
--- a/pkg/events/redis.go
+++ b/pkg/events/redis.go
@@ -12,7 +12,7 @@ import (
 	"github.com/gomodule/redigo/redis"
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg"
 	"github.com/threefoldtech/zos/pkg/utils"
 )
diff --git a/pkg/gateway/gateway.go b/pkg/gateway/gateway.go
index f1fade7e..0d4fc5ab 100644
--- a/pkg/gateway/gateway.go
+++ b/pkg/gateway/gateway.go
@@ -14,7 +14,7 @@ import (
 
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zbus"
 	"github.com/threefoldtech/zos/pkg"
 	"github.com/threefoldtech/zos/pkg/cache"
diff --git a/pkg/identity/identityd.go b/pkg/identity/identityd.go
index fa19396c..22081294 100644
--- a/pkg/identity/identityd.go
+++ b/pkg/identity/identityd.go
@@ -4,7 +4,7 @@ import (
 	"fmt"
 
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg/crypto"
 	"github.com/threefoldtech/zos/pkg/identity/store"
 
diff --git a/pkg/network.go b/pkg/network.go
index 58ec9be3..75fa9505 100644
--- a/pkg/network.go
+++ b/pkg/network.go
@@ -6,7 +6,7 @@ import (
 	"net"
 	"reflect"
 
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg/gridtypes"
 	"github.com/threefoldtech/zos/pkg/gridtypes/zos"
 )
diff --git a/pkg/network/mbus.go b/pkg/network/mbus.go
index 09ca8178..a2376692 100644
--- a/pkg/network/mbus.go
+++ b/pkg/network/mbus.go
@@ -8,7 +8,7 @@ import (
 
 	"github.com/pkg/errors"
 	"github.com/threefoldtech/rmb-sdk-go"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg"
 	"github.com/threefoldtech/zos/pkg/environment"
 )
diff --git a/pkg/power/power.go b/pkg/power/power.go
index d4764547..3c40b283 100644
--- a/pkg/power/power.go
+++ b/pkg/power/power.go
@@ -9,7 +9,7 @@ import (
 
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zbus"
 	"github.com/threefoldtech/zos/pkg"
 	"github.com/threefoldtech/zos/pkg/events"
diff --git a/pkg/power/uptime.go b/pkg/power/uptime.go
index 246e678e..9b2c7304 100644
--- a/pkg/power/uptime.go
+++ b/pkg/power/uptime.go
@@ -11,7 +11,7 @@ import (
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
 	"github.com/shirou/gopsutil/host"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg/utils"
 )
 
diff --git a/pkg/provision/auth.go b/pkg/provision/auth.go
index 29476cfb..5b46c8e9 100644
--- a/pkg/provision/auth.go
+++ b/pkg/provision/auth.go
@@ -6,7 +6,7 @@ import (
 
 	lru "github.com/hashicorp/golang-lru"
 	"github.com/pkg/errors"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 )
 
 type substrateTwins struct {
diff --git a/pkg/provision/engine.go b/pkg/provision/engine.go
index 3bccdc66..3e9a9f14 100644
--- a/pkg/provision/engine.go
+++ b/pkg/provision/engine.go
@@ -11,7 +11,7 @@ import (
 
 	"github.com/joncrlsn/dque"
 	"github.com/pkg/errors"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zos/pkg"
 	"github.com/threefoldtech/zos/pkg/gridtypes"
 
diff --git a/pkg/registrar/register.go b/pkg/registrar/register.go
index 2b7cdaf1..cc90c3af 100644
--- a/pkg/registrar/register.go
+++ b/pkg/registrar/register.go
@@ -10,7 +10,7 @@ import (
 	"github.com/centrifuge/go-substrate-rpc-client/v4/types"
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zbus"
 	"github.com/threefoldtech/zos/pkg/environment"
 	"github.com/threefoldtech/zos/pkg/geoip"
diff --git a/pkg/registrar/registrar.go b/pkg/registrar/registrar.go
index 958ed0a0..0deea142 100644
--- a/pkg/registrar/registrar.go
+++ b/pkg/registrar/registrar.go
@@ -10,7 +10,7 @@ import (
 	"github.com/cenkalti/backoff/v3"
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog/log"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 	"github.com/threefoldtech/zbus"
 	"github.com/threefoldtech/zos/pkg/app"
 	"github.com/threefoldtech/zos/pkg/environment"


Test patch:
diff --git a/pkg/gridtypes/sign_test.go b/pkg/gridtypes/sign_test.go
index 461f1b16..24df5720 100644
--- a/pkg/gridtypes/sign_test.go
+++ b/pkg/gridtypes/sign_test.go
@@ -9,7 +9,7 @@ import (
 	"testing"
 
 	"github.com/stretchr/testify/require"
-	"github.com/threefoldtech/substrate-client"
+	substrate "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
 )
 
 type polkaSigner struct {