Skip to content

Commit aff7776

Browse files
feat: remove tanglebay shimmer node from official nodes list (#8562)
* feat: remove tanglebay shimmer node from official nodes list * feat: migrate primaryNode too * fix: tests
1 parent ed6e157 commit aff7776

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

packages/shared/lib/core/network/constants/official-node-urls.constant.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export const OFFICIAL_NODE_URLS: Readonly<{ [key in NetworkId]?: string[] }> = {
44
[NetworkId.Iota]: ['https://api.stardust-mainnet.iotaledger.net', 'https://iota-node.tanglebay.com'],
55
[NetworkId.IotaTestnet]: ['https://api.testnet.iotaledger.net'],
66
[NetworkId.IotaAlphanet]: ['https://api.iota-alphanet.iotaledger.net'],
7-
[NetworkId.Shimmer]: ['https://api.shimmer.network', 'https://shimmer-node.tanglebay.com'],
7+
[NetworkId.Shimmer]: ['https://api.shimmer.network'],
88
[NetworkId.ShimmerTestnet]: ['https://api.testnet.shimmer.network'],
99
}

packages/shared/lib/core/network/tests/network.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('File: network.ts', () => {
2424
[NetworkId.Iota]: ['https://api.stardust-mainnet.iotaledger.net', 'https://iota-node.tanglebay.com'],
2525
[NetworkId.IotaTestnet]: ['https://api.testnet.iotaledger.net'],
2626
[NetworkId.IotaAlphanet]: ['https://api.iota-alphanet.iotaledger.net'],
27-
[NetworkId.Shimmer]: ['https://api.shimmer.network', 'https://shimmer-node.tanglebay.com'],
27+
[NetworkId.Shimmer]: ['https://api.shimmer.network'],
2828
[NetworkId.ShimmerTestnet]: ['https://api.testnet.shimmer.network'],
2929
}
3030

packages/shared/lib/core/profile/actions/profiles/checkAndMigrateProfiles.ts

+22
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
DEFAULT_CHAIN_CONFIGURATIONS,
55
DEFAULT_MAX_PARALLEL_API_REQUESTS,
66
getDefaultPersistedNetwork,
7+
getOfficialNodes,
78
IIscpChainMetadata,
89
NetworkId,
910
} from '@core/network'
@@ -75,6 +76,7 @@ const persistedProfileMigrationsMap: Record<number, (existingProfile: unknown) =
7576
16: persistedProfileMigrationToV17,
7677
17: persistedProfileMigrationToV18,
7778
18: persistedProfileMigrationToV19,
79+
19: persistedProfileMigrationToV20,
7880
}
7981

8082
function persistedProfileMigrationToV4(existingProfile: unknown): void {
@@ -352,3 +354,23 @@ function persistedProfileMigrationToV19(existingProfile: IPersistedProfile): voi
352354
existingProfile.network.chains = newChains
353355
saveProfile(existingProfile)
354356
}
357+
358+
/*
359+
* Migration 20
360+
* Remove Tanglebay SMR node from the list of nodes.
361+
*/
362+
function persistedProfileMigrationToV20(existingProfile: IPersistedProfile): void {
363+
const DEPRECATED_NODE_URL = 'https://shimmer-node.tanglebay.com'
364+
const OFFICIAL_NODES = getOfficialNodes(existingProfile.network.id)
365+
366+
const nodes = existingProfile.clientOptions.nodes ?? []
367+
existingProfile.clientOptions.nodes = nodes.filter((node) => node.url !== DEPRECATED_NODE_URL)
368+
if (!existingProfile.clientOptions.nodes?.length) {
369+
existingProfile.clientOptions.nodes = OFFICIAL_NODES
370+
}
371+
const primaryNode = existingProfile.clientOptions.primaryNode
372+
if (primaryNode?.url === DEPRECATED_NODE_URL) {
373+
existingProfile.clientOptions.primaryNode = undefined
374+
}
375+
saveProfile(existingProfile)
376+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const PROFILE_VERSION = 19
1+
export const PROFILE_VERSION = 20

0 commit comments

Comments
 (0)