diff --git a/installer/installer.sh b/installer/installer.sh index 3d0640db4f..e13e7485c7 100644 --- a/installer/installer.sh +++ b/installer/installer.sh @@ -372,11 +372,8 @@ install_node() { read -p "$(print_color $YELLOW "Enter your EVM management wallet address : ")" EVM_MANAGEMENT_WALLET print_color $GREEN "✅ EVM management wallet address : $EVM_MANAGEMENT_WALLET" - read -p "$(print_color $YELLOW "Enter your profile shares token name : ")" SHARES_TOKEN_NAME - print_color $GREEN "✅ Profile shares token name : $SHARES_TOKEN_NAME" - - read -p "$(print_color $YELLOW "Enter your profile shares token symbol : ")" SHARES_TOKEN_SYMBOL - print_color $GREEN "✅ Profile shares token symbol : $SHARES_TOKEN_SYMBOL" + read -p "$(print_color $YELLOW "Enter your profile node name : ")" NODE_NAME + print_color $GREEN "✅ Profile shares token name : $NODE_NAME" validate_operator_fees $blockchain @@ -389,8 +386,7 @@ install_node() { "config": { "operationalWallets": $EVM_OP_WALLET_KEYS, "evmManagementWalletPublicKey": "$EVM_MANAGEMENT_WALLET", - "sharesTokenName": "$SHARES_TOKEN_NAME", - "sharesTokenSymbol": "$SHARES_TOKEN_SYMBOL", + "nodeName": "$NODE_NAME", "operatorFee": $OPERATOR_FEE, "rpcEndpoints": ["$RPC_ENDPOINT"] } diff --git a/scripts/set-stake.js b/scripts/set-stake.js index cfc4a235d0..c1816b0b9a 100644 --- a/scripts/set-stake.js +++ b/scripts/set-stake.js @@ -100,7 +100,7 @@ async function setStake( TRANSACTION_POLLING_TIMEOUT_MILLIS, ); // TODO: Add ABI instead of hard-coded function definition - tx = await stakingContract['addStake(uint72,uint96)'](identityId, stakeWei, { + tx = await stakingContract['stake(uint72,uint96)'](identityId, stakeWei, { gasPrice: gasPrice ? gasPrice * 100 : undefined, gasLimit: 3_000_000, }); diff --git a/src/constants/constants.js b/src/constants/constants.js index 77aa55edc5..ac926f38f8 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -255,8 +255,8 @@ export const ABIs = { ParametersStorage: require('dkg-evm-module/abi/ParametersStorage.json'), Profile: require('dkg-evm-module/abi/Profile.json'), ProfileStorage: require('dkg-evm-module/abi/ProfileStorage.json'), - ShardingTable: require('dkg-evm-module/abi/ShardingTableV2.json'), - ShardingTableStorage: require('dkg-evm-module/abi/ShardingTableStorageV2.json'), + ShardingTable: require('dkg-evm-module/abi/ShardingTable.json'), + ShardingTableStorage: require('dkg-evm-module/abi/ShardingTableStorage.json'), ParanetsRegistry: require('dkg-evm-module/abi/ParanetsRegistry.json'), ParanetKnowledgeAssetsRegistry: require('dkg-evm-module/abi/ParanetKnowledgeAssetsRegistry.json'), }; diff --git a/src/modules/blockchain/blockchain-module-manager.js b/src/modules/blockchain/blockchain-module-manager.js index 044c5421d4..3b01274759 100644 --- a/src/modules/blockchain/blockchain-module-manager.js +++ b/src/modules/blockchain/blockchain-module-manager.js @@ -149,12 +149,12 @@ class BlockchainModuleManager extends BaseModuleManager { // ]); // } - async getKnowledgeCollectionPublisher( + async getLatestMerkleRootPublisher( blockchain, assetStorageContractAddress, knowledgeCollectionId, ) { - return this.callImplementationFunction(blockchain, 'getKnowledgeCollectionPublisher', [ + return this.callImplementationFunction(blockchain, 'getLatestMerkleRootPublisher', [ assetStorageContractAddress, knowledgeCollectionId, ]); diff --git a/src/modules/blockchain/implementation/web3-service.js b/src/modules/blockchain/implementation/web3-service.js index 164ceac577..4ab0d29e02 100644 --- a/src/modules/blockchain/implementation/web3-service.js +++ b/src/modules/blockchain/implementation/web3-service.js @@ -473,9 +473,9 @@ class Web3Service { } async createProfile(peerId) { - if (!this.config.sharesTokenName || !this.config.sharesTokenSymbol) { + if (!this.config.nodeName) { throw new Error( - 'Missing sharesTokenName and sharesTokenSymbol in blockchain configuration. Please add it and start the node again.', + 'Missing nodeName in blockchain configuration. Please add it and start the node again.', ); } @@ -492,18 +492,15 @@ class Web3Service { [ this.getManagementKey(), this.getPublicKeys().slice(1), + this.config.nodeName, ethers.utils.hexlify(ethers.utils.toUtf8Bytes(peerId)), - this.config.sharesTokenName, - this.config.sharesTokenSymbol, this.config.operatorFee, ], null, this.operationalWallets[0], ); this.logger.info( - `Profile created with name: ${this.config.sharesTokenName} and symbol: ${ - this.config.sharesTokenSymbol - }, wallet: ${ + `Profile created with name: ${this.config.nodeName}, wallet: ${ this.operationalWallets[0].address }, on blockchain ${this.getBlockchainId()}`, ); @@ -925,7 +922,7 @@ class Web3Service { // return this.callContractFunction(assetStorageContractInstance, 'ownerOf', [tokenId]); // } - async getKnowledgeCollectionPublisher(assetStorageContractAddress, knowledgeCollectionId) { + async getLatestMerkleRootPublisher(assetStorageContractAddress, knowledgeCollectionId) { const assetStorageContractInstance = this.assetStorageContracts[assetStorageContractAddress.toString().toLowerCase()]; if (!assetStorageContractInstance) diff --git a/src/service/validation-service.js b/src/service/validation-service.js index 286f483ca4..dc734ed7b6 100644 --- a/src/service/validation-service.js +++ b/src/service/validation-service.js @@ -15,7 +15,7 @@ class ValidationService { let isValid = true; try { - const result = await this.blockchainModuleManager.getKnowledgeCollectionPublisher( + const result = await this.blockchainModuleManager.getLatestMerkleRootPublisher( blockchain, contract, tokenId, diff --git a/test/bdd/steps/lib/local-blockchain.mjs b/test/bdd/steps/lib/local-blockchain.mjs index b686cec378..e51d591cff 100644 --- a/test/bdd/steps/lib/local-blockchain.mjs +++ b/test/bdd/steps/lib/local-blockchain.mjs @@ -5,9 +5,6 @@ import { readFile } from 'fs/promises'; import { exec, execSync } from 'child_process'; const Hub = JSON.parse((await readFile('node_modules/dkg-evm-module/abi/Hub.json')).toString()); -const HubController = JSON.parse( - (await readFile('node_modules/dkg-evm-module/abi/HubController.json')).toString(), -); const ParametersStorage = JSON.parse( (await readFile('node_modules/dkg-evm-module/abi/ParametersStorage.json')).toString(), ); @@ -79,22 +76,6 @@ class LocalBlockchain { this.hubContract = new ethers.Contract(hubContractAddress, Hub, wallet); await this.provider.ready; - const hubControllerAddress = await this.hubContract.owner(); - this.HubControllerContract = new ethers.Contract( - hubControllerAddress, - HubController, - wallet, - ); - - const parametersStorageAddress = await this.hubContract.getContractAddress( - 'ParametersStorage', - ); - this.ParametersStorageInterface = new ethers.utils.Interface(ParametersStorage); - - await this.setParametersStorageParams( - parametersStorageAddress, - testParametersStorageParams, - ); } async stop() { @@ -118,7 +99,7 @@ class LocalBlockchain { [params[parameter]], ); // eslint-disable-next-line no-await-in-loop - await this.HubControllerContract.forwardCall(parametersStorageAddress, encodedData); + await this.hubContract.forwardCall(parametersStorageAddress, encodedData); } } @@ -128,7 +109,7 @@ class LocalBlockchain { const parametersStorageAddress = await this.hubContract.getContractAddress( 'ParametersStorage', ); - await this.HubControllerContract.forwardCall(parametersStorageAddress, encodedData); + await this.hubContract.forwardCall(parametersStorageAddress, encodedData); } async setR1(r1) { @@ -137,7 +118,7 @@ class LocalBlockchain { const parametersStorageAddress = await this.hubContract.getContractAddress( 'ParametersStorage', ); - await this.HubControllerContract.forwardCall(parametersStorageAddress, encodedData); + await this.hubContract.forwardCall(parametersStorageAddress, encodedData); } async setFinalizationCommitsNumber(commitsNumber) { @@ -149,7 +130,7 @@ class LocalBlockchain { const parametersStorageAddress = await this.hubContract.getContractAddress( 'ParametersStorage', ); - await this.HubControllerContract.forwardCall(parametersStorageAddress, encodedData); + await this.hubContract.forwardCall(parametersStorageAddress, encodedData); } } diff --git a/tools/local-network-setup/generate-config-files.js b/tools/local-network-setup/generate-config-files.js index 1d9bf3cada..86abba9de3 100644 --- a/tools/local-network-setup/generate-config-files.js +++ b/tools/local-network-setup/generate-config-files.js @@ -122,8 +122,7 @@ function generateBlockchainConfig(templateBlockchainConfig, nodeIndex) { ], evmManagementWalletPublicKey: publicKeysManagementWallet[nodeIndex + 1], evmManagementWalletPrivateKey: privateKeysManagementWallet[nodeIndex + 1], - sharesTokenName: `LocalNode${nodeIndex + 1}`, - sharesTokenSymbol: `LN${nodeIndex + 1}`, + nodeName: `LocalNode${nodeIndex + 1}`, }; // TODO: Don't use string diff --git a/tools/local-network-setup/setup-linux-environment.sh b/tools/local-network-setup/setup-linux-environment.sh index 6aba854ee5..0726f59798 100755 --- a/tools/local-network-setup/setup-linux-environment.sh +++ b/tools/local-network-setup/setup-linux-environment.sh @@ -48,13 +48,13 @@ then echo ================================ echo ====== Starting hardhat1 ====== echo ================================ - sh -c "cd $pathToOtNode && node tools/local-network-setup/run-local-blockchain.js 8545 :v2" & + sh -c "cd $pathToOtNode && node tools/local-network-setup/run-local-blockchain.js 8545 " & echo Waiting for hardhat to start and contracts deployment echo ================================ echo ====== Starting hardhat 2 ====== echo ================================ - sh -c "cd $pathToOtNode && node tools/local-network-setup/run-local-blockchain.js 9545 :v2" & + sh -c "cd $pathToOtNode && node tools/local-network-setup/run-local-blockchain.js 9545 " & echo Waiting for hardhat to start and contracts deployment fi diff --git a/tools/local-network-setup/setup-macos-environment.sh b/tools/local-network-setup/setup-macos-environment.sh index b7f0dba41a..2238d3757e 100755 --- a/tools/local-network-setup/setup-macos-environment.sh +++ b/tools/local-network-setup/setup-macos-environment.sh @@ -51,7 +51,7 @@ then osascript -e "tell app \"Terminal\" do script \"cd $pathToOtNode - node tools/local-network-setup/run-local-blockchain.js 8545 :v2\" + node tools/local-network-setup/run-local-blockchain.js 8545 \" end tell" echo Waiting for hardhat to start and contracts deployment @@ -61,7 +61,7 @@ then osascript -e "tell app \"Terminal\" do script \"cd $pathToOtNode - node tools/local-network-setup/run-local-blockchain.js 9545 :v2\" + node tools/local-network-setup/run-local-blockchain.js 9545 \" end tell" echo Waiting for hardhat to start and contracts deployment fi