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 wtfnode api endpoint #2096

Merged
merged 2 commits into from
Feb 25, 2021
Merged

Add wtfnode api endpoint #2096

merged 2 commits into from
Feb 25, 2021

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Feb 24, 2021

Run wtfnode on demand through a dedicated API route.

I've added this to debug the socket open handles leak but I think it's a very valuable tool to keep mid-term. wtfnode is loaded with a lazy require call so it will only be loaded after the first call to the API route. Otherwise won't be run at all and don't disturb non-debug runs

Sample response

Replies with a plain text formated dump

http://localhost:9596/eth/v1/lodestar/wtfnode/

[WTF Node?] open handles:
- File descriptors: (note: stdio always exists)
  - fd 1 (tty) (stdio)
  - fd 2 (tty) (stdio)
  - fd 0 (tty)
- Sockets:
  - 192.168.1.36:45442 -> 91.105.22.151:9000
  - 192.168.1.36:50264 -> 188.166.75.68:13000
  - 192.168.1.36:50558 -> 69.230.152.160:9000
  - 192.168.1.36:49432 -> 85.5.238.105:13000
  - 192.168.1.36:49006 -> 71.47.209.223:13000
  - 192.168.1.36:45112 -> 93.56.200.143:13000
  - 192.168.1.36:41760 -> 86.20.4.83:9000
  - 192.168.1.36:50024 -> 46.39.104.43:9000
  - 192.168.1.36:43430 -> undefined:undefined
    - Listeners:
      - connect: onConnect @ /home/lion/Code/eth2.0/lodestar/node_modules/libp2p-tcp/src/index.js:101
  - 192.168.1.36:55328 -> undefined:undefined
    - Listeners:
      - connect: onConnect @ /home/lion/Code/eth2.0/lodestar/node_modules/libp2p-tcp/src/index.js:101

@codeclimate
Copy link

codeclimate bot commented Feb 24, 2021

Code Climate has analyzed commit 3d2aa70 and detected 0 issues on this pull request.

View more on Code Climate.

@wemeetagain wemeetagain merged commit 65dbabf into master Feb 25, 2021
@wemeetagain wemeetagain deleted the dapplion/wtfnode branch February 25, 2021 16:58
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.

None yet

2 participants