trying to get shell to connect over grpc

This commit is contained in:
Tadge Dryja authored and Olaoluwa Osuntokun committed 2016-01-14 23:55:45 -08:00
1 parent 31f3df2183
commit 6647bdd2b8
2 files changed
+10 -5

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ import (
)
var (
serverAddr = flag.String("rpcserver", "127.0.0.1:10000", "The server address in the format of host:port")
serverAddr = flag.String("rpcserver", "localhost:10000", "The server address in the format of host:port")
)
func fatal(err error) {
+9 -4
View File
@@ -9,6 +9,7 @@ import (
"github.com/codegangsta/cli"
"google.golang.org/grpc"
"li.lan/labs/plasma/lnrpc"
)
func shell(z *cli.Context) {
@@ -111,18 +112,22 @@ func Shellparse(cmdslice []string) error {
func RpcConnect(args []string) error {
// client := getClient(ctx)
opts := []grpc.DialOption{grpc.WithInsecure()}
conn, err := grpc.Dial("127.0.0.1:10000", opts...)
conn, err := grpc.Dial("localhost:10000", opts...)
if err != nil {
return (err)
return err
}
state, err := conn.State()
if err != nil {
return (err)
return err
}
fmt.Printf("connection state: %s\n", state.String())
lnClient := lnrpc.NewLightningClient(conn)
// lnClient.NewAddress(nil, nil, nil) // crashes
err = conn.Close()
if err != nil {
return (err)
return err
}
return nil