status-go/peers
osmaczko 2ced83abb7
chore_: replace geth logger with zap logger (#5962)
closes: #6002
2024-10-28 20:54:17 +00:00
..
verifier
README.md
cache.go chore_: replace geth logger with zap logger (#5962) 2024-10-28 20:54:17 +00:00
cache_test.go
cotopicpool.go feat_: log on panic (#5849) 2024-09-27 06:37:32 +08:00
cotopicpool_test.go
peerpool.go chore_: replace geth logger with zap logger (#5962) 2024-10-28 20:54:17 +00:00
peerpool_test.go refactor_: remove status-im/rendezvous (#5685) 2024-08-22 13:12:37 -04:00
signal.go
topic_peer_queue.go Bug/fix pending peers segfault (#2004) 2020-07-24 11:14:05 -04:00
topic_peer_queue_test.go Upgrade linter and address issues 2020-12-28 16:55:14 +01:00
topic_register.go chore_: replace geth logger with zap logger (#5962) 2024-10-28 20:54:17 +00:00
topicpool.go chore_: replace geth logger with zap logger (#5962) 2024-10-28 20:54:17 +00:00
topicpool_test.go fix topic pool tests 2021-07-20 10:57:38 +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": []
}