mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
lnshell: comment out lnchat, it's in limbo before we add the message to unwire
This commit is contained in:
parent
4b696f1690
commit
32d4e3a3b6
@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@ -40,37 +39,22 @@ func RpcConnect(args []string) error {
|
||||
}
|
||||
|
||||
func LnConnect(args []string) error {
|
||||
// var err error
|
||||
if len(args) == 0 {
|
||||
return fmt.Errorf("need: lnc pubkeyhash@hostname or pkh (via pbx)")
|
||||
}
|
||||
|
||||
req := new(lnrpc.LNConnectRequest)
|
||||
req.IdAtHost = args[0]
|
||||
resp, err := z.LNConnect(stub, req)
|
||||
req := &lnrpc.ConnectPeerRequest{args[0]}
|
||||
resp, err := z.ConnectPeer(stub, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("connected. remote lnid is %x\n", resp.LnID)
|
||||
return nil
|
||||
}
|
||||
|
||||
// LnListen listens on the default port for incoming connections
|
||||
func LnListen(args []string) error {
|
||||
|
||||
req := new(lnrpc.TCPListenRequest)
|
||||
req.Hostport = "0.0.0.0:2448"
|
||||
_, err := z.TCPListen(stub, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("started TCP port listener\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
// For testing. Syntax: lnhi hello world
|
||||
func LnChat(args []string) error {
|
||||
/*func LnChat(args []string) error {
|
||||
var err error
|
||||
if len(args) < 2 {
|
||||
return fmt.Errorf("too short, need: lnhi 32hexcharLNID message.\n")
|
||||
@ -99,4 +83,4 @@ func LnChat(args []string) error {
|
||||
}
|
||||
fmt.Printf("got response but there's nothing in it\n")
|
||||
return nil
|
||||
}
|
||||
}*/
|
||||
|
@ -64,13 +64,13 @@ func Shellparse(cmdslice []string) error {
|
||||
return fmt.Errorf("User exit")
|
||||
}
|
||||
|
||||
if cmd == "lnhi" {
|
||||
/*if cmd == "lnhi" {
|
||||
err = LnChat(args)
|
||||
if err != nil {
|
||||
fmt.Printf("LN chat error: %s\n", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}*/
|
||||
if cmd == "lnc" {
|
||||
err = LnConnect(args)
|
||||
if err != nil {
|
||||
@ -78,13 +78,6 @@ func Shellparse(cmdslice []string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if cmd == "lnl" {
|
||||
err = LnListen(args)
|
||||
if err != nil {
|
||||
fmt.Printf("LN listen error: %s\n", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
fmt.Printf("Command not recognized.\n")
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user