From bcbeecd99e5bf00c6480010dadd08be434e005df Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 22 Oct 2025 12:22:20 +0200 Subject: [PATCH 1/5] Add fix for missing error --- src/commands/protocols/publish/publish-finalization-command.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commands/protocols/publish/publish-finalization-command.js b/src/commands/protocols/publish/publish-finalization-command.js index d9146a2f0..d9cc83f9b 100644 --- a/src/commands/protocols/publish/publish-finalization-command.js +++ b/src/commands/protocols/publish/publish-finalization-command.js @@ -209,6 +209,8 @@ class PublishFinalizationCommand extends Command { operationId, blockchain, ); + + throw new Error(errorMessage); } } catch (e) { this.logger.error(`Command error (${this.errorType}): ${e.message}`); From 7a2e17e9b580544a6f22f456f41a17a4953d0f75 Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 22 Oct 2025 12:30:54 +0200 Subject: [PATCH 2/5] Update auto-updater, comments & docs --- .../auto-updater/implementation/ot-auto-updater.js | 14 +++++++------- .../implementation/ot-blazegraph/ot-blazegraph.js | 2 +- .../implementation/ot-graphdb/ot-graphdb.js | 2 +- tools/local-network-setup/README.md | 10 +++++----- v8-data-migration/triple-store-utils.js | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/modules/auto-updater/implementation/ot-auto-updater.js b/src/modules/auto-updater/implementation/ot-auto-updater.js index e272597d7..fa3c158ac 100644 --- a/src/modules/auto-updater/implementation/ot-auto-updater.js +++ b/src/modules/auto-updater/implementation/ot-auto-updater.js @@ -7,8 +7,8 @@ import semver from 'semver'; import axios from 'axios'; import unzipper from 'unzipper'; -const REPOSITORY_URL = 'https://github.com/OriginTrail/ot-node'; -const ARCHIVE_REPOSITORY_URL = 'github.com/OriginTrail/ot-node/archive/'; +const REPOSITORY_URL = 'https://github.com/OriginTrail/dkg-engine'; +const ARCHIVE_REPOSITORY_URL = 'github.com/OriginTrail/dkg-engine/archive/'; class OTAutoUpdater { async initialize(config, logger) { @@ -50,7 +50,7 @@ class OTAutoUpdater { async update() { try { - this.logger.debug(`AutoUpdater - Updating ot-node from ${REPOSITORY_URL}`); + this.logger.debug(`AutoUpdater - Updating dkg-engine from ${REPOSITORY_URL}`); const currentDirectory = appRootPath.path; const rootPath = path.join(currentDirectory, '..'); @@ -173,7 +173,7 @@ class OTAutoUpdater { downloadUpdate(destination) { return new Promise((resolve, reject) => { const url = `https://${path.join(ARCHIVE_REPOSITORY_URL, this.config.branch)}.zip`; - this.logger.debug(`AutoUpdater - Downloading ot-node .zip file from url: ${url}`); + this.logger.debug(`AutoUpdater - Downloading dkg-engine .zip file from url: ${url}`); axios({ method: 'get', url, responseType: 'stream' }) .then((response) => { const fileStream = fs.createWriteStream(destination); @@ -191,7 +191,7 @@ class OTAutoUpdater { .catch((error) => { reject( Error( - `AutoUpdater - Unable to download new version of ot-node. Error: ${error.message}`, + `AutoUpdater - Unable to download new version of dkg-engine. Error: ${error.message}`, ), ); }); @@ -199,7 +199,7 @@ class OTAutoUpdater { } unzipFile(destination, source) { - this.logger.debug(`AutoUpdater - Unzipping ot-node new version archive`); + this.logger.debug(`AutoUpdater - Unzipping dkg-engine new version archive`); return new Promise((resolve, reject) => { const fileReadStream = fs .createReadStream(source) @@ -220,7 +220,7 @@ class OTAutoUpdater { const destinationDirFiles = await fs.readdir(extractedDataPath); if (destinationDirFiles.length !== 1) { await fs.remove(extractedDataPath); - throw Error('Extracted archive for new ot-node version is not valid'); + throw Error('Extracted archive for new dkg-engine version is not valid'); } const sourcePath = path.join(extractedDataPath, destinationDirFiles[0]); await fs.remove(destinationPath); diff --git a/src/modules/triple-store/implementation/ot-blazegraph/ot-blazegraph.js b/src/modules/triple-store/implementation/ot-blazegraph/ot-blazegraph.js index 42764bb6d..16a4d9af3 100644 --- a/src/modules/triple-store/implementation/ot-blazegraph/ot-blazegraph.js +++ b/src/modules/triple-store/implementation/ot-blazegraph/ot-blazegraph.js @@ -220,7 +220,7 @@ class OtBlazegraph extends OtTripleStore { } catch (error) { if (error.response && error.response.status === 404) { // Expected error: GraphDB is up but has not created node0 repository - // Ot-node will create repo in initialization + // dkg-engine will create repo in initialization return false; } this.logger.error( diff --git a/src/modules/triple-store/implementation/ot-graphdb/ot-graphdb.js b/src/modules/triple-store/implementation/ot-graphdb/ot-graphdb.js index c963d43a2..d27c652f1 100644 --- a/src/modules/triple-store/implementation/ot-graphdb/ot-graphdb.js +++ b/src/modules/triple-store/implementation/ot-graphdb/ot-graphdb.js @@ -83,7 +83,7 @@ class OtGraphdb extends OtTripleStore { } catch (e) { if (e.response && e.response.status === 404) { // Expected error: GraphDB is up but has not created node0 repository - // Ot-node will create repo in initialization + // dkg-engine will create repo in initialization return true; } return false; diff --git a/tools/local-network-setup/README.md b/tools/local-network-setup/README.md index 74736f6f9..e2c9fa1ad 100644 --- a/tools/local-network-setup/README.md +++ b/tools/local-network-setup/README.md @@ -14,20 +14,20 @@ This tool will help you set up a local DKG V8 network running with the Hardhat b # Setup instructions -In order to run the local network you fist need to clone the "ot-node" repository. +In order to run the local network you fist need to clone the "dkg-engine" repository.
-## 1. CLONE OT-NODE REPOSITORY & INSTALL DEPENDENCIES +## 1. CLONE DKG-ENGINE REPOSITORY & INSTALL DEPENDENCIES -After cloning the **ot-node** repository, please checkout to "v8/develop" branch and install dependencies by running: +After cloning the **dkg-engine** repository, please checkout to "v8/develop" branch and install dependencies by running: ```bash -git clone https://github.com/OriginTrail/ot-node.git && cd ot-node/ && npm install && cd .. +git clone https://github.com/OriginTrail/dkg-engine.git && cd dkg-engine/ && npm install && cd .. ```
-### 2.2 Create the .env file inside the "ot-node" directory: +### 2.2 Create the .env file inside the "dkg-engine" directory: ```bash nano .env diff --git a/v8-data-migration/triple-store-utils.js b/v8-data-migration/triple-store-utils.js index 14aa81294..ac004dd54 100644 --- a/v8-data-migration/triple-store-utils.js +++ b/v8-data-migration/triple-store-utils.js @@ -202,7 +202,7 @@ export async function healthCheck(tripleStoreRepositories, repository, tripleSto } catch (e) { if (e.response && e.response.status === 404) { // Expected error: GraphDB is up but has not created node0 repository - // Ot-node will create repo in initialization + // dkg-engine will create repo in initialization return true; } logger.error(`Health check failed for repository ${repository}:`, e); From 9a00874b13e11f8b49050c65a021d63fbb7ca5de Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 22 Oct 2025 12:32:27 +0200 Subject: [PATCH 3/5] version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d073acf15..daa44cfd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "8.1.1-rc.11", + "version": "8.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "8.1.1-rc.11", + "version": "8.2.1", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^4.0.2", diff --git a/package.json b/package.json index ec26e3aa6..67605721f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "8.1.1-rc.12", + "version": "8.2.1", "description": "OTNode V8", "main": "index.js", "type": "module", From a898e92652c6d40248c29f9311308c9ca803fed9 Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 22 Oct 2025 14:05:08 +0200 Subject: [PATCH 4/5] Fix missing error --- .../publish/publish-finalization-command.js | 43 ++++++++----------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/src/commands/protocols/publish/publish-finalization-command.js b/src/commands/protocols/publish/publish-finalization-command.js index d9cc83f9b..45f7ff99b 100644 --- a/src/commands/protocols/publish/publish-finalization-command.js +++ b/src/commands/protocols/publish/publish-finalization-command.js @@ -182,45 +182,36 @@ class PublishFinalizationCommand extends Command { assertion, ual, ) { - try { - if (merkleRoot !== cachedMerkleRoot) { - const errorMessage = `Invalid Merkle Root for Knowledge Collection: ${ual}. Received value from blockchain: ${merkleRoot}, Cached value from publish operation: ${cachedMerkleRoot}`; - - this.logger.error(`Command error (${this.errorType}): ${errorMessage}`); + if (merkleRoot !== cachedMerkleRoot) { + const errorMessage = `Invalid Merkle Root for Knowledge Collection: ${ual}. Received value from blockchain: ${merkleRoot}, Cached value from publish operation: ${cachedMerkleRoot}`; - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.FAILED, - operationId, - blockchain, - ); - } + this.logger.error(`Command error (${this.errorType}): ${errorMessage}`); - const calculatedAssertionSize = this.dataService.calculateAssertionSize( - assertion.public ?? assertion, + this.operationIdService.emitChangeEvent( + OPERATION_ID_STATUS.FAILED, + operationId, + blockchain, ); - if (byteSize.toString() !== calculatedAssertionSize.toString()) { - const errorMessage = `Invalid Assertion Size for Knowledge Collection: ${ual}. Received value from blockchain: ${byteSize}, Calculated value: ${calculatedAssertionSize}`; + throw new Error(errorMessage); + } - this.logger.error(`Command error (${this.errorType}): ${errorMessage}`); + const calculatedAssertionSize = this.dataService.calculateAssertionSize( + assertion.public ?? assertion, + ); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.FAILED, - operationId, - blockchain, - ); + if (byteSize.toString() !== calculatedAssertionSize.toString()) { + const errorMessage = `Invalid Assertion Size for Knowledge Collection: ${ual}. Received value from blockchain: ${byteSize}, Calculated value: ${calculatedAssertionSize}`; - throw new Error(errorMessage); - } - } catch (e) { - this.logger.error(`Command error (${this.errorType}): ${e.message}`); + this.logger.error(`Command error (${this.errorType}): ${errorMessage}`); this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.FAILED, operationId, blockchain, ); - throw e; + + throw new Error(errorMessage); } } From 1b688d14a3c6564eb064c3cff3b81b6f29d3a9ac Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 22 Oct 2025 14:08:54 +0200 Subject: [PATCH 5/5] remove duplicate error handling --- .../publish/publish-finalization-command.js | 36 ++----------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/src/commands/protocols/publish/publish-finalization-command.js b/src/commands/protocols/publish/publish-finalization-command.js index 45f7ff99b..b314b5c53 100644 --- a/src/commands/protocols/publish/publish-finalization-command.js +++ b/src/commands/protocols/publish/publish-finalization-command.js @@ -84,15 +84,7 @@ class PublishFinalizationCommand extends Command { const ual = this.ualService.deriveUAL(blockchain, contractAddress, id); try { - await this.validatePublishData( - operationId, - blockchain, - merkleRoot, - cachedMerkleRoot, - byteSize, - assertion, - ual, - ); + await this.validatePublishData(merkleRoot, cachedMerkleRoot, byteSize, assertion, ual); } catch (e) { this.logger.error(`Failed to validate publish data: ${e.message}`); this.operationIdService.emitChangeEvent( @@ -173,26 +165,10 @@ class PublishFinalizationCommand extends Command { return Command.empty(); } - async validatePublishData( - operationId, - blockchain, - merkleRoot, - cachedMerkleRoot, - byteSize, - assertion, - ual, - ) { + async validatePublishData(merkleRoot, cachedMerkleRoot, byteSize, assertion, ual) { if (merkleRoot !== cachedMerkleRoot) { const errorMessage = `Invalid Merkle Root for Knowledge Collection: ${ual}. Received value from blockchain: ${merkleRoot}, Cached value from publish operation: ${cachedMerkleRoot}`; - this.logger.error(`Command error (${this.errorType}): ${errorMessage}`); - - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.FAILED, - operationId, - blockchain, - ); - throw new Error(errorMessage); } @@ -203,14 +179,6 @@ class PublishFinalizationCommand extends Command { if (byteSize.toString() !== calculatedAssertionSize.toString()) { const errorMessage = `Invalid Assertion Size for Knowledge Collection: ${ual}. Received value from blockchain: ${byteSize}, Calculated value: ${calculatedAssertionSize}`; - this.logger.error(`Command error (${this.errorType}): ${errorMessage}`); - - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.FAILED, - operationId, - blockchain, - ); - throw new Error(errorMessage); } }