From 2c21ff3853059583a808e7c345772f44845fcfc3 Mon Sep 17 00:00:00 2001 From: Pierre Jeanjacquot <26487010+PierreJeanjacquot@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:46:54 +0100 Subject: [PATCH 1/2] fix: change default chain to arbitrum-sepolia-testnet for new projects --- cli/src/config/config.ts | 2 +- cli/test/iapp.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/config/config.ts b/cli/src/config/config.ts index 443a7f9d..5f9a76c2 100644 --- a/cli/src/config/config.ts +++ b/cli/src/config/config.ts @@ -74,7 +74,7 @@ type ChainConfig = { tdxWorkerpool?: string; }; -export const DEFAULT_CHAIN = 'bellecour'; +export const DEFAULT_CHAIN = 'arbitrum-sepolia-testnet'; export const CHAINS_CONFIGURATIONS: Record = { bellecour: { diff --git a/cli/test/iapp.test.ts b/cli/test/iapp.test.ts index 5ba1a108..90782091 100644 --- a/cli/test/iapp.test.ts +++ b/cli/test/iapp.test.ts @@ -81,8 +81,8 @@ test('iapp init command works', async () => { // default chain is bellecour assert.strictEqual( config.defaultChain, - 'bellecour', - 'defaultChain should be bellecour' + 'arbitrum-sepolia-testnet', + 'defaultChain should be arbitrum-sepolia-testnet' ); // default project name is hello-world assert.strictEqual( From fa477220c36cc1590d0f406afa9230a06d220c00 Mon Sep 17 00:00:00 2001 From: Pierre Jeanjacquot <26487010+PierreJeanjacquot@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:48:15 +0100 Subject: [PATCH 2/2] fix: deprecate bellecour chain --- cli/src/cli-helpers/ensureBalances.ts | 2 +- cli/src/cli-helpers/resolveChainConfig.ts | 32 +++++++++++++++++++++++ cli/src/cmd/debug.ts | 11 +++++--- cli/src/cmd/deploy.ts | 12 +++++---- cli/src/cmd/run.ts | 13 +++++---- cli/src/config/config.ts | 2 ++ 6 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 cli/src/cli-helpers/resolveChainConfig.ts diff --git a/cli/src/cli-helpers/ensureBalances.ts b/cli/src/cli-helpers/ensureBalances.ts index 7e8b8596..6089e060 100644 --- a/cli/src/cli-helpers/ensureBalances.ts +++ b/cli/src/cli-helpers/ensureBalances.ts @@ -71,7 +71,7 @@ You can either: - Fund your wallet ${emphasis(address)} - Import another wallet (run ${command('iapp wallet import')}) - Select an imported wallet (run ${command('iapp wallet select')}) - - Use another chain (use option ${command('--chain ')})`) + - Use another chain (change default chain ${command('iapp chain select ')} or use option ${command('--chain ')})`) ); } diff --git a/cli/src/cli-helpers/resolveChainConfig.ts b/cli/src/cli-helpers/resolveChainConfig.ts new file mode 100644 index 00000000..a3dd30cc --- /dev/null +++ b/cli/src/cli-helpers/resolveChainConfig.ts @@ -0,0 +1,32 @@ +import { DEFAULT_CHAIN, DEPRECATED_CHAINS } from '../config/config.js'; +import { getChainConfig } from '../utils/iAppConfigFile.js'; +import type { Spinner } from './spinner.js'; +import { command as colorCommand, file as colorFile } from './color.js'; +import { warnBox } from './box.js'; + +export const resolveChainConfig = ({ + chain, + defaultChain, + spinner, +}: { + chain?: string; + defaultChain: string; + spinner: Spinner; +}) => { + const config = getChainConfig(chain ?? defaultChain); + + spinner.info(`Using chain ${colorFile(config.name)}`); + + if (DEPRECATED_CHAINS.includes(config.name)) { + spinner.log( + warnBox( + `The selected chain ${colorFile(config.name)} is deprecated and may not be supported in future versions. +Please consider switching to ${colorFile(DEFAULT_CHAIN)} or another supported chain. + +run ${colorCommand('iapp chain select ')} to change default chain or use ${colorCommand('--chain ')} option.` + ) + ); + } + + return config; +}; diff --git a/cli/src/cmd/debug.ts b/cli/src/cmd/debug.ts index 16460aae..a245a980 100644 --- a/cli/src/cmd/debug.ts +++ b/cli/src/cmd/debug.ts @@ -4,8 +4,9 @@ import { getIExec } from '../utils/iexec.js'; import { getSpinner } from '../cli-helpers/spinner.js'; import * as color from '../cli-helpers/color.js'; import { handleCliError } from '../cli-helpers/handleCliError.js'; -import { getChainConfig, readIAppConfig } from '../utils/iAppConfigFile.js'; +import { readIAppConfig } from '../utils/iAppConfigFile.js'; import { goToProjectRoot } from '../cli-helpers/goToProjectRoot.js'; +import { resolveChainConfig } from '../cli-helpers/resolveChainConfig.js'; export async function debug({ taskId, @@ -22,9 +23,11 @@ export async function debug({ } await goToProjectRoot({ spinner }); const { defaultChain } = await readIAppConfig(); - const chainName = chain || defaultChain; - const chainConfig = getChainConfig(chainName); - spinner.info(`Using chain ${chainName}`); + const chainConfig = resolveChainConfig({ + chain, + defaultChain, + spinner, + }); const signer = await askForWallet({ spinner }); const iexec = getIExec({ ...chainConfig, diff --git a/cli/src/cmd/deploy.ts b/cli/src/cmd/deploy.ts index 55b74d4f..3c25d115 100644 --- a/cli/src/cmd/deploy.ts +++ b/cli/src/cmd/deploy.ts @@ -9,7 +9,6 @@ import { import { sconify } from '../utils/sconify.js'; import { askForDockerhubUsername } from '../cli-helpers/askForDockerhubUsername.js'; import { - getChainConfig, projectNameToImageName, readIAppConfig, } from '../utils/iAppConfigFile.js'; @@ -26,15 +25,18 @@ import { addDeploymentData } from '../utils/cacheExecutions.js'; import { useTdx } from '../utils/featureFlags.js'; import { ensureBalances } from '../cli-helpers/ensureBalances.js'; import { warnBeforeTxFees } from '../cli-helpers/warnBeforeTxFees.js'; +import { resolveChainConfig } from '../cli-helpers/resolveChainConfig.js'; export async function deploy({ chain }: { chain?: string }) { const spinner = getSpinner(); try { await goToProjectRoot({ spinner }); const { projectName, template, defaultChain } = await readIAppConfig(); - const chainName = chain || defaultChain; - const chainConfig = getChainConfig(chainName); - spinner.info(`Using chain ${chainName}`); + const chainConfig = resolveChainConfig({ + chain, + defaultChain, + spinner, + }); await warnBeforeTxFees({ spinner, chain: chainConfig.name }); const signer = await askForWallet({ spinner }); @@ -178,7 +180,7 @@ export async function deploy({ chain }: { chain?: string }) { image: appDockerImage, app: appContractAddress, owner: userAddress, - chainName, + chainName: chainConfig.name, }); spinner.succeed( `TEE app deployed with image ${appDockerImage} on iExec with address ${appContractAddress}` diff --git a/cli/src/cmd/run.ts b/cli/src/cmd/run.ts index 36e60faa..bce28f1d 100644 --- a/cli/src/cmd/run.ts +++ b/cli/src/cmd/run.ts @@ -14,10 +14,11 @@ import { askShowResult } from '../cli-helpers/askShowResult.js'; import { goToProjectRoot } from '../cli-helpers/goToProjectRoot.js'; import * as color from '../cli-helpers/color.js'; import { IExec } from 'iexec'; -import { getChainConfig, readIAppConfig } from '../utils/iAppConfigFile.js'; +import { readIAppConfig } from '../utils/iAppConfigFile.js'; import { ensureBalances } from '../cli-helpers/ensureBalances.js'; import { askForAcknowledgment } from '../cli-helpers/askForAcknowledgment.js'; import { warnBeforeTxFees } from '../cli-helpers/warnBeforeTxFees.js'; +import { resolveChainConfig } from '../cli-helpers/resolveChainConfig.js'; export async function run({ iAppAddress, @@ -40,9 +41,11 @@ export async function run({ await cleanRunOutput({ spinner, outputFolder: RUN_OUTPUT_DIR }); const { defaultChain } = await readIAppConfig(); - const chainName = chain || defaultChain; - const chainConfig = getChainConfig(chainName); - spinner.info(`Using chain ${chainName}`); + const chainConfig = resolveChainConfig({ + chain, + defaultChain, + spinner, + }); await warnBeforeTxFees({ spinner, chain: chainConfig.name }); spinner.start('checking inputs...'); @@ -245,7 +248,7 @@ export async function run({ dealid, taskids: [taskid], txHash, - chainName, + chainName: chainConfig.name, }); spinner.succeed( `Deal created successfully diff --git a/cli/src/config/config.ts b/cli/src/config/config.ts index 5f9a76c2..e25b6f3f 100644 --- a/cli/src/config/config.ts +++ b/cli/src/config/config.ts @@ -76,6 +76,8 @@ type ChainConfig = { export const DEFAULT_CHAIN = 'arbitrum-sepolia-testnet'; +export const DEPRECATED_CHAINS = ['bellecour']; + export const CHAINS_CONFIGURATIONS: Record = { bellecour: { rpcHostUrl: 'https://bellecour.iex.ec',