-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
lnrpc: expose network name in GetInfo #2399
lnrpc: expose network name in GetInfo #2399
Conversation
98f2b78
to
6385567
Compare
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.
LGTM! Been wanting this for a while :)
needs rebase tho |
lnrpc/rpc.proto
Outdated
@@ -1151,6 +1151,9 @@ message GetInfoResponse { | |||
|
|||
/// Number of inactive channels | |||
uint32 num_inactive_channels = 15 [json_name = "num_inactive_channels"]; | |||
|
|||
/// The network the node is connected to | |||
string network = 16 [json_name = "network"]; |
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.
Can instead extend the chain
field to be something like: bitcoin:testnet
? (right now it just says bitcoin
)
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.
If we want that, I'd rather make a separate field for it. In a new PR, because this is all I need currently.
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.
If we add this new field, then the response contains redundant data: we'll have a testnet
bool as well as a network
enum-like file. Instead, we can expand the scope of the chain
response to also specify the network. This would rectify a flaw in the existing response (unable to determine precise deployment environment). Using the chain
field also fits within the existing schema put in place to prep lnd
for a multi-chain future (having bitcoin:testnet
and bitcoin:mainnet
active at once for example). With the chain
field modified, we can then remove the testnet
field all together as it adds no new information.
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.
Yes, the testnet bool should be marked deprecated
.
Expanding the chains
field to report chain:network
is a breaking change. Can that be merged?
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.
When would we ever want to have testnet and mainnet running on the same node? IMO mainnet/testnet/simnet should be a single daemon-level configuration, and then any number of currencies can be used on that network
ad29b42
to
d6f3e88
Compare
That was just an example. Another example is bridging to diff test
networks, sidechains, etc. Main point is to extend an existing field and
remove redundancy in the responses.
…On Mon, Jan 7, 2019, 12:25 PM Conner Fromknecht ***@***.*** wrote:
***@***.**** commented on this pull request.
------------------------------
In lnrpc/rpc.proto
<#2399 (comment)>:
> @@ -1151,6 +1151,9 @@ message GetInfoResponse {
/// Number of inactive channels
uint32 num_inactive_channels = 15 [json_name = "num_inactive_channels"];
+
+ /// The network the node is connected to
+ string network = 16 [json_name = "network"];
When would we ever want to have testnet and mainnet running on the same
node? IMO mainnet/testnet/simnet should be a single daemon-level
configuration, and then any number of currencies can be used on that network
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2399 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA87LqOhRGAz8k13ZXWUKNsHiF5yKp_Kks5vA61SgaJpZM4ZmyFM>
.
|
@Roasbeef I am fine with extending the existing chains list, but it is a breaking change. Let me know your thoughts on that. |
Yeah I think that's fine as this will land in a major release. |
d6f3e88
to
e5b1358
Compare
@Roasbeef have another look. To me this multi chain field is premature, but alright, it does the job. |
1c2e64a
to
a2e8b5f
Compare
Previously only a testnet boolean was available which made it impossible to distinguish between regtest and mainnet.
a2e8b5f
to
6494080
Compare
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.
LGTM 🧬
Previously only a testnet boolean was available which
made it impossible to distinguish between regtest and
mainnet.