diff --git a/config/config.json b/config/config.json index 64d5fb3f0..c67531e2a 100644 --- a/config/config.json +++ b/config/config.json @@ -637,7 +637,7 @@ "enabled": false, "package": "./blockchain/implementation/ot-parachain/ot-parachain-service.js", "config": { - "hubContractAddress": "0x833048F6e6BEa78E0AAdedeCd2Dc2231dda443FB", + "hubContractAddress": "0x0425d8717a9c63345a26C7885CF8c0fEAbcE7bC9", "rpcEndpoints": [ "https://lofar-tm-rpc.origin-trail.network", "https://lofar.origintrail.network" diff --git a/installer/data/template/.origintrail_noderc_one_click_mainnet.json b/installer/data/template/.origintrail_noderc_one_click_mainnet.json index 8cc582b03..1745c32af 100644 --- a/installer/data/template/.origintrail_noderc_one_click_mainnet.json +++ b/installer/data/template/.origintrail_noderc_one_click_mainnet.json @@ -1,17 +1,30 @@ { "modules":{ + "network": { + "implementation": { + "libp2p-service": { + "config": { + "nat": { + "enabled": true, + "externalIp": "" + } + } + } + } + }, "blockchain":{ "implementation":{ "otp:2043":{ "enabled":true, "config":{ - "sharesTokenSymbol":"", - "sharesTokenName":"", - "evmManagementWalletPublicKey":"", + "sharesTokenName":"", + "sharesTokenSymbol":"", + "operatorFee":"", + "evmManagementWalletPublicKey":"", "operationalWallets":[ { - "evmAddress":"", - "privateKey":"" + "evmAddress":"", + "privateKey":"" } ] } @@ -19,20 +32,38 @@ "gnosis:100":{ "enabled":true, "config":{ - "operatorFee": , - "sharesTokenSymbol":"", - "sharesTokenName":"", + "sharesTokenName":"", + "sharesTokenSymbol":"", + "operatorFee":"", "rpcEndpoints":[ "" ], - "evmManagementWalletPublicKey":"", + "evmManagementWalletPublicKey":"", "operationalWallets":[ { - "evmAddress":"", - "privateKey":"" + "evmAddress":"", + "privateKey":"" } ] } + }, + "base:8453":{ + "enabled":true, + "config":{ + "evmManagementWalletPublicKey":"", + "operationalWallets":[ + { + "evmAddress":"", + "privateKey":"" + } + ], + "sharesTokenName":"", + "sharesTokenSymbol":"", + "operatorFee":"", + "rpcEndpoints":[ + "" + ] + } } } }, diff --git a/installer/data/template/.origintrail_noderc_one_click_testnet.json b/installer/data/template/.origintrail_noderc_one_click_testnet.json index b2f1bc855..d1abfdc4d 100644 --- a/installer/data/template/.origintrail_noderc_one_click_testnet.json +++ b/installer/data/template/.origintrail_noderc_one_click_testnet.json @@ -1,17 +1,30 @@ { "modules":{ + "network": { + "implementation": { + "libp2p-service": { + "config": { + "nat": { + "enabled": true, + "externalIp": "" + } + } + } + } + }, "blockchain":{ "implementation":{ "otp:20430":{ "enabled":true, "config":{ - "sharesTokenSymbol":"", - "sharesTokenName":"", - "evmManagementWalletPublicKey":"", + "sharesTokenName":"", + "sharesTokenSymbol":"", + "operatorFee":"", + "evmManagementWalletPublicKey":"", "operationalWallets":[ { - "evmAddress":"", - "privateKey":"" + "evmAddress":"", + "privateKey":"" } ] } @@ -19,20 +32,38 @@ "gnosis:10200":{ "enabled":true, "config":{ - "operatorFee": , - "sharesTokenSymbol":"", - "sharesTokenName":"", + "sharesTokenName":"", + "sharesTokenSymbol":"", + "operatorFee":"", "rpcEndpoints":[ "" ], - "evmManagementWalletPublicKey":"", + "evmManagementWalletPublicKey":"", "operationalWallets":[ { - "evmAddress":"", - "privateKey":"" + "evmAddress":"", + "privateKey":"" } ] } + }, + "base:84532":{ + "enabled":true, + "config":{ + "evmManagementWalletPublicKey":"", + "operationalWallets":[ + { + "evmAddress":"", + "privateKey":"" + } + ], + "sharesTokenName":"", + "sharesTokenSymbol":"", + "operatorFee":"", + "rpcEndpoints":[ + "" + ] + } } } }, diff --git a/ot-node.js b/ot-node.js index 4ce41e5af..30bc23bb6 100644 --- a/ot-node.js +++ b/ot-node.js @@ -78,6 +78,12 @@ class OTNode { this.config, ); + await MigrationExecutor.executeServiceAgreementPruningMigration( + this.container, + this.logger, + this.config, + ); + await this.initializeRouters(); await this.startNetworkModule(); this.startTelemetryModule(); diff --git a/package-lock.json b/package-lock.json index bc8afa769..4e48f8bd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.5.1", + "version": "6.5.1+hotfix.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.5.1", + "version": "6.5.1+hotfix.2", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", diff --git a/package.json b/package.json index e7f54dafa..4b5d7d5a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.5.1", + "version": "6.5.1+hotfix.2", "description": "OTNode V6", "main": "index.js", "type": "module", diff --git a/src/constants/constants.js b/src/constants/constants.js index e06bf467a..7c43e15e3 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -231,8 +231,11 @@ export const COMMAND_TX_GAS_INCREASE_FACTORS = { }; export const CONTRACT_FUNCTION_GAS_LIMIT_INCREASE_FACTORS = { - 'submitUpdateCommit((address,uint256,bytes,uint8,uint16,uint72,uint72,uint72))': 1.2, - 'submitUpdateCommit((address,uint256,bytes,uint8,uint16))': 1.2, + sendProof: 2, + 'submitCommit((address,uint256,bytes,uint8,uint16))': 2, + 'submitCommit((address,uint256,bytes,uint8,uint16,uint72,uint72,uint72))': 2, + 'submitUpdateCommit((address,uint256,bytes,uint8,uint16,uint72,uint72,uint72))': 2, + 'submitUpdateCommit((address,uint256,bytes,uint8,uint16))': 2, }; export const GNOSIS_DEFAULT_GAS_PRICE = { diff --git a/src/migration/devnet-neuro-pruning-migration.js b/src/migration/devnet-neuro-pruning-migration.js new file mode 100644 index 000000000..1fb9d6ca2 --- /dev/null +++ b/src/migration/devnet-neuro-pruning-migration.js @@ -0,0 +1,34 @@ +import BaseMigration from './base-migration.js'; +import { NODE_ENVIRONMENTS } from '../constants/constants.js'; + +class DevnetNeuroPruningMigration extends BaseMigration { + constructor(migrationName, logger, config, repositoryModuleManager) { + super(migrationName, logger, config); + this.repositoryModuleManager = repositoryModuleManager; + } + + async executeMigration() { + if (process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVNET) { + this.logger.info('Pruning Neuro devenet tables'); + // commands are not here as parsing JSON in SQL would take too much time + const tables = [ + 'blockchain', + 'blockchain_event', + 'event', + 'missed_paranet_asset', + 'paranet', + 'service_agreement', + 'shard', + ]; + for (const table of tables) { + const query = ` + DELETE FROM ${table} + WHERE blockchain_id = 'otp:2160'`; + // eslint-disable-next-line no-await-in-loop + await this.repositoryModuleManager.query(query); + } + } + } +} + +export default DevnetNeuroPruningMigration; diff --git a/src/migration/migration-executor.js b/src/migration/migration-executor.js index 77469b986..8e26b5c9a 100644 --- a/src/migration/migration-executor.js +++ b/src/migration/migration-executor.js @@ -20,6 +20,7 @@ import MultipleOpWalletsUserConfigurationMigration from './multiple-op-wallets-u import GetOldServiceAgreementsMigration from './get-old-service-agreements-migration.js'; import ServiceAgreementPruningMigration from './service-agreement-pruning-migration.js'; import RemoveDuplicateServiceAgreementMigration from './remove-duplicate-service-agreement-migration.js'; +import DevnetNeuroPruningMigration from './devnet-neuro-pruning-migration.js'; class MigrationExecutor { static async executePullShardingTableMigration(container, logger, config) { @@ -502,6 +503,32 @@ class MigrationExecutor { } } + static async executeDevnetNeuroPruningMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const repositoryModuleManager = container.resolve('repositoryModuleManager'); + + const migration = new DevnetNeuroPruningMigration( + 'devnetNeuroPruningMigration', + logger, + config, + repositoryModuleManager, + ); + if (!(await migration.migrationAlreadyExecuted())) { + try { + await migration.migrate(); + } catch (error) { + logger.error( + `Unable to execute devnet neuro pruning migration. Error: ${error.message}`, + ); + } + } + } + static exitNode(code = 0) { process.exit(code); } diff --git a/src/modules/blockchain/implementation/ot-parachain/ot-parachain-service.js b/src/modules/blockchain/implementation/ot-parachain/ot-parachain-service.js index 7ba9c69b4..9f4e15e51 100644 --- a/src/modules/blockchain/implementation/ot-parachain/ot-parachain-service.js +++ b/src/modules/blockchain/implementation/ot-parachain/ot-parachain-service.js @@ -22,7 +22,7 @@ class OtParachainService extends Web3Service { this.logger = logger; this.rpcNumber = 0; await this.initializeParachainProvider(); - await this.checkEvmWallets(); + // await this.checkEvmWallets(); await this.parachainProvider.disconnect(); await super.initialize(config, logger); }