Skip to content

Commit

Permalink
chore(fleets)_: Remove unsupported fleets
Browse files Browse the repository at this point in the history
* eth.prod
* status.staging

chore(fleets)_: reuse api.DefaultFleet in GetFleet()

fixes #5381

rebased on chore_: rename shards.test to status.prod (#5571)
  • Loading branch information
friofry committed Jul 30, 2024
1 parent f123e98 commit fc9375b
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 217 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ test-e2e-race: test-e2e ##@tests Run e2e tests with -race flag

canary-test: node-canary
# TODO: uncomment that!
#_assets/scripts/canary_test_mailservers.sh ./config/cli/fleet-eth.prod.json
#_assets/scripts/canary_test_mailservers.sh ./config/cli/fleet-status.prod.json

lint:
golangci-lint run ./...
Expand Down
2 changes: 1 addition & 1 deletion _assets/scripts/gen_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LISTEN_PORT="${LISTEN_PORT:-30303}"
API_MODULES="${API_MODULES:-eth,web3,admin}"
MAX_PEERS="${MAX_PEERS:-50}"
DAYS_KEPT="${DAYS_KEPT-30}"
FLEET_NAME="${FLEET_NAME:-eth.prod}"
FLEET_NAME="${FLEET_NAME:-status.prod}"
REGISTER_TOPIC="${REGISTER_TOPIC:-whispermail}"
MAIL_PASSWORD="${MAIL_PASSWORD:-status-offline-inbox}"
DATA_PATH="${DATA_PATH:-/var/tmp/status-go-mail}"
Expand Down
4 changes: 2 additions & 2 deletions _assets/scripts/update-fleet-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ DIR="$(cd $(dirname "$0")/../../config/cli; pwd)"
echo "Downloading https://fleets.status.im/"
json=$(curl --silent https://fleets.status.im/)
fleets=(
'eth.prod'
'status.prod'
)

wakufleets=(
'status.prod'
'status.test'
'status.staging'
'waku.sandbox'
'waku.test'
)
Expand Down
2 changes: 1 addition & 1 deletion _examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Running Waku node is a matter of a correct configuration. To enable Waku and JSO
}
```

This command will start a Waku node using the `eth.prod` fleet:
This command will start a Waku node using the `status.prod` fleet:
```shell script
$ ./build/bin/statusd -c ./_examples/waku.json
```
Expand Down
6 changes: 2 additions & 4 deletions api/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const DefaultVerifyTransactionChainID = 1

var paths = []string{pathWalletRoot, pathEIP1581, pathDefaultChat, pathDefaultWallet, pathEncryption}

var DefaultFleet = params.FleetStatusProd

var overrideApiConfig = overrideApiConfigProd

func defaultSettings(keyUID string, address string, derivedAddresses map[string]generator.AccountInfo) (*settings.Settings, error) {
Expand Down Expand Up @@ -127,7 +125,7 @@ func defaultSettings(keyUID string, address string, derivedAddresses map[string]
}

func SetDefaultFleet(nodeConfig *params.NodeConfig) error {
return SetFleet(DefaultFleet, nodeConfig)
return SetFleet(params.DefaultFleet, nodeConfig)
}

func SetFleet(fleet string, nodeConfig *params.NodeConfig) error {
Expand Down Expand Up @@ -292,7 +290,7 @@ func defaultNodeConfig(installationID string, request *requests.CreateAccount, o

fleet := request.WakuV2Fleet
if fleet == "" {
fleet = DefaultFleet
fleet = params.DefaultFleet
}

err := SetFleet(fleet, nodeConfig)
Expand Down
4 changes: 2 additions & 2 deletions api/geth_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,8 @@ func (b *GethStatusBackend) UpdateNodeConfigFleet(acc multiaccounts.Account, pas
if !params.IsFleetSupported(fleet) {
b.log.Warn("fleet is not supported, overriding with default value",
"fleet", fleet,
"defaultFleet", DefaultFleet)
fleet = DefaultFleet
"defaultFleet", params.DefaultFleet)
fleet = params.DefaultFleet
}

err = SetFleet(fleet, config)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ping-community/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func defaultNodeConfig(installationID string) (*params.NodeConfig, error) {
}

nodeConfig.Name = "StatusIM"
clusterConfig, err := params.LoadClusterConfigFromFleet("eth.prod")
clusterConfig, err := params.LoadClusterConfigFromFleet("status.prod")
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/populate-db/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func defaultNodeConfig(installationID string) (*params.NodeConfig, error) {

nodeConfig.Name = "StatusIM"
nodeConfig.Rendezvous = false
clusterConfig, err := params.LoadClusterConfigFromFleet("eth.prod")
clusterConfig, err := params.LoadClusterConfigFromFleet("status.prod")
if err != nil {
return nil, err
}
Expand Down
8 changes: 3 additions & 5 deletions cmd/statusd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,16 @@ var (
)
fleet = flag.String(
"fleet",
params.FleetProd,
params.DefaultFleet,
fmt.Sprintf(
"Select fleet: %s (default %s)",
[]string{
params.FleetProd,
params.FleetStatusStaging,
params.FleetStatusProd,
params.FleetStatusTest,
params.FleetStatusStaging,
params.FleetWakuSandbox,
params.FleetWakuTest,
},
params.FleetProd,
params.DefaultFleet,
),
)
listenAddr = flag.String("addr", "", "address to bind listener to")
Expand Down
2 changes: 1 addition & 1 deletion config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ This config manages what peers and bootstrap nodes your `status-go` instance con
{
"ClusterConfig": {
"Enabled": true,
"Fleet": "eth.prod",
"Fleet": "status.prod",
"BootNodes": [
"enode://[email protected]:30404"
],
Expand Down
37 changes: 0 additions & 37 deletions config/cli/fleet-eth.prod.json

This file was deleted.

25 changes: 0 additions & 25 deletions config/cli/fleet-status.test.json

This file was deleted.

2 changes: 1 addition & 1 deletion mobile/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ type FleetDescription struct {

func Fleets() string {
fleets := FleetDescription{
DefaultFleet: api.DefaultFleet,
DefaultFleet: params.DefaultFleet,
Fleets: params.GetSupportedFleets(),
}

Expand Down
6 changes: 3 additions & 3 deletions params/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package params
// Define available fleets.
const (
FleetUndefined = ""
FleetProd = "eth.prod"
FleetStatusStaging = "status.staging"
FleetStatusProd = "status.prod"
FleetStatusTest = "status.test"
FleetStatusStaging = "status.staging"
FleetWakuSandbox = "waku.sandbox"
FleetWakuTest = "waku.test"
)

const DefaultFleet = FleetStatusProd

// Cluster defines a list of Ethereum nodes.
type Cluster struct {
StaticNodes []string `json:"staticnodes"`
Expand Down
10 changes: 5 additions & 5 deletions params/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestNewNodeConfigWithDefaults(t *testing.T) {
c, err := params.NewNodeConfigWithDefaults(
"/some/data/path",
params.GoerliNetworkID,
params.WithFleet(params.FleetProd),
params.WithFleet(params.FleetStatusProd),
params.WithLES(),
params.WithMailserver(),
)
Expand All @@ -33,10 +33,10 @@ func TestNewNodeConfigWithDefaults(t *testing.T) {
// assert MailServer
assert.Equal(t, false, c.WakuConfig.EnableMailServer)
// assert cluster
assert.Equal(t, false, c.NoDiscovery)
assert.Equal(t, params.FleetProd, c.ClusterConfig.Fleet)
assert.NotEmpty(t, c.ClusterConfig.BootNodes)
assert.NotEmpty(t, c.ClusterConfig.StaticNodes)
assert.Equal(t, true, c.NoDiscovery)
assert.Equal(t, params.FleetStatusProd, c.ClusterConfig.Fleet)
assert.Empty(t, c.ClusterConfig.BootNodes)
assert.Empty(t, c.ClusterConfig.StaticNodes)
assert.NotEmpty(t, c.ClusterConfig.PushNotificationsServers)
// assert LES
assert.Equal(t, true, c.LightEthConfig.Enabled)
Expand Down
2 changes: 1 addition & 1 deletion protocol/messenger_mailserver_cycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (m *Messenger) getFleet() (string, error) {
} else if m.config.clusterConfig.Fleet != "" {
fleet = m.config.clusterConfig.Fleet
} else {
fleet = params.FleetProd
fleet = params.DefaultFleet
}
return fleet, nil
}
Expand Down
2 changes: 1 addition & 1 deletion server/pairing/sync_device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ func nodeConfigForLocalPairSync(installationID, keyUID, tmpDir string) (*params.

// need specify cluster config here, otherwise TestPairingThreeDevices will fail due to no messages(CR) received
// TODO(frank) need to figure out why above happen
clusterConfig, err := params.LoadClusterConfigFromFleet(params.FleetProd)
clusterConfig, err := params.LoadClusterConfigFromFleet(params.FleetStatusProd)
if err != nil {
return nil, err
}
Expand Down
72 changes: 0 additions & 72 deletions services/mailservers/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,6 @@ func DefaultMailserversByFleet(fleet string) []Mailserver {
func DefaultMailservers() []Mailserver {

return []Mailserver{
Mailserver{
ID: "mail-01.ac-cn-hongkong-c.eth.prod",
Address: "enode://606ae04a71e5db868a722c77a21c8244ae38f1bd6e81687cc6cfe88a3063fa1c245692232f64f45bd5408fed5133eab8ed78049332b04f9c110eac7f71c1b429@47.75.247.214:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "mail-01.do-ams3.eth.prod",
Address: "enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@178.128.142.54:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "mail-01.gc-us-central1-a.eth.prod",
Address: "enode://ee2b53b0ace9692167a410514bca3024695dbf0e1a68e1dff9716da620efb195f04a4b9e873fb9b74ac84de801106c465b8e2b6c4f0d93b8749d1578bfcaf03e@104.197.238.144:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "mail-02.ac-cn-hongkong-c.eth.prod",
Address: "enode://2c8de3cbb27a3d30cbb5b3e003bc722b126f5aef82e2052aaef032ca94e0c7ad219e533ba88c70585ebd802de206693255335b100307645ab5170e88620d2a81@47.244.221.14:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "mail-02.do-ams3.eth.prod",
Address: "enode://7aa648d6e855950b2e3d3bf220c496e0cae4adfddef3e1e6062e6b177aec93bc6cdcf1282cb40d1656932ebfdd565729da440368d7c4da7dbd4d004b1ac02bf8@178.128.142.26:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "mail-02.gc-us-central1-a.eth.prod",
Address: "enode://30211cbd81c25f07b03a0196d56e6ce4604bb13db773ff1c0ea2253547fafd6c06eae6ad3533e2ba39d59564cfbdbb5e2ce7c137a5ebb85e99dcfc7a75f99f55@23.236.58.92:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "mail-03.ac-cn-hongkong-c.eth.prod",
Address: "enode://e85f1d4209f2f99da801af18db8716e584a28ad0bdc47fbdcd8f26af74dbd97fc279144680553ec7cd9092afe683ddea1e0f9fc571ebcb4b1d857c03a088853d@47.244.129.82:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "mail-03.do-ams3.eth.prod",
Address: "enode://8a64b3c349a2e0ef4a32ea49609ed6eb3364be1110253c20adc17a3cebbc39a219e5d3e13b151c0eee5d8e0f9a8ba2cd026014e67b41a4ab7d1d5dd67ca27427@178.128.142.94:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "mail-03.gc-us-central1-a.eth.prod",
Address: "enode://44160e22e8b42bd32a06c1532165fa9e096eebedd7fa6d6e5f8bbef0440bc4a4591fe3651be68193a7ec029021cdb496cfe1d7f9f1dc69eb99226e6f39a7a5d4@35.225.221.245:443",
Fleet: params.FleetProd,
Version: 1,
},
Mailserver{
ID: "node-01.ac-cn-hongkong-c.waku.sandbox",
Address: "/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV",
Expand Down Expand Up @@ -105,24 +51,6 @@ func DefaultMailservers() []Mailserver {
Fleet: params.FleetWakuTest,
Version: 2,
},
Mailserver{
ID: "node-01.ac-cn-hongkong-c.status.test",
Address: "/dns4/node-01.ac-cn-hongkong-c.status.test.statusim.net/tcp/30303/p2p/16Uiu2HAm2BjXxCp1sYFJQKpLLbPbwd5juxbsYofu3TsS3auvT9Yi",
Fleet: params.FleetStatusTest,
Version: 2,
},
Mailserver{
ID: "node-01.do-ams3.status.test",
Address: "/dns4/node-01.do-ams3.status.test.statusim.net/tcp/30303/p2p/16Uiu2HAkukebeXjTQ9QDBeNDWuGfbaSg79wkkhK4vPocLgR6QFDf",
Fleet: params.FleetStatusTest,
Version: 2,
},
Mailserver{
ID: "node-01.gc-us-central1-a.status.test",
Address: "/dns4/node-01.gc-us-central1-a.status.test.statusim.net/tcp/30303/p2p/16Uiu2HAmGDX3iAFox93PupVYaHa88kULGqMpJ7AEHGwj3jbMtt76",
Fleet: params.FleetStatusTest,
Version: 2,
},
Mailserver{
ID: "store-01.do-ams3.status.prod",
Address: "/dns4/store-01.do-ams3.status.prod.statusim.net/tcp/30303/p2p/16Uiu2HAmAUdrQ3uwzuE4Gy4D56hX6uLKEeerJAnhKEHZ3DxF1EfT",
Expand Down
Loading

0 comments on commit fc9375b

Please sign in to comment.