Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config/config.devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ features:
serviceUrl: 'https://devnet-data-api.multiversx.com'
assetsFetch:
enabled: true
assetesUrl: 'https://tools.multiversx.com/assets-cdn'
assetsUrl: 'https://tools.multiversx.com/assets-cdn'
auth:
enabled: false
maxExpirySeconds: 86400
Expand Down Expand Up @@ -105,13 +105,13 @@ features:
enabled: false
maxLookBehindNonces: 100
nodesFetch:
enabled: true
enabled: false
serviceUrl: 'https://devnet-api.multiversx.com'
tokensFetch:
enabled: true
enabled: false
serviceUrl: 'https://devnet-api.multiversx.com'
providersFetch:
enabled: true
enabled: false
serviceUrl: 'https://devnet-api.multiversx.com'
image:
width: 600
Expand Down
2 changes: 1 addition & 1 deletion config/config.e2e.mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ features:
serviceUrl: 'https://api.multiversx.com'
assetsFetch:
enabled: false
assetesUrl: 'https://tools.multiversx.com/assets-cdn'
assetsUrl: 'https://tools.multiversx.com/assets-cdn'
image:
width: 600
height: 600
Expand Down
8 changes: 4 additions & 4 deletions config/config.mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ features:
enabled: false
maxLookBehindNonces: 100
nodesFetch:
enabled: true
enabled: false
serviceUrl: 'https://api.multiversx.com'
tokensFetch:
enabled: true
enabled: false
serviceUrl: 'https://api.multiversx.com'
providersFetch:
enabled: true
enabled: false
serviceUrl: 'https://api.multiversx.com'
assetsFetch:
enabled: true
assetesUrl: 'https://tools.multiversx.com/assets-cdn'
assetsUrl: 'https://tools.multiversx.com/assets-cdn'
image:
width: 600
height: 600
Expand Down
8 changes: 4 additions & 4 deletions config/config.testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ features:
enabled: false
maxLookBehindNonces: 100
nodesFetch:
enabled: true
enabled: false
serviceUrl: 'https://testnet-api.multiversx.com'
tokensFetch:
enabled: true
enabled: false
serviceUrl: 'https://testnet-api.multiversx.com'
providersFetch:
enabled: true
enabled: false
serviceUrl: 'https://testnet-api.multiversx.com'
assetsFetch:
enabled: true
assetesUrl: 'https://tools.multiversx.com/assets-cdn'
assetsUrl: 'https://tools.multiversx.com/assets-cdn'
image:
width: 600
height: 600
Expand Down
4 changes: 3 additions & 1 deletion src/common/api-config/api.config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,9 @@ export class ApiConfigService {
}

getAssetsCdnUrl(): string {
return this.configService.get<string>('features.assetsFetch.assetesUrl') ?? 'https://tools.multiversx.com/assets-cdn';
return this.configService.get<string>('features.assetsFetch.assetsUrl')
?? this.configService.get<string>('features.assetsFetch.assetesUrl') // todo: remove this in the future
?? 'https://tools.multiversx.com/assets-cdn';
}

isTokensFetchFeatureEnabled(): boolean {
Expand Down
68 changes: 67 additions & 1 deletion src/endpoints/network/entities/feature.configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,81 @@ export class FeatureConfigs {
Object.assign(this, init);
}

@ApiProperty({ description: 'Events notifier flag activation value' })
eventsNotifier: boolean = false;

@ApiProperty({ description: 'Guest caching flag activation value' })
guestCaching: boolean = false;

@ApiProperty({ description: 'Transaction pool flag activation value' })
transactionPool: boolean = false;

@ApiProperty({ description: 'Transaction pool warmer flag activation value' })
transactionPoolWarmer: boolean = false;

@ApiProperty({ description: 'Update Collection extra details flag activation value' })
updateCollectionExtraDetails: boolean = false;

@ApiProperty({ description: 'Accounts extra details update flag activation value' })
updateAccountsExtraDetails: boolean = false;

@ApiProperty({ description: 'Marketplace flag activation value' })
marketplace: boolean = false;

@ApiProperty({ description: 'Exchange flag activation value' })
exchange: boolean = false;

@ApiProperty({ description: 'DataApi flag activation value' })
@ApiProperty({ description: 'Data API flag activation value' })
dataApi: boolean = false;

@ApiProperty({ description: 'Authentication flag activation value' })
auth: boolean = false;

@ApiProperty({ description: 'Staking V4 flag activation value' })
stakingV4: boolean = false;

@ApiProperty({ description: 'Chain Andromeda flag activation value' })
chainAndromeda: boolean = false;

@ApiProperty({ description: 'Node epochs left flag activation value' })
nodeEpochsLeft: boolean = false;

@ApiProperty({ description: 'Transaction processor flag activation value' })
transactionProcessor: boolean = false;

@ApiProperty({ description: 'Transaction completed flag activation value' })
transactionCompleted: boolean = false;

@ApiProperty({ description: 'Transaction batch flag activation value' })
transactionBatch: boolean = false;

@ApiProperty({ description: 'Deep history flag activation value' })
deepHistory: boolean = false;

@ApiProperty({ description: 'Elastic circuit breaker flag activation value' })
elasticCircuitBreaker: boolean = false;

@ApiProperty({ description: 'Status checker flag activation value' })
statusChecker: boolean = false;

@ApiProperty({ description: 'NFT scam info flag activation value' })
nftScamInfo: boolean = false;

@ApiProperty({ description: 'NFT processing flag activation value' })
processNfts: boolean = false;

@ApiProperty({ description: 'TPS flag activation value' })
tps: boolean = false;

@ApiProperty({ description: 'Nodes fetch flag activation value' })
nodesFetch: boolean = false;

@ApiProperty({ description: 'Tokens fetch flag activation value' })
tokensFetch: boolean = false;

@ApiProperty({ description: 'Providers fetch flag activation value' })
providersFetch: boolean = false;

@ApiProperty({ description: 'Assets fetch flag activation value' })
assetsFetch: boolean = false;
}
22 changes: 22 additions & 0 deletions src/endpoints/network/network.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,32 @@ export class NetworkService {
}

const features = new FeatureConfigs({
eventsNotifier: this.apiConfigService.isEventsNotifierFeatureActive(),
guestCaching: this.apiConfigService.isGuestCacheFeatureActive(),
transactionPool: this.apiConfigService.isTransactionPoolEnabled(),
transactionPoolWarmer: this.apiConfigService.getIsCacheWarmerCronActive(),
updateCollectionExtraDetails: this.apiConfigService.isUpdateCollectionExtraDetailsEnabled(),
updateAccountsExtraDetails: this.apiConfigService.isUpdateAccountExtraDetailsEnabled(),
marketplace: this.apiConfigService.isMarketplaceFeatureEnabled(),
exchange: this.apiConfigService.isExchangeEnabled(),
dataApi: this.apiConfigService.isDataApiFeatureEnabled(),
auth: this.apiConfigService.getIsAuthActive(),
stakingV4: this.apiConfigService.isStakingV4Enabled(),
chainAndromeda: this.apiConfigService.isChainAndromedaEnabled(),
nodeEpochsLeft: this.apiConfigService.isNodeEpochsLeftEnabled(),
transactionProcessor: this.apiConfigService.getIsTransactionProcessorCronActive(),
transactionCompleted: this.apiConfigService.getIsTransactionCompletedCronActive(),
transactionBatch: this.apiConfigService.getIsTransactionBatchCronActive(),
deepHistory: this.apiConfigService.isDeepHistoryGatewayEnabled(),
elasticCircuitBreaker: this.apiConfigService.isElasticCircuitBreakerEnabled(),
statusChecker: this.apiConfigService.getIsApiStatusCheckerActive(),
nftScamInfo: this.apiConfigService.getIsNftScamInfoEnabled(),
processNfts: this.apiConfigService.getIsProcessNftsFlagActive(),
tps: this.apiConfigService.isTpsEnabled(),
nodesFetch: this.apiConfigService.isNodesFetchFeatureEnabled(),
tokensFetch: this.apiConfigService.isTokensFetchFeatureEnabled(),
providersFetch: this.apiConfigService.isProvidersFetchFeatureEnabled(),
assetsFetch: this.apiConfigService.isAssetsCdnFeatureEnabled(),
});

let indexerVersion: string | undefined;
Expand Down
7 changes: 5 additions & 2 deletions src/test/unit/controllers/network.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import request = require('supertest');
import { Economics } from "src/endpoints/network/entities/economics";
import { Stats } from "src/endpoints/network/entities/stats";
import { About } from "src/endpoints/network/entities/about";
import { FeatureConfigs } from "../../../endpoints/network/entities/feature.configs";

describe("NetworkController", () => {
let app: INestApplication;
Expand Down Expand Up @@ -102,12 +103,14 @@ describe("NetworkController", () => {
indexerVersion: "v1.4.19",
gatewayVersion: "v1.1.44-0-g5282fa5",
scamEngineVersion: "1.0.0",
features: {
features: new FeatureConfigs({
updateCollectionExtraDetails: true,
marketplace: true,
exchange: true,
dataApi: true,
},
tokensFetch: false,
providersFetch: true,
}),
};
networkServiceMocks.getAbout.mockResolvedValue(mockAbout);

Expand Down