update for a new ABCI API

This commit is contained in:
Anton Kaliaev
2017-05-16 19:06:35 +02:00
parent e1792c1ea5
commit 91dc87e7c4
6 changed files with 71 additions and 33 deletions

View File

@@ -1,6 +1,8 @@
package proxy
import (
"github.com/pkg/errors"
cmn "github.com/tendermint/tmlibs/common"
)
@@ -70,25 +72,34 @@ func (app *multiAppConn) Query() AppConnQuery {
func (app *multiAppConn) OnStart() error {
// query connection
querycli, err := app.clientCreator.NewABCIClient()
querycli.SetLogger(app.Logger.With("module", "abci-client", "connection", "query"))
if err != nil {
return err
return errors.Wrap(err, "Error creating ABCI client (query connection)")
}
querycli.SetLogger(app.Logger.With("module", "abci-client", "connection", "query"))
if _, err := querycli.Start(); err != nil {
return errors.Wrap(err, "Error starting ABCI client (query connection)")
}
app.queryConn = NewAppConnQuery(querycli)
// mempool connection
memcli, err := app.clientCreator.NewABCIClient()
memcli.SetLogger(app.Logger.With("module", "abci-client", "connection", "mempool"))
if err != nil {
return err
return errors.Wrap(err, "Error creating ABCI client (mempool connection)")
}
memcli.SetLogger(app.Logger.With("module", "abci-client", "connection", "mempool"))
if _, err := memcli.Start(); err != nil {
return errors.Wrap(err, "Error starting ABCI client (mempool connection)")
}
app.mempoolConn = NewAppConnMempool(memcli)
// consensus connection
concli, err := app.clientCreator.NewABCIClient()
concli.SetLogger(app.Logger.With("module", "abci-client", "connection", "consensus"))
if err != nil {
return err
return errors.Wrap(err, "Error creating ABCI client (consensus connection)")
}
concli.SetLogger(app.Logger.With("module", "abci-client", "connection", "consensus"))
if _, err := concli.Start(); err != nil {
return errors.Wrap(err, "Error starting ABCI client (consensus connection)")
}
app.consensusConn = NewAppConnConsensus(concli)
@@ -96,5 +107,6 @@ func (app *multiAppConn) OnStart() error {
if app.handshaker != nil {
return app.handshaker.Handshake(app)
}
return nil
}