lnshell: comment out lnchat, it's in limbo before we add the message to unwire

This commit is contained in:
Olaoluwa Osuntokun 2016-01-16 19:12:03 -08:00
parent 4b696f1690
commit 32d4e3a3b6
2 changed files with 7 additions and 30 deletions

@ -1,7 +1,6 @@
package main package main
import ( import (
"encoding/hex"
"fmt" "fmt"
"time" "time"
@ -40,37 +39,22 @@ func RpcConnect(args []string) error {
} }
func LnConnect(args []string) error { func LnConnect(args []string) error {
// var err error
if len(args) == 0 { if len(args) == 0 {
return fmt.Errorf("need: lnc pubkeyhash@hostname or pkh (via pbx)") return fmt.Errorf("need: lnc pubkeyhash@hostname or pkh (via pbx)")
} }
req := new(lnrpc.LNConnectRequest) req := &lnrpc.ConnectPeerRequest{args[0]}
req.IdAtHost = args[0] resp, err := z.ConnectPeer(stub, req)
resp, err := z.LNConnect(stub, req)
if err != nil { if err != nil {
return err return err
} }
fmt.Printf("connected. remote lnid is %x\n", resp.LnID) fmt.Printf("connected. remote lnid is %x\n", resp.LnID)
return nil 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 // For testing. Syntax: lnhi hello world
func LnChat(args []string) error { /*func LnChat(args []string) error {
var err error var err error
if len(args) < 2 { if len(args) < 2 {
return fmt.Errorf("too short, need: lnhi 32hexcharLNID message.\n") 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") fmt.Printf("got response but there's nothing in it\n")
return nil return nil
} }*/

@ -64,13 +64,13 @@ func Shellparse(cmdslice []string) error {
return fmt.Errorf("User exit") return fmt.Errorf("User exit")
} }
if cmd == "lnhi" { /*if cmd == "lnhi" {
err = LnChat(args) err = LnChat(args)
if err != nil { if err != nil {
fmt.Printf("LN chat error: %s\n", err) fmt.Printf("LN chat error: %s\n", err)
} }
return nil return nil
} }*/
if cmd == "lnc" { if cmd == "lnc" {
err = LnConnect(args) err = LnConnect(args)
if err != nil { if err != nil {
@ -78,13 +78,6 @@ func Shellparse(cmdslice []string) error {
} }
return nil 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") fmt.Printf("Command not recognized.\n")
return nil return nil
} }