diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 513b366b9..f0a9ada2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -282,6 +282,7 @@ jobs: INDEXER_NETWORKS: '[8996]' FEE_TOKENS: '{ "1": "0x967da4048cD07aB37855c090aAF366e4ce1b9F48", "137": "0x282d8efCe846A88B159800bd4130ad77443Fa1A1", "80001": "0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8", "56": "0xDCe07662CA8EbC241316a15B611c89711414Dd1a" }' FEE_AMOUNT: '{ "amount": 1, "unit": "MB" }' + SKIP_FEE_TOKEN_VALIDATION: 'true' AUTHORIZED_DECRYPTERS: '["0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"]' P2P_ENABLE_UPNP: 'false' P2P_ENABLE_AUTONAT: 'false' diff --git a/package-lock.json b/package-lock.json index c2c30d398..c2aa87c70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ocean-node", - "version": "3.0.3", + "version": "3.0.31", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ocean-node", - "version": "3.0.3", + "version": "3.0.31", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 431f3c72e..d7c434f94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ocean-node", - "version": "3.0.3", + "version": "3.0.31", "description": "Ocean Node is used to run all core services in the Ocean stack", "author": "Ocean Protocol Foundation", "license": "Apache-2.0", diff --git a/src/@types/OceanNode.ts b/src/@types/OceanNode.ts index 6717de5c6..2270ba775 100644 --- a/src/@types/OceanNode.ts +++ b/src/@types/OceanNode.ts @@ -138,6 +138,7 @@ export interface OceanNodeConfig { unsafeURLs?: string[] isBootstrap?: boolean validateUnsignedDDO?: boolean + skipFeeTokenValidation?: boolean jwtSecret?: string httpCertPath?: string httpKeyPath?: string diff --git a/src/index.ts b/src/index.ts index 8f0b02ee8..e8c740875 100644 --- a/src/index.ts +++ b/src/index.ts @@ -103,11 +103,15 @@ if (!hasValidDBConfiguration(config.dbConfig)) { // KeyManager will determine provider type from config.keys.type and initialize in constructor const keyManager = new KeyManager(config) const blockchainRegistry = new BlockchainRegistry(keyManager, config) -try { - await assertFeeTokensSupportedByOec(config, blockchainRegistry) -} catch (error) { - OCEAN_NODE_LOGGER.error(error instanceof Error ? error.message : String(error)) - process.exit(1) +if (config.skipFeeTokenValidation) { + OCEAN_NODE_LOGGER.warn('Skipping FEE_TOKENS validation against OEC contracts') +} else { + try { + await assertFeeTokensSupportedByOec(config, blockchainRegistry) + } catch (error) { + OCEAN_NODE_LOGGER.error(error instanceof Error ? error.message : String(error)) + process.exit(1) + } } if (config.hasP2P) { diff --git a/src/test/.env.test b/src/test/.env.test index e00a09e78..b322075a3 100644 --- a/src/test/.env.test +++ b/src/test/.env.test @@ -16,3 +16,4 @@ SECRET_ACCESS_KEY_S3=x87PklXIyyboglsDoZdOGt7YNvPWMpIjO3lOszv43sI ADDRESS_FILE=${HOME}/.ocean/ocean-contracts/artifacts/address.json LOG_LEVEL=debug DB_TYPE=elasticsearch +SKIP_FEE_TOKEN_VALIDATION=true diff --git a/src/test/.env.test2 b/src/test/.env.test2 index 8f16fafb8..69298f843 100644 --- a/src/test/.env.test2 +++ b/src/test/.env.test2 @@ -1,2 +1,3 @@ PRIVATE_KEY='0xc594c6e5def4bab63ac29eed19a134c130388f74f019bc74b8f4389df2837a58' CONFIG_PATH="$HOME/config.json" +SKIP_FEE_TOKEN_VALIDATION=true diff --git a/src/utils/config/constants.ts b/src/utils/config/constants.ts index f43d878d6..1f67bead6 100644 --- a/src/utils/config/constants.ts +++ b/src/utils/config/constants.ts @@ -7,6 +7,7 @@ export const ENV_TO_CONFIG_MAPPING = { DB_TYPE: 'DB_TYPE', FEE_AMOUNT: 'FEE_AMOUNT', FEE_TOKENS: 'FEE_TOKENS', + SKIP_FEE_TOKEN_VALIDATION: 'skipFeeTokenValidation', HTTP_API_PORT: 'httpPort', RPCS: 'supportedNetworks', IPFS_GATEWAY: 'ipfsGateway', diff --git a/src/utils/config/schemas.ts b/src/utils/config/schemas.ts index b5422c1c8..c0d97acf5 100644 --- a/src/utils/config/schemas.ts +++ b/src/utils/config/schemas.ts @@ -428,6 +428,7 @@ export const OceanNodeConfigSchema = z FEE_AMOUNT: z.string().optional(), FEE_TOKENS: z.string().optional(), feeStrategy: FeeStrategySchema.optional(), + skipFeeTokenValidation: booleanFromString.optional().default(false), httpPort: z.coerce.number().optional().default(3000), rateLimit: z.coerce.number().optional().default(DEFAULT_RATE_LIMIT_PER_MINUTE), diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 7150e37b0..10b2407c6 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -251,6 +251,11 @@ export const ENVIRONMENT_VARIABLES: Record = { }, FEE_TOKENS: { name: 'FEE_TOKENS', value: process.env.FEE_TOKENS, required: false }, FEE_AMOUNT: { name: 'FEE_AMOUNT', value: process.env.FEE_AMOUNT, required: false }, + SKIP_FEE_TOKEN_VALIDATION: { + name: 'SKIP_FEE_TOKEN_VALIDATION', + value: process.env.SKIP_FEE_TOKEN_VALIDATION, + required: false + }, ADDRESS_FILE: { name: 'ADDRESS_FILE', value: process.env.ADDRESS_FILE,