Skip to content

Commit

Permalink
Version 2.0.29
Browse files Browse the repository at this point in the history
  • Loading branch information
kipliklotrika committed Dec 6, 2018
2 parents 3df3517 + 7a3b3cc commit 392aeff
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 19 deletions.
8 changes: 4 additions & 4 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
},
"network": {
"hostname": "127.0.0.1",
"id": "StagenetV1.0.0",
"id": "StagenetV1.0.1",
"bootstraps": ["https://stagingbs.origintrial.me:5278/#1754b56ce26212eab45bc523c36e1d4bf57ea30e"],
"remoteWhitelist": ["54.93.223.161", "127.0.0.1"],
"solutionDifficulty": 14,
Expand Down Expand Up @@ -275,7 +275,7 @@
},
"network": {
"hostname": "127.0.0.1",
"id": "StablenetV1.0.0",
"id": "StablenetV1.0.1",
"bootstraps": ["https://82.196.10.12:5278/#e2f7ab11d0dd34595dfb2e71b4937ec8d790df84"],
"remoteWhitelist": ["54.93.223.161", "127.0.0.1"],
"solutionDifficulty": 14,
Expand Down Expand Up @@ -375,7 +375,7 @@
},
"network": {
"hostname": "127.0.0.1",
"id": "TestnetV2.0.0b",
"id": "TestnetV2.0.1b",
"bootstraps": [
"https://46.101.233.127:5278/#41d7357b322ca75d1187b3163b510ff704e9a040",
"https://82.196.6.215:5278/#9e7f1ec47d0da65b9f2e004510ae366519290dff"
Expand Down Expand Up @@ -478,7 +478,7 @@
},
"network": {
"hostname": "127.0.0.1",
"id": "MarinerV1.0.0",
"id": "MarinerV1.0.1",
"bootstraps": [
"https://35.159.51.107:5278/#3e3f9f62aa3e55c4bc2e307e2164357e538466a5",
"https://142.93.13.94:5278/#6d3e620c2c4062e67ed16f86c2fd9c6fec739644"
Expand Down
12 changes: 11 additions & 1 deletion modules/Database/Arangojs.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,18 @@ class ArangoJS {
return normalizedVertices.concat(objectClasses);
}

/**
* Finds object vertices.
* TODO We need to change the query. This is not the appropriate way.
* @return {Promise<any>}
*/
async findObjectClassVertices() {
const queryString = 'FOR v IN ot_vertices FILTER v.vertex_type == "CLASS" AND v.datasets == null SORT v._key RETURN v';
const queryString = 'FOR v IN ot_vertices ' +
'FILTER v.vertex_type == "CLASS" ' +
'AND v.datasets == null ' +
'AND v._dc_key == null ' +
'SORT v._key ' +
'RETURN v';
return this.runQuery(queryString, {});
}

Expand Down
4 changes: 2 additions & 2 deletions modules/Database/graph-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function denormalizeGraph(importId, vertices, edges) {
const denormalizedEdges = edges;

vertices.forEach((vertex) => {
if (vertex.vertex_type !== 'IDENTIFIER') {
if (vertex.vertex_type !== 'IDENTIFIER' && vertex.vertex_type !== 'CLASS') {
const denormalizedVertex = {
[importId]: {},
};
Expand Down Expand Up @@ -43,7 +43,7 @@ function normalizeGraph(importId, vertices, edges) {

vertices.forEach((vertex) => {
const normalizedVertex = {};
if (vertex.vertex_type !== 'IDENTIFIER' && vertex[importId]) {
if (vertex.vertex_type !== 'IDENTIFIER' && vertex[importId] && vertex.vertex_type !== 'CLASS') {
normalizedVertex.data = vertex[importId].data;

if (vertex._dc_key) {
Expand Down
1 change: 0 additions & 1 deletion modules/EventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ class EventEmitter {
message: 'Query sent successfully.',
query_id: queryId,
});
dvController.handleQuery(queryId, 60000);
}).catch((error) => {
logger.error(`Failed query network. ${error}.`);
notifyError(error);
Expand Down
13 changes: 12 additions & 1 deletion modules/command/dv/dv-query-network-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,18 @@ class DVQueryNetworkCommand extends Command {

await this.transport.publish('kad-data-location-request', dataLocationRequestObject);
this.logger.info(`Published query to the network. Query ID ${queryId}.`);
return Command.empty();
return {
commands: [
{
name: 'dvHandleNetworkQueryResponsesCommand',
delay: 60000,
data: {
queryId,
},
transactional: false,
},
],
};
}

/**
Expand Down
14 changes: 12 additions & 2 deletions modules/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,19 @@ class Importer {
// TODO: Use transaction here.
await Promise.all(denormalizedVertices.map(vertex => this.graphStorage.addVertex(vertex))
.concat(edges.map(edge => this.graphStorage.addEdge(edge))));
await Promise.all(vertices.map(vertex => this.graphStorage.updateImports('ot_vertices', vertex, dataSetId))
.concat(edges.map(edge => this.graphStorage.updateImports('ot_edges', edge, dataSetId))));

if (encColor == null) {
// it's encrypted
await Promise.all(vertices
.filter(vertex => vertex.vertex_type !== 'CLASS')
.map(vertex => this.graphStorage.updateImports('ot_vertices', vertex, dataSetId))
.concat(edges.map(edge => this.graphStorage.updateImports('ot_edges', edge, dataSetId))));
} else {
// not encrypted
await Promise.all(vertices
.map(vertex => this.graphStorage.updateImports('ot_vertices', vertex, dataSetId))
.concat(edges.map(edge => this.graphStorage.updateImports('ot_edges', edge, dataSetId))));
}
this.log.info('JSON import complete');

if (!packKeys) {
Expand Down
2 changes: 1 addition & 1 deletion modules/network/kademlia/kademlia.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class Kademlia {

this.node.hashcash = this.node.plugin(kadence.hashcash({
methods: [
'PUBLISH', 'SUBSCRIBE', 'kad-data-location-request',
'kad-data-location-request',
'kad-replication-finished', 'kad-data-location-response', 'kad-data-read-request',
'kad-data-read-response', 'kad-send-encrypted-key',
'kad-encrypted-key-process-result',
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "origintrail_node",
"version": "2.0.28",
"version": "2.0.29",
"description": "OriginTrail node",
"main": ".eslintrc.js",
"config": {
Expand Down

0 comments on commit 392aeff

Please sign in to comment.