From e1784d7583c450d3d589e79c21fb6eb3c9736d08 Mon Sep 17 00:00:00 2001 From: zeroxbt <89495162+zeroxbt@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:32:26 +0200 Subject: [PATCH 1/2] revert protocol selection (#2122) * downgrade kad-dht version * remove protocol selection --- package-lock.json | 14 +++++++------- package.json | 2 +- .../protocols/common/find-nodes-command.js | 14 +++++--------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c869f1de0..37df0cd4a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@libp2p/tcp": "^3.1.2", "@multiformats/multiaddr": "^11.0.1", "@polkadot/api": "^9.3.2", - "@tracelabs/kad-dht": "^3.1.0", + "@tracelabs/kad-dht": "3.0.6", "app-root-path": "^3.1.0", "assertion-tools": "^1.0.9", "async": "^3.2.4", @@ -6046,9 +6046,9 @@ } }, "node_modules/@tracelabs/kad-dht": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@tracelabs/kad-dht/-/kad-dht-3.1.0.tgz", - "integrity": "sha512-oGKErqWMKXaj47qYCpvwRZGBoihwXwLu0f6jb6gzYALA2HIuMPAhuore+hWJlXI8QffRJ9tz7+WYi+K9R2972w==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@tracelabs/kad-dht/-/kad-dht-3.0.6.tgz", + "integrity": "sha512-oop4bDl9CGZbmfKmIwwC7HH7raVNn0O/RFlIpxhxNoVCwCu/KOfdYNBtIQeNp/IdgkIyAgqO2+j41QVJNgU5Vw==", "dependencies": { "@libp2p/components": "^2.0.4", "@libp2p/crypto": "^1.0.4", @@ -25695,9 +25695,9 @@ "dev": true }, "@tracelabs/kad-dht": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@tracelabs/kad-dht/-/kad-dht-3.1.0.tgz", - "integrity": "sha512-oGKErqWMKXaj47qYCpvwRZGBoihwXwLu0f6jb6gzYALA2HIuMPAhuore+hWJlXI8QffRJ9tz7+WYi+K9R2972w==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@tracelabs/kad-dht/-/kad-dht-3.0.6.tgz", + "integrity": "sha512-oop4bDl9CGZbmfKmIwwC7HH7raVNn0O/RFlIpxhxNoVCwCu/KOfdYNBtIQeNp/IdgkIyAgqO2+j41QVJNgU5Vw==", "requires": { "@libp2p/components": "^2.0.4", "@libp2p/crypto": "^1.0.4", diff --git a/package.json b/package.json index 448060d0f1..811fe536b4 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@libp2p/tcp": "^3.1.2", "@multiformats/multiaddr": "^11.0.1", "@polkadot/api": "^9.3.2", - "@tracelabs/kad-dht": "^3.1.0", + "@tracelabs/kad-dht": "3.0.6", "app-root-path": "^3.1.0", "assertion-tools": "^1.0.9", "async": "^3.2.4", diff --git a/src/commands/protocols/common/find-nodes-command.js b/src/commands/protocols/common/find-nodes-command.js index 1bc6952203..cdf91903ec 100644 --- a/src/commands/protocols/common/find-nodes-command.js +++ b/src/commands/protocols/common/find-nodes-command.js @@ -18,15 +18,11 @@ class FindNodesCommand extends Command { this.errorType = errorType; this.logger.debug(`Searching for closest node(s) for keyword ${keyword}`); - const closestNodes = []; - for (const node of await this.findNodes(keyword, operationId)) { - for (const protocol of networkProtocols) { - if (node.protocols.includes(protocol)) { - closestNodes.push({ id: node.id, protocol }); - break; - } - } - } + // TODO: implement protocol selection + const closestNodes = (await this.findNodes(keyword, operationId)).map((node) => ({ + id: node.id, + protocol: networkProtocols[0], + })); this.logger.debug(`Found ${closestNodes.length} node(s) for keyword ${keyword}`); From 23dc3b003e86fa79c916a62ce8fa2875d591ea2e Mon Sep 17 00:00:00 2001 From: zeroxbt <89495162+zeroxbt@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:36:14 +0200 Subject: [PATCH 2/2] bump version (#2123) --- 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 37df0cd4a3..be58f0beee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.0.0-beta.2.2.5", + "version": "6.0.0-beta.2.2.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.0.0-beta.2.2.5", + "version": "6.0.0-beta.2.2.6", "license": "ISC", "dependencies": { "@chainsafe/libp2p-noise": "^8.0.1", diff --git a/package.json b/package.json index 811fe536b4..ecc822a89a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.0.0-beta.2.2.5", + "version": "6.0.0-beta.2.2.6", "description": "OTNode v6 Beta 2", "main": "index.js", "type": "module",