status-go/geth/peers
Dmitry Shulyak 9e65b5a6ae Dump peer infos as discovery summary 2018-05-15 13:11:28 +03:00
..
README.md Dump peer infos as discovery summary 2018-05-15 13:11:28 +03:00
cache.go Add `shhext_getNewFilterMessages` function to RPC APIs. 2018-04-27 15:24:37 +02:00
cache_test.go Add `shhext_getNewFilterMessages` function to RPC APIs. 2018-04-27 15:24:37 +02:00
discv5.go Peerpool failover (#801) 2018-04-12 16:08:49 +03:00
peerpool.go Prevent Discovery from timeout when registering topics (#944) 2018-05-15 11:16:25 +02:00
peerpool_test.go Dump peer infos as discovery summary 2018-05-15 13:11:28 +03:00
signal.go Dump peer infos as discovery summary 2018-05-15 13:11:28 +03:00
topic_peer_queue.go Add a priority queue to TopicPool (#840) 2018-04-19 17:18:49 +02:00
topic_peer_queue_test.go Add a priority queue to TopicPool (#840) 2018-04-19 17:18:49 +02:00
topic_register.go Peer pool to manage v5 peers (#736) 2018-04-10 09:44:09 +03:00
topicpool.go Explicitly disable discovery (#886) 2018-05-10 14:45:51 +03:00
topicpool_test.go Limit time spent in fast mode and timeout Discovery V5 (#867) 2018-05-01 17:19:11 +02:00

README.md

Peer pool signals

Peer pool sends 3 types of signals.

Discovery started signal will be sent once discovery server is started. And every time node will have to re-start discovery server because peer number dropped too low.

{
  "type": "discovery.started",
  "event": null
}

Discovery stopped signal will be sent once discovery found max limit of peers for every registered topic.

{
  "type": "discovery.stopped",
  "event": null
}

Discovery summary signal will be sent every time new peer is added or removed from a cluster. It will contain a map with capability as a key and total numbers of peers with that capability as a value.

{
  "type": "discovery.summary",
  "event": [
    {
      "id": "339c84c816b5f17a622c8d7ab9498f9998e942a274f70794af934bf5d3d02e14db8ddca2170e4edccede29ea6d409b154c141c34c01006e76c95e17672a27454",
      "name": "peer-0/v1.0/darwin/go1.10.1",
      "caps": [
        "shh/6"
      ],
      "network": {
        "localAddress": "127.0.0.1:61049",
        "remoteAddress": "127.0.0.1:33732",
        "inbound": false,
        "trusted": false,
        "static": true
      },
      "protocols": {
        "shh": "unknown"
      }
    }
  ]
}

Or if we don't have any peers:

{
  "type": "discovery.summary",
  "event": []
}