multi: Remove peer_id from RPC commands
This commit is contained in:
parent
236d53785d
commit
4ed5ba0d26
@ -388,15 +388,9 @@ var openChannelCommand = cli.Command{
|
|||||||
of the funding output is returned.
|
of the funding output is returned.
|
||||||
|
|
||||||
One can manually set the fee to be used for the funding transaction via either
|
One can manually set the fee to be used for the funding transaction via either
|
||||||
the --conf_target or --sat_per_byte arguments. This is optional.
|
the --conf_target or --sat_per_byte arguments. This is optional.`,
|
||||||
|
|
||||||
NOTE: peer_id and node_key are mutually exclusive, only one should be used, not both.`,
|
|
||||||
ArgsUsage: "node-key local-amt push-amt",
|
ArgsUsage: "node-key local-amt push-amt",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.IntFlag{
|
|
||||||
Name: "peer_id",
|
|
||||||
Usage: "the relative id of the peer to open a channel with",
|
|
||||||
},
|
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "node_key",
|
Name: "node_key",
|
||||||
Usage: "the identity public key of the target node/peer " +
|
Usage: "the identity public key of the target node/peer " +
|
||||||
@ -463,11 +457,6 @@ func openChannel(ctx *cli.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet("peer_id") && ctx.IsSet("node_key") {
|
|
||||||
return fmt.Errorf("both peer_id and lightning_id cannot be set " +
|
|
||||||
"at the same time, only one can be specified")
|
|
||||||
}
|
|
||||||
|
|
||||||
req := &lnrpc.OpenChannelRequest{
|
req := &lnrpc.OpenChannelRequest{
|
||||||
TargetConf: int32(ctx.Int64("conf_target")),
|
TargetConf: int32(ctx.Int64("conf_target")),
|
||||||
SatPerByte: ctx.Int64("sat_per_byte"),
|
SatPerByte: ctx.Int64("sat_per_byte"),
|
||||||
@ -475,8 +464,6 @@ func openChannel(ctx *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case ctx.IsSet("peer_id"):
|
|
||||||
req.TargetPeerId = int32(ctx.Int("peer_id"))
|
|
||||||
case ctx.IsSet("node_key"):
|
case ctx.IsSet("node_key"):
|
||||||
nodePubHex, err := hex.DecodeString(ctx.String("node_key"))
|
nodePubHex, err := hex.DecodeString(ctx.String("node_key"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -123,7 +123,6 @@ alice$ lncli listpeers
|
|||||||
"peers": [
|
"peers": [
|
||||||
{
|
{
|
||||||
"pub_key": "0343bc80b914aebf8e50eb0b8e445fc79b9e6e8e5e018fa8c5f85c7d429c117b38",
|
"pub_key": "0343bc80b914aebf8e50eb0b8e445fc79b9e6e8e5e018fa8c5f85c7d429c117b38",
|
||||||
"peer_id": 1,
|
|
||||||
"address": "172.19.0.4:9735",
|
"address": "172.19.0.4:9735",
|
||||||
"bytes_sent": "357",
|
"bytes_sent": "357",
|
||||||
"bytes_recv": "357",
|
"bytes_recv": "357",
|
||||||
@ -141,7 +140,6 @@ bob$ lncli listpeers
|
|||||||
"peers": [
|
"peers": [
|
||||||
{
|
{
|
||||||
"pub_key": "03d0cd35b761f789983f3cfe82c68170cd1c3266b39220c24f7dd72ef4be0883eb",
|
"pub_key": "03d0cd35b761f789983f3cfe82c68170cd1c3266b39220c24f7dd72ef4be0883eb",
|
||||||
"peer_id": 1,
|
|
||||||
"address": "172.19.0.3:51932",
|
"address": "172.19.0.3:51932",
|
||||||
"bytes_sent": "357",
|
"bytes_sent": "357",
|
||||||
"bytes_recv": "357",
|
"bytes_recv": "357",
|
||||||
|
@ -832,8 +832,6 @@ func (m *ConnectPeerRequest) GetPerm() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ConnectPeerResponse struct {
|
type ConnectPeerResponse struct {
|
||||||
// / The id of the newly connected peer
|
|
||||||
PeerId int32 `protobuf:"varint,1,opt,name=peer_id" json:"peer_id,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ConnectPeerResponse) Reset() { *m = ConnectPeerResponse{} }
|
func (m *ConnectPeerResponse) Reset() { *m = ConnectPeerResponse{} }
|
||||||
@ -1113,8 +1111,6 @@ func (m *ListChannelsResponse) GetChannels() []*ActiveChannel {
|
|||||||
type Peer struct {
|
type Peer struct {
|
||||||
// / The identity pubkey of the peer
|
// / The identity pubkey of the peer
|
||||||
PubKey string `protobuf:"bytes,1,opt,name=pub_key" json:"pub_key,omitempty"`
|
PubKey string `protobuf:"bytes,1,opt,name=pub_key" json:"pub_key,omitempty"`
|
||||||
// / The peer's id from the local point of view
|
|
||||||
PeerId int32 `protobuf:"varint,2,opt,name=peer_id" json:"peer_id,omitempty"`
|
|
||||||
// / Network address of the peer; eg `127.0.0.1:10011`
|
// / Network address of the peer; eg `127.0.0.1:10011`
|
||||||
Address string `protobuf:"bytes,3,opt,name=address" json:"address,omitempty"`
|
Address string `protobuf:"bytes,3,opt,name=address" json:"address,omitempty"`
|
||||||
// / Bytes of data transmitted to this peer
|
// / Bytes of data transmitted to this peer
|
||||||
@ -1635,8 +1631,6 @@ func (m *PendingUpdate) GetOutputIndex() uint32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OpenChannelRequest struct {
|
type OpenChannelRequest struct {
|
||||||
// / The peer_id of the node to open a channel with
|
|
||||||
TargetPeerId int32 `protobuf:"varint,1,opt,name=target_peer_id" json:"target_peer_id,omitempty"`
|
|
||||||
// / The pubkey of the node to open a channel with
|
// / The pubkey of the node to open a channel with
|
||||||
NodePubkey []byte `protobuf:"bytes,2,opt,name=node_pubkey,proto3" json:"node_pubkey,omitempty"`
|
NodePubkey []byte `protobuf:"bytes,2,opt,name=node_pubkey,proto3" json:"node_pubkey,omitempty"`
|
||||||
// / The hex encoded pubkey of the node to open a channel with
|
// / The hex encoded pubkey of the node to open a channel with
|
||||||
|
@ -630,8 +630,6 @@ message ConnectPeerRequest {
|
|||||||
bool perm = 2;
|
bool perm = 2;
|
||||||
}
|
}
|
||||||
message ConnectPeerResponse {
|
message ConnectPeerResponse {
|
||||||
/// The id of the newly connected peer
|
|
||||||
int32 peer_id = 1 [json_name = "peer_id"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message DisconnectPeerRequest {
|
message DisconnectPeerRequest {
|
||||||
@ -738,9 +736,6 @@ message Peer {
|
|||||||
/// The identity pubkey of the peer
|
/// The identity pubkey of the peer
|
||||||
string pub_key = 1 [json_name = "pub_key"];
|
string pub_key = 1 [json_name = "pub_key"];
|
||||||
|
|
||||||
/// The peer's id from the local point of view
|
|
||||||
int32 peer_id = 2 [json_name = "peer_id"];
|
|
||||||
|
|
||||||
/// Network address of the peer; eg `127.0.0.1:10011`
|
/// Network address of the peer; eg `127.0.0.1:10011`
|
||||||
string address = 3 [json_name = "address"];
|
string address = 3 [json_name = "address"];
|
||||||
|
|
||||||
@ -858,9 +853,6 @@ message PendingUpdate {
|
|||||||
|
|
||||||
message OpenChannelRequest {
|
message OpenChannelRequest {
|
||||||
|
|
||||||
/// The peer_id of the node to open a channel with
|
|
||||||
int32 target_peer_id = 1 [json_name = "target_peer_id"];
|
|
||||||
|
|
||||||
/// The pubkey of the node to open a channel with
|
/// The pubkey of the node to open a channel with
|
||||||
bytes node_pubkey = 2 [json_name = "node_pubkey"];
|
bytes node_pubkey = 2 [json_name = "node_pubkey"];
|
||||||
|
|
||||||
|
@ -1127,14 +1127,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lnrpcConnectPeerResponse": {
|
"lnrpcConnectPeerResponse": {
|
||||||
"type": "object",
|
"type": "object"
|
||||||
"properties": {
|
|
||||||
"peer_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"format": "int32",
|
|
||||||
"title": "/ The id of the newly connected peer"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"lnrpcCreateWalletRequest": {
|
"lnrpcCreateWalletRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@ -1559,11 +1552,6 @@
|
|||||||
"lnrpcOpenChannelRequest": {
|
"lnrpcOpenChannelRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"target_peer_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"format": "int32",
|
|
||||||
"title": "/ The peer_id of the node to open a channel with"
|
|
||||||
},
|
|
||||||
"node_pubkey": {
|
"node_pubkey": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "byte",
|
"format": "byte",
|
||||||
@ -1697,11 +1685,6 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "/ The identity pubkey of the peer"
|
"title": "/ The identity pubkey of the peer"
|
||||||
},
|
},
|
||||||
"peer_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"format": "int32",
|
|
||||||
"title": "/ The peer's id from the local point of view"
|
|
||||||
},
|
|
||||||
"address": {
|
"address": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "/ Network address of the peer; eg `127.0.0.1:10011`"
|
"title": "/ Network address of the peer; eg `127.0.0.1:10011`"
|
||||||
|
Loading…
Reference in New Issue
Block a user