multi: Remove peer_id from RPC commands

This commit is contained in:
MeshCollider 2018-02-14 18:23:01 +13:00 committed by Olaoluwa Osuntokun
parent 236d53785d
commit 4ed5ba0d26
5 changed files with 2 additions and 48 deletions

View File

@ -388,15 +388,9 @@ var openChannelCommand = cli.Command{
of the funding output is returned.
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.
NOTE: peer_id and node_key are mutually exclusive, only one should be used, not both.`,
the --conf_target or --sat_per_byte arguments. This is optional.`,
ArgsUsage: "node-key local-amt push-amt",
Flags: []cli.Flag{
cli.IntFlag{
Name: "peer_id",
Usage: "the relative id of the peer to open a channel with",
},
cli.StringFlag{
Name: "node_key",
Usage: "the identity public key of the target node/peer " +
@ -463,11 +457,6 @@ func openChannel(ctx *cli.Context) error {
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{
TargetConf: int32(ctx.Int64("conf_target")),
SatPerByte: ctx.Int64("sat_per_byte"),
@ -475,8 +464,6 @@ func openChannel(ctx *cli.Context) error {
}
switch {
case ctx.IsSet("peer_id"):
req.TargetPeerId = int32(ctx.Int("peer_id"))
case ctx.IsSet("node_key"):
nodePubHex, err := hex.DecodeString(ctx.String("node_key"))
if err != nil {

View File

@ -123,7 +123,6 @@ alice$ lncli listpeers
"peers": [
{
"pub_key": "0343bc80b914aebf8e50eb0b8e445fc79b9e6e8e5e018fa8c5f85c7d429c117b38",
"peer_id": 1,
"address": "172.19.0.4:9735",
"bytes_sent": "357",
"bytes_recv": "357",
@ -141,7 +140,6 @@ bob$ lncli listpeers
"peers": [
{
"pub_key": "03d0cd35b761f789983f3cfe82c68170cd1c3266b39220c24f7dd72ef4be0883eb",
"peer_id": 1,
"address": "172.19.0.3:51932",
"bytes_sent": "357",
"bytes_recv": "357",

View File

@ -832,8 +832,6 @@ func (m *ConnectPeerRequest) GetPerm() bool {
}
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{} }
@ -1113,8 +1111,6 @@ func (m *ListChannelsResponse) GetChannels() []*ActiveChannel {
type Peer struct {
// / The identity pubkey of the peer
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`
Address string `protobuf:"bytes,3,opt,name=address" json:"address,omitempty"`
// / Bytes of data transmitted to this peer
@ -1635,8 +1631,6 @@ func (m *PendingUpdate) GetOutputIndex() uint32 {
}
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
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

View File

@ -630,8 +630,6 @@ message ConnectPeerRequest {
bool perm = 2;
}
message ConnectPeerResponse {
/// The id of the newly connected peer
int32 peer_id = 1 [json_name = "peer_id"];
}
message DisconnectPeerRequest {
@ -738,9 +736,6 @@ message Peer {
/// The identity pubkey of the peer
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`
string address = 3 [json_name = "address"];
@ -858,9 +853,6 @@ message PendingUpdate {
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
bytes node_pubkey = 2 [json_name = "node_pubkey"];

View File

@ -1127,14 +1127,7 @@
}
},
"lnrpcConnectPeerResponse": {
"type": "object",
"properties": {
"peer_id": {
"type": "integer",
"format": "int32",
"title": "/ The id of the newly connected peer"
}
}
"type": "object"
},
"lnrpcCreateWalletRequest": {
"type": "object",
@ -1559,11 +1552,6 @@
"lnrpcOpenChannelRequest": {
"type": "object",
"properties": {
"target_peer_id": {
"type": "integer",
"format": "int32",
"title": "/ The peer_id of the node to open a channel with"
},
"node_pubkey": {
"type": "string",
"format": "byte",
@ -1697,11 +1685,6 @@
"type": "string",
"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": {
"type": "string",
"title": "/ Network address of the peer; eg `127.0.0.1:10011`"