From 26dc634dfa06e716b8e4f2d4932d9c64a7206310 Mon Sep 17 00:00:00 2001 From: Michal Rus Date: Wed, 11 Sep 2024 10:22:24 +0200 Subject: [PATCH] [LW-11497] Fix token metadata server URL on all networks --- CHANGELOG.md | 2 ++ nix/internal/launcher-config.nix | 13 ++++++++++--- source/main/config.ts | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e1d3c368..34a0d222e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Fixes +- Fix token metadata server URL on all networks ([PR 3227](https://github.com/input-output-hk/daedalus/pull/3227)) + - Un-brick auto-update on devices where it failed in the past ([PR 3223](https://github.com/input-output-hk/daedalus/pull/3223)) ## 6.0.1 diff --git a/nix/internal/launcher-config.nix b/nix/internal/launcher-config.nix index e553d2a13f..a87f4513f3 100644 --- a/nix/internal/launcher-config.nix +++ b/nix/internal/launcher-config.nix @@ -34,6 +34,12 @@ let preview = "https://preview-smash.world.dev.cardano.org"; }; + tokenMetadataServers = { + mainnet = "https://tokens.cardano.org"; + preprod = "https://metadata.world.dev.cardano.org"; + preview = "https://metadata.world.dev.cardano.org"; + }; + fromCardanoPlayground = envName: let originalFiles = builtins.path { name = "cardano-playground-config-${envName}"; @@ -57,6 +63,7 @@ let cardanoEnv = { inherit nodeConfig; topologyFile = originalFiles + "/topology.json"; + metadataUrl = tokenMetadataServers.${envName}; }; }; @@ -301,13 +308,13 @@ let topologyFile = mkConfigPath nodeConfigFiles "topology.yaml"; }; }; - } // (lib.optionalAttrs (network == "selfnode") { + } // (lib.optionalAttrs (network != "selfnode") { + metadataUrl = envCfg.metadataUrl; + }) // (lib.optionalAttrs (network == "selfnode") { selfnodeBin = mkBinPath "local-cluster"; mockTokenMetadataServerBin = mkBinPath "mock-token-metadata-server"; }) // (lib.optionalAttrs (__hasAttr network smashServers) { smashUrl = smashServers.${network}; - }) // (lib.optionalAttrs (__hasAttr "metadataUrl" envCfg) { - metadataUrl = envCfg.metadataUrl; }); installerConfig = { diff --git a/source/main/config.ts b/source/main/config.ts index efa86e09cf..973fd62c87 100644 --- a/source/main/config.ts +++ b/source/main/config.ts @@ -174,7 +174,7 @@ export const DISK_SPACE_CHECK_TIMEOUT = 9 * 1000; // Timeout for checking disks // Used if token metadata server URL is not defined in launcher config export const FALLBACK_TOKEN_METADATA_SERVER_URL = - 'https://metadata.cardano-testnet.iohkdev.io'; + 'https://metadata.world.dev.cardano.org'; export const MINIMUM_AMOUNT_OF_RAM_FOR_RTS_FLAGS = 16 * 1024 * 1024 * 1024; // 16gb RAM // Used by mock-token-metadata-server