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

internal/ethapi: add net_nodeInfo #2307

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

weiihann
Copy link
Contributor

Description

This PR adds a new net_nodeInfo RPC method. It is the same as admin_nodeInfo.

Rationale

The reason why net_nodeInfo is introduced even though admin_nodeInfo already exists is because some admin methods can control the behavior of the node. If a node were to be compromised with the admin namespace enabled, then the node could potentially stop functioning.

On the other hand, having access to retrieving the node information is extremely useful, especially when running an infrastructure. The content of the node info doesn't reveal sensitive information as well, so it could be added to the net namespace safely.

Another consideration is to remove admin_nodeInfo and replace with net_nodeInfo. This is possible, but this will contradict with the documentation of geth upstream. So in my opinion, there's no harm keeping both.

Example

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"net_nodeInfo","params":[],"id":83}' 127.0.0.1:8575

@zzzckck zzzckck merged commit e313d5b into bnb-chain:develop Mar 21, 2024
7 checks passed
@Pjrich1313 Pjrich1313 mentioned this pull request Mar 27, 2024
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.

3 participants