-
Notifications
You must be signed in to change notification settings - Fork 37.7k
rpc: Human readable network services #16787
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
Conversation
42fd0ca
to
6e47bf2
Compare
Concept ACK, though to avoid clients having to do additional string parsing, i'd slightly prefer a list instead of one
or leave out the
|
I prefer @laanwj's version as well. |
6e47bf2
to
fcbbb7e
Compare
Updated to use a list instead of a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK - looks like multiple developers have said that this would be a worthwhile inclusion. Thanks for writing release notes as well.
master (33f9750):
"services": "000000000000040d",
"relaytxes": true,
This PR (0774c03):
src/bitcoin-cli getpeerinfo | grep -i 'services' -A 7
"services": "000000000000040d",
"servicesnames": [
"NETWORK",
"BLOOM",
"WITNESS",
"NETWORK_LIMITED"
],
"relaytxes": true,
--
"services": "000000000000000d",
"servicesnames": [
"NETWORK",
"BLOOM",
"WITNESS"
],
"relaytxes": true,
"lastsend": 1567474969,
--
"services": "000000000000040d",
"servicesnames": [
"NETWORK",
"BLOOM",
"WITNESS",
"NETWORK_LIMITED"
],
"relaytxes": true,
Concept ACK -- nice usability improvement! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a documentation nit
0774c03
to
1e29f04
Compare
Rebased to point in the help that only known services are decoded, and to group the decoding into one function as suggested by @MarcoFalke |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Code review ACK 1e29f04 |
1e29f04
to
10adfa5
Compare
(Travis is failing for mysterious reasons but the build is passing on https://bitcoinbuilds.org/?build=1484 fwiw :-) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 10adfa5. Reviewed code, ran tests and tried it out on mainnet - works as expected. Feel free to ignore nits if you don't change something else.
yeahh Travis is having infrastructure issues again (I think), restarted the failing jobs … |
10adfa5
to
66740f4
Compare
Rebased to fix the last doc nits (and hopefully make Travis happy). |
unsigned ACK 66740f4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have tests for these new fields?
Works for me |
66740f4 doc: add a release note for the new field in 'getpeerinfo' and 'getnetworkinfo' (darosior) 6564f58 rpc/net: decode the services flags in a new entry (darosior) Pull request description: This is a reopen of #15511 (comment) since there have been concept ACKs from sdaftuar and Sjors. This adds a new entry to `getpeerinfo` and `getnetworkinfo` which decodes the network services flags. Here is a truncated output of `getpeerinfo`: ``` "services": "000000000000040d", "servicesnames": "NODE_NETWORK | NODE_BLOOM | NODE_WITNESS | NODE_NETWORK_LIMITED", "relaytxes": true, ``` And one of `getnetworkinfo`: ``` "localservices": "0000000000000409", "localservicesnames": "NODE_NETWORK | NODE_WITNESS | NODE_NETWORK_LIMITED", "localrelay": true, ``` Fixes #16780. ACKs for top commit: MarcoFalke: unsigned ACK 66740f4 laanwj: ACK 66740f4 Tree-SHA512: 0acc37134b283f56004a41243903d7790cb01591ddf0342489bd05f3a2c780563075373ba5fd55180fa15632e8968ffa11a979b8afece75a6a2e891342601440
Will do |
…tworkinfo` 1d524c6 tests: rename 'test_getnetworkinginfo' in 'test_getnetworkinfo' (darosior) 07a8f65 tests: add a test for the 'servicesnames' RPC field (darosior) Pull request description: As per #16787 (comment), fixes #16844. This adds a test for both commands in the first commit and renames the test for `getnetworkinfo` in the second commit. ACKs for top commit: laanwj: ACK 1d524c6 Tree-SHA512: 8267dce4d54356debab75014e6f9ba885b892da605ed32f26a5446c232992fcae761861bb678adbdb942815d4706f3768c70deee6afec68f219b23605475be01
Github-Pull: bitcoin#16787 Rebased-From: 6564f58
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
* Update travis.yml according to travis backend errors and warns Namely: - root: deprecated key sudo (The key `sudo` has no effect anymore.) - language: value minimal is an alias for shell, using shell - root: key matrix is an alias for jobs, using jobs * Reduce time threshold to force travis to save cache and abort * Add getchaintxstats RPC this is a port of core #9733 * [RPC] Add an uptime command that displays the amount of time that bitcoind has been running this is a port of Core #10400 * rpc/net: decode the services flags in a new entry This is a backport of bitcoin/bitcoin/pull/16787 Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com> Co-authored-by: Ricardo Velhote <rvelhote@users.noreply.github.com> Co-authored-by: Darosior <darosior@protonmail.com>
Summary: This adds human readable network services to the output of `getpeerinfo` and `getnetworkinfo` Backport of Core [[bitcoin/bitcoin#16787 | PR16787]] Test Plan: Run `src/bitcoin-cli getnetworkinfo` and check the `localservicesnames` field. More tests coming in PR16850 Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7948
This is a reopen of #15511 (comment) since there have been concept ACKs from sdaftuar and Sjors.
This adds a new entry to
getpeerinfo
andgetnetworkinfo
which decodes the network services flags.Here is a truncated output of
getpeerinfo
:And one of
getnetworkinfo
:Fixes #16780.