diff --git a/source/main/cardano/CardanoWalletLauncher.js b/source/main/cardano/CardanoWalletLauncher.js index 9eaa48d9a3..33b85ad7b0 100644 --- a/source/main/cardano/CardanoWalletLauncher.js +++ b/source/main/cardano/CardanoWalletLauncher.js @@ -3,6 +3,7 @@ import { spawn } from 'child_process'; import { dirname } from 'path'; import type { ChildProcess } from 'child_process'; import { configureJormungandrDeps } from './nodes'; +import { CARDANO_WALLET_STAKE_POOL_REGISTRY_URL } from '../config'; export type WalletOpts = { path: string, @@ -26,6 +27,15 @@ export async function CardanoWalletLauncher( path, walletArgs, } = walletOpts; + const walletStdio: string[] = ['pipe', 'pipe', 'pipe', 'ipc']; + const nodePath = dirname(nodeBin); + const PATH: string = (process.env.PATH: any); + const envVariables: { + PATH: string, + CARDANO_WALLET_STAKE_POOL_REGISTRY_URL?: string, + } = { + PATH: `${nodePath}:${PATH}`, + }; // This switch statement handles any node specifc // configuration, prior to spawning the child process @@ -37,23 +47,18 @@ export async function CardanoWalletLauncher( // The selfnode is identified by the unique genesis-block wallet arg if (walletArgs.findIndex(arg => arg === '--genesis-block') > -1) { await configureJormungandrDeps(cliBin, stateDir); + Object.assign(envVariables, { CARDANO_WALLET_STAKE_POOL_REGISTRY_URL }); } break; default: break; } - const walletStdio: string[] = ['pipe', 'pipe', 'pipe', 'ipc']; - const nodePath = dirname(nodeBin); - const PATH: string = (process.env.PATH: any); - const childProcess = spawn(path, walletArgs, { stdio: walletStdio, env: { ...process.env, - PATH: `${nodePath}:${PATH}`, - CARDANO_WALLET_STAKE_POOL_REGISTRY_URL: - 'https://github.com/input-output-hk/cardano-wallet/raw/master/lib/jormungandr/test/data/jormungandr/stake_pools/registry/test-integration-registry.zip', + ...envVariables, }, }); diff --git a/source/main/config.js b/source/main/config.js index 95c55948d7..1350a0169e 100644 --- a/source/main/config.js +++ b/source/main/config.js @@ -129,3 +129,7 @@ export const DISK_SPACE_CHECK_LONG_INTERVAL = 10 * 60 * 1000; // 10 minutes | un export const DISK_SPACE_CHECK_MEDIUM_INTERVAL = 60 * 1000; // 1 minute | unit: milliseconds export const DISK_SPACE_CHECK_SHORT_INTERVAL = isTest ? 2000 : 10 * 1000; // 10 seconds | unit: milliseconds export const DISK_SPACE_RECOMMENDED_PERCENTAGE = 15; // 15% of the total disk space + +// CardanoWallet config +export const CARDANO_WALLET_STAKE_POOL_REGISTRY_URL = + 'https://github.com/input-output-hk/cardano-wallet/raw/master/lib/jormungandr/test/data/jormungandr/stake_pools/registry/test-integration-registry.zip';