Skip to content

Commit e788a24

Browse files
Merge pull request #4057 from OriginTrail/v6/release/testnet
v8.2.1 Mainnet Prerelease
2 parents 1790959 + 6de4687 commit e788a24

File tree

8 files changed

+30
-69
lines changed

8 files changed

+30
-69
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "origintrail_node",
3-
"version": "8.2.0",
3+
"version": "8.2.1",
44
"description": "OTNode V8",
55
"main": "index.js",
66
"type": "module",

src/commands/protocols/publish/publish-finalization-command.js

Lines changed: 12 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,7 @@ class PublishFinalizationCommand extends Command {
8484
const ual = this.ualService.deriveUAL(blockchain, contractAddress, id);
8585

8686
try {
87-
await this.validatePublishData(
88-
operationId,
89-
blockchain,
90-
merkleRoot,
91-
cachedMerkleRoot,
92-
byteSize,
93-
assertion,
94-
ual,
95-
);
87+
await this.validatePublishData(merkleRoot, cachedMerkleRoot, byteSize, assertion, ual);
9688
} catch (e) {
9789
this.logger.error(`Failed to validate publish data: ${e.message}`);
9890
this.operationIdService.emitChangeEvent(
@@ -173,52 +165,21 @@ class PublishFinalizationCommand extends Command {
173165
return Command.empty();
174166
}
175167

176-
async validatePublishData(
177-
operationId,
178-
blockchain,
179-
merkleRoot,
180-
cachedMerkleRoot,
181-
byteSize,
182-
assertion,
183-
ual,
184-
) {
185-
try {
186-
if (merkleRoot !== cachedMerkleRoot) {
187-
const errorMessage = `Invalid Merkle Root for Knowledge Collection: ${ual}. Received value from blockchain: ${merkleRoot}, Cached value from publish operation: ${cachedMerkleRoot}`;
188-
189-
this.logger.error(`Command error (${this.errorType}): ${errorMessage}`);
190-
191-
this.operationIdService.emitChangeEvent(
192-
OPERATION_ID_STATUS.FAILED,
193-
operationId,
194-
blockchain,
195-
);
196-
}
197-
198-
const calculatedAssertionSize = this.dataService.calculateAssertionSize(
199-
assertion.public ?? assertion,
200-
);
168+
async validatePublishData(merkleRoot, cachedMerkleRoot, byteSize, assertion, ual) {
169+
if (merkleRoot !== cachedMerkleRoot) {
170+
const errorMessage = `Invalid Merkle Root for Knowledge Collection: ${ual}. Received value from blockchain: ${merkleRoot}, Cached value from publish operation: ${cachedMerkleRoot}`;
201171

202-
if (byteSize.toString() !== calculatedAssertionSize.toString()) {
203-
const errorMessage = `Invalid Assertion Size for Knowledge Collection: ${ual}. Received value from blockchain: ${byteSize}, Calculated value: ${calculatedAssertionSize}`;
172+
throw new Error(errorMessage);
173+
}
204174

205-
this.logger.error(`Command error (${this.errorType}): ${errorMessage}`);
175+
const calculatedAssertionSize = this.dataService.calculateAssertionSize(
176+
assertion.public ?? assertion,
177+
);
206178

207-
this.operationIdService.emitChangeEvent(
208-
OPERATION_ID_STATUS.FAILED,
209-
operationId,
210-
blockchain,
211-
);
212-
}
213-
} catch (e) {
214-
this.logger.error(`Command error (${this.errorType}): ${e.message}`);
179+
if (byteSize.toString() !== calculatedAssertionSize.toString()) {
180+
const errorMessage = `Invalid Assertion Size for Knowledge Collection: ${ual}. Received value from blockchain: ${byteSize}, Calculated value: ${calculatedAssertionSize}`;
215181

216-
this.operationIdService.emitChangeEvent(
217-
OPERATION_ID_STATUS.FAILED,
218-
operationId,
219-
blockchain,
220-
);
221-
throw e;
182+
throw new Error(errorMessage);
222183
}
223184
}
224185

src/modules/auto-updater/implementation/ot-auto-updater.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import semver from 'semver';
77
import axios from 'axios';
88
import unzipper from 'unzipper';
99

10-
const REPOSITORY_URL = 'https://github.com/OriginTrail/ot-node';
11-
const ARCHIVE_REPOSITORY_URL = 'github.com/OriginTrail/ot-node/archive/';
10+
const REPOSITORY_URL = 'https://github.com/OriginTrail/dkg-engine';
11+
const ARCHIVE_REPOSITORY_URL = 'github.com/OriginTrail/dkg-engine/archive/';
1212

1313
class OTAutoUpdater {
1414
async initialize(config, logger) {
@@ -50,7 +50,7 @@ class OTAutoUpdater {
5050

5151
async update() {
5252
try {
53-
this.logger.debug(`AutoUpdater - Updating ot-node from ${REPOSITORY_URL}`);
53+
this.logger.debug(`AutoUpdater - Updating dkg-engine from ${REPOSITORY_URL}`);
5454
const currentDirectory = appRootPath.path;
5555
const rootPath = path.join(currentDirectory, '..');
5656

@@ -173,7 +173,7 @@ class OTAutoUpdater {
173173
downloadUpdate(destination) {
174174
return new Promise((resolve, reject) => {
175175
const url = `https://${path.join(ARCHIVE_REPOSITORY_URL, this.config.branch)}.zip`;
176-
this.logger.debug(`AutoUpdater - Downloading ot-node .zip file from url: ${url}`);
176+
this.logger.debug(`AutoUpdater - Downloading dkg-engine .zip file from url: ${url}`);
177177
axios({ method: 'get', url, responseType: 'stream' })
178178
.then((response) => {
179179
const fileStream = fs.createWriteStream(destination);
@@ -191,15 +191,15 @@ class OTAutoUpdater {
191191
.catch((error) => {
192192
reject(
193193
Error(
194-
`AutoUpdater - Unable to download new version of ot-node. Error: ${error.message}`,
194+
`AutoUpdater - Unable to download new version of dkg-engine. Error: ${error.message}`,
195195
),
196196
);
197197
});
198198
});
199199
}
200200

201201
unzipFile(destination, source) {
202-
this.logger.debug(`AutoUpdater - Unzipping ot-node new version archive`);
202+
this.logger.debug(`AutoUpdater - Unzipping dkg-engine new version archive`);
203203
return new Promise((resolve, reject) => {
204204
const fileReadStream = fs
205205
.createReadStream(source)
@@ -220,7 +220,7 @@ class OTAutoUpdater {
220220
const destinationDirFiles = await fs.readdir(extractedDataPath);
221221
if (destinationDirFiles.length !== 1) {
222222
await fs.remove(extractedDataPath);
223-
throw Error('Extracted archive for new ot-node version is not valid');
223+
throw Error('Extracted archive for new dkg-engine version is not valid');
224224
}
225225
const sourcePath = path.join(extractedDataPath, destinationDirFiles[0]);
226226
await fs.remove(destinationPath);

src/modules/triple-store/implementation/ot-blazegraph/ot-blazegraph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class OtBlazegraph extends OtTripleStore {
220220
} catch (error) {
221221
if (error.response && error.response.status === 404) {
222222
// Expected error: GraphDB is up but has not created node0 repository
223-
// Ot-node will create repo in initialization
223+
// dkg-engine will create repo in initialization
224224
return false;
225225
}
226226
this.logger.error(

src/modules/triple-store/implementation/ot-graphdb/ot-graphdb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class OtGraphdb extends OtTripleStore {
8383
} catch (e) {
8484
if (e.response && e.response.status === 404) {
8585
// Expected error: GraphDB is up but has not created node0 repository
86-
// Ot-node will create repo in initialization
86+
// dkg-engine will create repo in initialization
8787
return true;
8888
}
8989
return false;

tools/local-network-setup/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ This tool will help you set up a local DKG V8 network running with the Hardhat b
1414

1515
# Setup instructions
1616

17-
In order to run the local network you fist need to clone the "ot-node" repository.
17+
In order to run the local network you fist need to clone the "dkg-engine" repository.
1818
<br/>
1919

20-
## 1. CLONE OT-NODE REPOSITORY & INSTALL DEPENDENCIES
20+
## 1. CLONE DKG-ENGINE REPOSITORY & INSTALL DEPENDENCIES
2121

22-
After cloning the **ot-node** repository, please checkout to "v8/develop" branch and install dependencies by running:
22+
After cloning the **dkg-engine** repository, please checkout to "v8/develop" branch and install dependencies by running:
2323

2424
```bash
25-
git clone https://github.com/OriginTrail/ot-node.git && cd ot-node/ && npm install && cd ..
25+
git clone https://github.com/OriginTrail/dkg-engine.git && cd dkg-engine/ && npm install && cd ..
2626
```
2727

2828
<br/>
2929

30-
### 2.2 Create the .env file inside the "ot-node" directory:
30+
### 2.2 Create the .env file inside the "dkg-engine" directory:
3131

3232
```bash
3333
nano .env

v8-data-migration/triple-store-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export async function healthCheck(tripleStoreRepositories, repository, tripleSto
202202
} catch (e) {
203203
if (e.response && e.response.status === 404) {
204204
// Expected error: GraphDB is up but has not created node0 repository
205-
// Ot-node will create repo in initialization
205+
// dkg-engine will create repo in initialization
206206
return true;
207207
}
208208
logger.error(`Health check failed for repository ${repository}:`, e);

0 commit comments

Comments
 (0)