Skip to content

Commit 6bb340f

Browse files
Merge pull request #6173 from mysteriumnetwork/fixes/l2rpc
Replace broken fallback rpc url
2 parents d365336 + ece1be3 commit 6bb340f

3 files changed

Lines changed: 117 additions & 10 deletions

File tree

ci/check/check.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727

2828
"github.com/magefile/mage/mg"
2929
"github.com/magefile/mage/sh"
30-
3130
"github.com/mysteriumnetwork/go-ci/commands"
3231
"github.com/mysteriumnetwork/go-ci/util"
3332
"github.com/mysteriumnetwork/node/ci/packages"
@@ -60,7 +59,7 @@ func CheckGoVet() error {
6059

6160
// CheckGoImports checks for issues with go imports.
6261
func CheckGoImports() error {
63-
return commands.GoImportsD(".", "pb", "tequilapi/endpoints/assets")
62+
return GoImportsD(".", "pb", "tequilapi/endpoints/assets")
6463
}
6564

6665
// CheckSwagger checks whether swagger spec at "tequilapi/docs/swagger.json" is valid against swagger specification 2.0.

ci/check/go_imports.go

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
* Copyright (C) 2026 The "MysteriumNetwork/node" Authors.
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package check
19+
20+
import (
21+
"errors"
22+
"fmt"
23+
"go/build"
24+
"os"
25+
"path"
26+
"strings"
27+
28+
"github.com/magefile/mage/mg"
29+
"github.com/magefile/mage/sh"
30+
"github.com/mysteriumnetwork/go-ci/shell"
31+
"github.com/mysteriumnetwork/go-ci/util"
32+
)
33+
34+
// GoImportsD checks for issues with go imports.
35+
//
36+
// Instead of packages, it operates on directories, thus it is compatible with gomodules outside GOPATH.
37+
//
38+
// Example:
39+
//
40+
// commands.GoImportsD(".", "docs")
41+
func GoImportsD(dir string, excludes ...string) error {
42+
mg.Deps(GetImports)
43+
goimportsBin, err := util.GetGoBinaryPath("goimports")
44+
if err != nil {
45+
fmt.Println("❌ GoImports")
46+
fmt.Println("Tool 'goimports' not found")
47+
return err
48+
}
49+
var allExcludes []string
50+
allExcludes = append(allExcludes, excludes...)
51+
allExcludes = append(allExcludes, util.GoLintExcludes()...)
52+
dirs, err := util.GetProjectFileDirectories(allExcludes)
53+
if err != nil {
54+
return err
55+
}
56+
out, err := shell.NewCmd(goimportsBin + " -e -l -d " + strings.Join(dirs, " ")).Output()
57+
if err != nil {
58+
fmt.Println("❌ GoImports")
59+
fmt.Println("goimports: error executing")
60+
return err
61+
}
62+
if len(out) != 0 {
63+
fmt.Println("❌ GoImports")
64+
fmt.Println("goimports: the following files contain go import errors:")
65+
fmt.Println(out)
66+
return errors.New("goimports: not all imports follow the goimports format")
67+
}
68+
fmt.Println("✅ GoImports")
69+
return nil
70+
}
71+
72+
// GetGoPath returns the go path
73+
func GetGoPath() string {
74+
gopath := os.Getenv("GOPATH")
75+
if gopath == "" {
76+
gopath = build.Default.GOPATH
77+
}
78+
return gopath
79+
}
80+
81+
// GetGoBinaryPath looks for the given binary in path, if not checks if it's in $GOPATH/bin
82+
func GetGoBinaryPath(binaryName string) (string, error) {
83+
res, err := sh.Output("which", binaryName)
84+
if err == nil {
85+
return res, nil
86+
}
87+
gopath := GetGoPath()
88+
binaryUnderGopath := path.Join(gopath, "bin", binaryName)
89+
if _, err := os.Stat(binaryUnderGopath); os.IsNotExist(err) {
90+
return "", err
91+
}
92+
return binaryUnderGopath, nil
93+
}
94+
95+
// GetImports installs goimports binary.
96+
func GetImports() error {
97+
path, _ := GetGoBinaryPath("goimports")
98+
if path != "" {
99+
fmt.Println("Tool 'goimports' already installed")
100+
return nil
101+
}
102+
err := sh.RunV("go", "install", "golang.org/x/tools/cmd/goimports@v0.41.0")
103+
if err != nil {
104+
fmt.Println("Could not go get goimports")
105+
return err
106+
}
107+
return nil
108+
}

metadata/network.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var MainnetDefinition = NetworkDefinition{
8787
MystAddress: "0x1379e8886a944d2d9d440b3d88df536aea08d9f3",
8888
EtherClientRPC: []string{
8989
"https://polygon1.mysterium.network/",
90-
"https://polygon-rpc.com/",
90+
"https://polygon.drpc.org",
9191
},
9292
KnownHermeses: []string{
9393
"0xa62a2a75949d25e17c6f08a7818e7be97c18a8d2",
@@ -99,15 +99,15 @@ var MainnetDefinition = NetworkDefinition{
9999
PilvytisAddress: "https://pilvytis.mysterium.network",
100100
ObserverAddress: "https://observer.mysterium.network",
101101
DNSMap: map[string][]string{
102-
"discovery.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81"},
103-
"trust.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81"},
104-
"broker.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81"},
102+
"discovery.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81", "46.224.211.253", "188.245.149.150"},
103+
"trust.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81", "46.224.211.253", "188.245.149.150"},
104+
"broker.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81", "46.224.211.253", "188.245.149.150"},
105105
"transactor.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81",
106-
"51.158.204.23", "51.158.204.75", "51.158.204.9", "51.158.204.30"}, // remove after the migration is complete
107-
"affiliator.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81"},
106+
"51.158.204.23", "51.158.204.75", "51.158.204.9", "51.158.204.30", "46.224.211.253", "188.245.149.150"}, // remove after the migration is complete
107+
"affiliator.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81", "46.224.211.253", "188.245.149.150"},
108108
"pilvytis.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81",
109-
"51.158.204.23", "51.158.204.75", "51.158.204.9", "51.158.204.30"}, // remove after the migration is complete
110-
"observer.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81"},
109+
"51.158.204.23", "51.158.204.75", "51.158.204.9", "51.158.204.30", "46.224.211.253", "188.245.149.150"}, // remove after the migration is complete
110+
"observer.mysterium.network": {"159.69.15.34", "159.69.244.241", "116.203.130.98", "49.12.244.81", "46.224.211.253", "188.245.149.150"},
111111
},
112112
DefaultChainID: 137,
113113
DefaultCurrency: "MYST",

0 commit comments

Comments
 (0)