Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getP2pNetworkStats route #623

Merged
merged 2 commits into from
Aug 15, 2024
Merged

Conversation

alexcos20
Copy link
Member

@alexcos20 alexcos20 commented Aug 15, 2024

Changes proposed in this PR:

  • add a new http route called "getP2pNetworkStats" that exposes stats about the p2p network
  • used for debuging, as it gives extended information about networking
  • you MUST set env P2P_ENABLE_NETWORK_STATS=TRUE to enable, as it contains private data

Example output:

{
  "binds": [
    "/ip4/0.0.0.0/tcp/9000",
    "/ip4/0.0.0.0/tcp/9001/ws",
    "/ip6/::1/tcp/9002",
    "/ip6/::1/tcp/9003/ws"
  ],
  "listen": [
    "/ip4/127.0.0.1/tcp/9001/ws",
    "/ip4/10.255.255.254/tcp/9001/ws",
    "/ip4/172.23.54.159/tcp/9001/ws",
    "/ip4/127.0.0.1/tcp/9000",
    "/ip4/10.255.255.254/tcp/9000",
    "/ip4/172.23.54.159/tcp/9000",
    "/ip6/::1/tcp/9002"
  ],
  "observing": [
    "/ip4/188.27.96.232/tcp/49714",
    "/ip4/188.27.96.232/tcp/49794",
    "/ip4/188.27.96.232/tcp/49776",
    "/ip4/188.27.96.232/tcp/49766",
    "/ip4/188.27.96.232/tcp/49800",
    "/ip4/188.27.96.232/tcp/49742",
    "/ip4/188.27.96.232/tcp/49710",
    "/ip4/188.27.96.232/tcp/49718",
    "/ip4/188.27.96.232/tcp/49724",
    "/ip4/188.27.96.232/tcp/49752"
  ],
  "announce": [],
  "connections": [
    {
      "id": "daccn21723732444140",
      "remoteAddr": "/dns4/node2.oceanprotocol.com/tcp/9000/p2p/16Uiu2HAmHwzeVw7RpGopjZe6qNBJbzDDBdqtrSk7Gcx1emYsfgL4",
      "remotePeer": "16Uiu2HAmHwzeVw7RpGopjZe6qNBJbzDDBdqtrSk7Gcx1emYsfgL4",
      "direction": "outbound",
      "timeline": {
        "open": 1723732444022,
        "upgraded": 1723732444140
      },
      "multiplexer": "/yamux/1.0.0",
      "encryption": "/noise",
      "status": "open",
      "transient": false,
      "tags": []
    },
    {
      "id": "28zl101723732444171",
      "remoteAddr": "/dns4/node4.oceanprotocol.com/tcp/9000/p2p/16Uiu2HAmSTVTArioKm2wVcyeASHYEsnx2ZNq467Z4GMDU4ErEPom",
      "remotePeer": "16Uiu2HAmSTVTArioKm2wVcyeASHYEsnx2ZNq467Z4GMDU4ErEPom",
      "direction": "outbound",
      "timeline": {
        "open": 1723732444034,
        "upgraded": 1723732444171
      },
      "multiplexer": "/yamux/1.0.0",
      "encryption": "/noise",
      "status": "open",
      "transient": false,
      "tags": []
    }
  ]
}

@alexcos20 alexcos20 merged commit 548aeac into main Aug 15, 2024
11 checks passed
@alexcos20 alexcos20 deleted the feature/add_getP2pNetworkStats_route branch August 15, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant