mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 06:31:57 +00:00
TMSP -> ABCI
This commit is contained in:
+3
-3
@@ -1,11 +1,11 @@
|
||||
package tmspcli
|
||||
package abcicli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
. "github.com/tendermint/go-common"
|
||||
"github.com/tendermint/tmsp/types"
|
||||
"github.com/tendermint/abci/types"
|
||||
)
|
||||
|
||||
type Client interface {
|
||||
@@ -50,7 +50,7 @@ func NewClient(addr, transport string, mustConnect bool) (client Client, err err
|
||||
case "grpc":
|
||||
client, err = NewGRPCClient(addr, mustConnect)
|
||||
default:
|
||||
err = fmt.Errorf("Unknown tmsp transport %s", transport)
|
||||
err = fmt.Errorf("Unknown abci transport %s", transport)
|
||||
|
||||
}
|
||||
return
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package tmspcli
|
||||
package abcicli
|
||||
|
||||
import (
|
||||
"net"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
grpc "google.golang.org/grpc"
|
||||
|
||||
. "github.com/tendermint/go-common"
|
||||
"github.com/tendermint/tmsp/types"
|
||||
"github.com/tendermint/abci/types"
|
||||
)
|
||||
|
||||
// A stripped copy of the remoteClient that makes
|
||||
@@ -18,7 +18,7 @@ type grpcClient struct {
|
||||
BaseService
|
||||
mustConnect bool
|
||||
|
||||
client types.TMSPApplicationClient
|
||||
client types.ABCIApplicationClient
|
||||
|
||||
mtx sync.Mutex
|
||||
addr string
|
||||
@@ -50,13 +50,13 @@ RETRY_LOOP:
|
||||
if cli.mustConnect {
|
||||
return err
|
||||
} else {
|
||||
log.Warn(Fmt("tmsp.grpcClient failed to connect to %v. Retrying...\n", cli.addr))
|
||||
log.Warn(Fmt("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr))
|
||||
time.Sleep(time.Second * 3)
|
||||
continue RETRY_LOOP
|
||||
}
|
||||
}
|
||||
|
||||
client := types.NewTMSPApplicationClient(conn)
|
||||
client := types.NewABCIApplicationClient(conn)
|
||||
|
||||
ENSURE_CONNECTED:
|
||||
for {
|
||||
@@ -93,7 +93,7 @@ func (cli *grpcClient) StopForError(err error) {
|
||||
}
|
||||
cli.mtx.Unlock()
|
||||
|
||||
log.Warn(Fmt("Stopping tmsp.grpcClient for error: %v", err.Error()))
|
||||
log.Warn(Fmt("Stopping abci.grpcClient for error: %v", err.Error()))
|
||||
cli.Stop()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package tmspcli
|
||||
package abcicli
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
. "github.com/tendermint/go-common"
|
||||
types "github.com/tendermint/tmsp/types"
|
||||
types "github.com/tendermint/abci/types"
|
||||
)
|
||||
|
||||
type localClient struct {
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package tmspcli
|
||||
package abcicli
|
||||
|
||||
import (
|
||||
"github.com/tendermint/go-logger"
|
||||
)
|
||||
|
||||
var log = logger.New("module", "tmspcli")
|
||||
var log = logger.New("module", "abcicli")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package tmspcli
|
||||
package abcicli
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
. "github.com/tendermint/go-common"
|
||||
"github.com/tendermint/tmsp/types"
|
||||
"github.com/tendermint/abci/types"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -70,7 +70,7 @@ RETRY_LOOP:
|
||||
if cli.mustConnect {
|
||||
return err
|
||||
} else {
|
||||
log.Warn(Fmt("tmsp.socketClient failed to connect to %v. Retrying...", cli.addr))
|
||||
log.Warn(Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr))
|
||||
time.Sleep(time.Second * 3)
|
||||
continue RETRY_LOOP
|
||||
}
|
||||
@@ -109,7 +109,7 @@ func (cli *socketClient) StopForError(err error) {
|
||||
}
|
||||
cli.mtx.Unlock()
|
||||
|
||||
log.Warn(Fmt("Stopping tmsp.socketClient for error: %v", err.Error()))
|
||||
log.Warn(Fmt("Stopping abci.socketClient for error: %v", err.Error()))
|
||||
cli.Stop()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user