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

discovery+lnwire: add support for DNS host name in NodeAnnouncement msg #9455

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/commands/peersrpc_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ var updateNodeAnnouncementCommand = cli.Command{
Name: "color",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a suggestion for PR structure: it's a better pattern to do:

  1. add new logic internal to the server
  2. expose new logic of server via RPC
  3. start reading/using new logic from client

a nice way to think about it is: we always want to be able to revert back to any commit and have things make sense. But with this current order, if we reverted to this commit, we would have all these fields that the server is exposing and the client is writing to but it wont actually do anything on the server side which doesnt make sense

Usage: "the new color for this node, e.g. #c42a81",
},
cli.StringFlag{
Name: "dns_hostname_address",
Usage: "the new dns hostname address for this node",
},
cli.Int64SliceFlag{
Name: "feature_bit_add",
Usage: "a feature bit index that needs to be enabled. " +
Expand Down Expand Up @@ -124,6 +128,11 @@ func updateNodeAnnouncement(ctx *cli.Context) error {
req.Color = ctx.String("color")
}

if ctx.IsSet("dns_hostname_address") {
change = true
req.DnsHostnameAddress = ctx.String("dns_hostname_address")
}

if ctx.IsSet("feature_bit_add") {
change = true
for _, feature := range ctx.Int64Slice("feature_bit_add") {
Expand Down
4 changes: 4 additions & 0 deletions lnrpc/devrpc/dev.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@
"format": "byte"
},
"description": "Custom node announcement tlv records."
},
"dns_hostname_address": {
"$ref": "#/definitions/lnrpcNodeAddress",
"description": "The DNS hostname address of the node, if available."
}
},
"description": "An individual vertex/node within the channel graph. A node is\nconnected to other nodes by one or more channel edges emanating from it. As the\ngraph is directed, a node will also have an incoming edge attached to it for\neach outgoing edge."
Expand Down
3,543 changes: 1,779 additions & 1,764 deletions lnrpc/lightning.pb.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lnrpc/lightning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3437,6 +3437,9 @@ message LightningNode {

// Custom node announcement tlv records.
map<uint64, bytes> custom_records = 7;

// The DNS hostname address of the node, if available.
NodeAddress dns_hostname_address = 8;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why a new field for this if we already have an addresses field above?

}

message NodeAddress {
Expand Down
4 changes: 4 additions & 0 deletions lnrpc/lightning.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5799,6 +5799,10 @@
"format": "byte"
},
"description": "Custom node announcement tlv records."
},
"dns_hostname_address": {
"$ref": "#/definitions/lnrpcNodeAddress",
"description": "The DNS hostname address of the node, if available."
}
},
"description": "An individual vertex/node within the channel graph. A node is\nconnected to other nodes by one or more channel edges emanating from it. As the\ngraph is directed, a node will also have an incoming edge attached to it for\neach outgoing edge."
Expand Down
64 changes: 38 additions & 26 deletions lnrpc/peersrpc/peers.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lnrpc/peersrpc/peers.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ message NodeAnnouncementUpdateRequest {

// Set of changes for the node's known addresses.
repeated UpdateAddressAction address_updates = 4;

// The DNS hostname address of the node.
string dns_hostname_address = 5;
}

message NodeAnnouncementUpdateResponse {
Expand Down
4 changes: 4 additions & 0 deletions lnrpc/peersrpc/peers.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
"$ref": "#/definitions/peersrpcUpdateAddressAction"
},
"description": "Set of changes for the node's known addresses."
},
"dns_hostname_address": {
"type": "string",
"description": "The DNS hostname address of the node."
}
}
},
Expand Down