Skip to content

Instantly share code, notes, and snippets.

@robertkowalski
Last active December 2, 2017 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertkowalski/7b9c0875cb7afdb8b944ef4b27059e1c to your computer and use it in GitHub Desktop.
Save robertkowalski/7b9c0875cb7afdb8b944ef4b27059e1c to your computer and use it in GitHub Desktop.
diff --git a/test/ping.js b/test/ping.js
index a9631d9..3288440 100644
--- a/test/ping.js
+++ b/test/ping.js
@@ -44,6 +44,7 @@ test('testing clones', function (t) {
dht2.on('ready', function () {
dht2.destroy(function () {
+ //console.log("----")
dht3 = dht({bootstrap: ['127.0.0.1:10000']})
dht3.on('ready', ping)
dht3.listen(20000)
@@ -53,6 +54,8 @@ test('testing clones', function (t) {
dht2.listen(20000)
function ping () {
+ console.log(dht3.nodes.toArray())
+ console.log(dht1.nodes.toArray())
t.same(dht3.nodes.toArray().length, 2, 'has two nodes')
t.same(dht1.nodes.toArray().length, 2, 'have two nodes')
dht1._pingAll(function () {
@robertkowalski
Copy link
Author

contents node 3:
[ { id: <Buffer 1e 8c 22 38 84 1e d6 c9 2b 3a 17 82 77 75 87 65 8b 98 91 6b>,
    host: '127.0.0.1',
    port: 10000,
    distance: 0 },
  { id: <Buffer 03 ae 51 a3 59 97 90 3c 4e 8d f0 67 a6 53 a2 51 2b 67 f1 08>,
    host: '127.0.0.1',
    port: 20000,
    distance: 0 } ]
contents node 1:
[ { id: <Buffer 03 ae 51 a3 59 97 90 3c 4e 8d f0 67 a6 53 a2 51 2b 67 f1 08>,
    host: '127.0.0.1',
    port: 20000,
    distance: 0 } ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment