TMSP -> ABCI

This commit is contained in:
Ethan Buchman
2017-01-12 16:04:32 -05:00
parent 80f377135b
commit 5189a2248d
52 changed files with 221 additions and 219 deletions
+5 -5
View File
@@ -7,7 +7,7 @@ import (
"google.golang.org/grpc"
. "github.com/tendermint/go-common"
"github.com/tendermint/tmsp/types"
"github.com/tendermint/abci/types"
)
// var maxNumberConnections = 2
@@ -20,10 +20,10 @@ type GRPCServer struct {
listener net.Listener
server *grpc.Server
app types.TMSPApplicationServer
app types.ABCIApplicationServer
}
func NewGRPCServer(protoAddr string, app types.TMSPApplicationServer) (Service, error) {
func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (Service, error) {
parts := strings.SplitN(protoAddr, "://", 2)
proto, addr := parts[0], parts[1]
s := &GRPCServer{
@@ -32,7 +32,7 @@ func NewGRPCServer(protoAddr string, app types.TMSPApplicationServer) (Service,
listener: nil,
app: app,
}
s.BaseService = *NewBaseService(nil, "TMSPServer", s)
s.BaseService = *NewBaseService(nil, "ABCIServer", s)
_, err := s.Start() // Just start it
return s, err
}
@@ -45,7 +45,7 @@ func (s *GRPCServer) OnStart() error {
}
s.listener = ln
s.server = grpc.NewServer()
types.RegisterTMSPApplicationServer(s.server, s.app)
types.RegisterABCIApplicationServer(s.server, s.app)
go s.server.Serve(s.listener)
return nil
}
+1 -1
View File
@@ -4,4 +4,4 @@ import (
"github.com/tendermint/go-logger"
)
var log = logger.New("module", "tmsp-server")
var log = logger.New("module", "abci-server")
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
. "github.com/tendermint/go-common"
"github.com/tendermint/tmsp/types"
"github.com/tendermint/abci/types"
)
func NewServer(protoAddr, transport string, app types.Application) (Service, error) {
+2 -2
View File
@@ -9,7 +9,7 @@ import (
"sync"
. "github.com/tendermint/go-common"
"github.com/tendermint/tmsp/types"
"github.com/tendermint/abci/types"
)
// var maxNumberConnections = 2
@@ -39,7 +39,7 @@ func NewSocketServer(protoAddr string, app types.Application) (Service, error) {
app: app,
conns: make(map[int]net.Conn),
}
s.BaseService = *NewBaseService(nil, "TMSPServer", s)
s.BaseService = *NewBaseService(nil, "ABCIServer", s)
_, err := s.Start() // Just start it
return s, err
}