Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

improve kademlia table output #1403

Closed
nonsense opened this issue May 29, 2019 · 2 comments
Closed

improve kademlia table output #1403

nonsense opened this issue May 29, 2019 · 2 comments

Comments

@nonsense
Copy link
Contributor

Currently the table output of Kademlia looks like:

> console.log(bzz.hive)

=========================================================================
Wed May 29 09:13:36 UTC 2019 KΛÐΞMLIΛ hive: queen's address: b0cfc13c822bfc017f0dd532d2df579effc7382bc6359dec7252821d8e8e8210
population: 22 (68), NeighbourhoodSize: 2, MinBinSize: 2, MaxBinSize: 4
000  7 4ab4 4461 4318 430a          | 36 4318 (0) 430a (0) 4461 (0) 4ab4 (0)
001  3 d2af d580 e9bc               | 15 d2af (0) d580 (0) d4f9 (0) d47f (0)
002  7 907d 9dfa 9b53 876e          |  8 9dfa (0) 9b53 (0) 907d (0) 8a1a (0)
============ DEPTH: 3 ==========================================
003  5 afe1 aea5 a1eb a7e6          |  6 aea5 (0) afe1 (0) a1eb (0) a7e6 (0)
004  0                              |  2 b93d (8) b89a (8)
005  0                              |  0
006  0                              |  1 b32d (8)
007  0                              |  0
008  0                              |  0
009  0                              |  0
010  0                              |  0
011  0                              |  0
012  0                              |  0
013  0                              |  0
014  0                              |  0
015  0                              |  0
=========================================================================
undefined

There are a few problems with this:

  1. Entries are not sorted. It is possible to have the same Kademlia connections in a given bin, but for peers to be re-arranged. We need to sort them prior to output so that we can easily compare different tables.
  2. The table does not show all connections, but max 4. We need to show all of them so that we know who we are connected to.

Basically the Kademlia table output should give an exhaustive information about the state of Kademlia, which currently is not the case.


Because of this I suggest:

  1. Fix the sorting of peers.
  2. Split the known vs live peers into two tables.
  3. Output any and all connections so that we know all the peers we are connected to.

Ideas on how to further improve this are welcome.

@nonsense
Copy link
Contributor Author

We've added a structured API endpoint to return this information in JSON format, so I consider this done for now. If we need to improve on this, we can re-open the issue.

@nonsense
Copy link
Contributor Author

#1586

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant