diff --git a/bins/packages/rmb/rmb.sh b/bins/packages/rmb/rmb.sh index bc387e74b..26dae1ff9 100644 --- a/bins/packages/rmb/rmb.sh +++ b/bins/packages/rmb/rmb.sh @@ -1,5 +1,5 @@ -RMB_VERSION="1.0.7" -RMB_CHECKSUM="849f43d0356c1848f63669951d44a64b" +RMB_VERSION="1.1.1" +RMB_CHECKSUM="cccfee332b2795eaccea34a049e7ae0d" RMB_LINK="https://github.com/threefoldtech/rmb-rs/releases/download/v${RMB_VERSION}/rmb-peer" download_rmb() { diff --git a/cmds/modules/noded/twin.go b/cmds/modules/noded/twin.go index 1a04d2545..ef4d93c30 100644 --- a/cmds/modules/noded/twin.go +++ b/cmds/modules/noded/twin.go @@ -38,30 +38,39 @@ func withDefaultPort(substrateUrl string) (string, error) { return u.String(), nil } -func runMsgBus(ctx context.Context, sk ed25519.PrivateKey, substrateURLs []string, relayAddr string, redisAddr string) error { +func runMsgBus(ctx context.Context, sk ed25519.PrivateKey, substrateURLs []string, relayAddr []string, redisAddr string) error { // select the first one as only one URL is set for now if len(substrateURLs) == 0 { return errors.New("at least one substrate URL must be provided") } + if len(relayAddr) == 0 { + return errors.New("at least one relay URL must be provided") + } + seed := sk.Seed() seedHex := fmt.Sprintf("0x%s", hex.EncodeToString(seed)) log.Info().Msg("starting rmb...") - substrateURL, err := withDefaultPort(substrateURLs[0]) - if err != nil { - return err - } - args := []string{ - "-s", substrateURL, - "--relay", relayAddr, "-k", keyType, "--seed", seedHex, "--redis", redisAddr, } + for _, url := range substrateURLs { + url, err := withDefaultPort(url) + if err != nil { + return err + } + args = append(args, "--substrate", url) + } + + for _, url := range relayAddr { + args = append(args, "--relay", url) + } + if kernel.GetParams().IsDebug() { args = append(args, "-d") } diff --git a/go.mod b/go.mod index a7c25fae0..4d8a376cd 100644 --- a/go.mod +++ b/go.mod @@ -77,6 +77,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect github.com/ethereum/go-ethereum v1.11.6 // indirect github.com/go-ole/go-ole v1.2.6 // indirect @@ -85,6 +86,7 @@ require ( github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect diff --git a/go.sum b/go.sum index 9ec140a7c..72a9e85c7 100644 --- a/go.sum +++ b/go.sum @@ -208,6 +208,8 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= diff --git a/pkg/environment/environment.go b/pkg/environment/environment.go index aa1c4a3ff..f18bf2e0f 100644 --- a/pkg/environment/environment.go +++ b/pkg/environment/environment.go @@ -27,9 +27,12 @@ type Environment struct { FarmID pkg.FarmID Orphan bool - FarmSecret string - SubstrateURL []string - RelayURL string + FarmSecret string + SubstrateURL []string + // IMPORTANT NOTICE: + // SINCE RELAYS FOR A NODE IS STORED ON THE CHAIN IN A LIMITED SPACE + // PLEASE MAKE SURE THAT ANY ENV HAS NO MORE THAN FOUR RELAYS CONFIGURED + RelayURL []string ActivationURL string GraphQL string @@ -81,7 +84,9 @@ var ( SubstrateURL: []string{ "wss://tfchain.dev.grid.tf/", }, - RelayURL: "wss://relay.dev.grid.tf", + RelayURL: []string{ + "wss://relay.dev.grid.tf", + }, ActivationURL: "https://activation.dev.grid.tf/activation/activate", FlistURL: "redis://hub.grid.tf:9900", BinRepo: "tf-zos-v3-bins.dev", @@ -93,7 +98,9 @@ var ( SubstrateURL: []string{ "wss://tfchain.test.grid.tf/", }, - RelayURL: "wss://relay.test.grid.tf", + RelayURL: []string{ + "wss://relay.test.grid.tf", + }, ActivationURL: "https://activation.test.grid.tf/activation/activate", FlistURL: "redis://hub.grid.tf:9900", BinRepo: "tf-zos-v3-bins.test", @@ -105,7 +112,9 @@ var ( SubstrateURL: []string{ "wss://tfchain.qa.grid.tf/", }, - RelayURL: "wss://relay.qa.grid.tf", + RelayURL: []string{ + "wss://relay.qa.grid.tf", + }, ActivationURL: "https://activation.qa.grid.tf/activation/activate", FlistURL: "redis://hub.grid.tf:9900", BinRepo: "tf-zos-v3-bins.qanet", @@ -120,7 +129,9 @@ var ( "wss://03.tfchain.grid.tf/", "wss://04.tfchain.grid.tf/", }, - RelayURL: "wss://relay.grid.tf", + RelayURL: []string{ + "wss://relay.grid.tf", + }, ActivationURL: "https://activation.grid.tf/activation/activate", FlistURL: "redis://hub.grid.tf:9900", BinRepo: "tf-zos-v3-bins", @@ -200,7 +211,7 @@ func getEnvironmentFromParams(params kernel.Params) (Environment, error) { if relay, ok := params.Get("relay"); ok { if len(relay) > 0 { - env.RelayURL = relay[len(relay)-1] + env.RelayURL = relay } }