func status() { clientConn, err := peer.NewPeerClientConnection() if err != nil { logger.Error("Error trying to connect to local peer:", err) } serverClient := pb.NewAdminClient(clientConn) status, err := serverClient.GetStatus(context.Background(), &google_protobuf.Empty{}) logger.Info("Current status: %s", status) }
func stopOpenchain(t *testing.T) { clientConn, err := peer.NewPeerClientConnection() if err != nil { t.Log(fmt.Errorf("Error trying to connect to local peer:", err)) t.Fail() } t.Log("Stopping peer...") serverClient := pb.NewAdminClient(clientConn) status, err := serverClient.StopServer(context.Background(), &google_protobuf.Empty{}) t.Logf("Current status: %s", status) }
func status() (err error) { clientConn, err := peer.NewPeerClientConnection() if err != nil { err = fmt.Errorf("Error trying to connect to local peer:", err) return } serverClient := pb.NewAdminClient(clientConn) status, err := serverClient.GetStatus(context.Background(), &google_protobuf.Empty{}) if err != nil { return } fmt.Println(status) return nil }