mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-19 22:42:24 +00:00
adding viper
int int
This commit is contained in:
committed by
Ethan Buchman
parent
47852122d0
commit
cefb2bede0
+3
-2
@@ -4,10 +4,11 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
|
||||
abcicli "github.com/tendermint/abci/client"
|
||||
"github.com/tendermint/abci/example/dummy"
|
||||
"github.com/tendermint/abci/types"
|
||||
cfg "github.com/tendermint/go-config"
|
||||
)
|
||||
|
||||
// NewABCIClient returns newly connected client
|
||||
@@ -63,7 +64,7 @@ func (r *remoteClientCreator) NewABCIClient() (abcicli.Client, error) {
|
||||
//-----------------------------------------------------------------
|
||||
// default
|
||||
|
||||
func DefaultClientCreator(config cfg.Config) ClientCreator {
|
||||
func DefaultClientCreator(config *viper.Viper) ClientCreator {
|
||||
addr := config.GetString("proxy_app")
|
||||
transport := config.GetString("abci")
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/spf13/viper"
|
||||
cfg "github.com/tendermint/go-config"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
//-----------------------------
|
||||
@@ -16,7 +17,7 @@ type AppConns interface {
|
||||
Query() AppConnQuery
|
||||
}
|
||||
|
||||
func NewAppConns(config cfg.Config, clientCreator ClientCreator, handshaker Handshaker) AppConns {
|
||||
func NewAppConns(config *viper.Viper, clientCreator ClientCreator, handshaker Handshaker) AppConns {
|
||||
return NewMultiAppConn(config, clientCreator, handshaker)
|
||||
}
|
||||
|
||||
@@ -34,7 +35,7 @@ type Handshaker interface {
|
||||
type multiAppConn struct {
|
||||
cmn.BaseService
|
||||
|
||||
config cfg.Config
|
||||
config *viper.Viper
|
||||
|
||||
handshaker Handshaker
|
||||
|
||||
@@ -46,7 +47,7 @@ type multiAppConn struct {
|
||||
}
|
||||
|
||||
// Make all necessary abci connections to the application
|
||||
func NewMultiAppConn(config cfg.Config, clientCreator ClientCreator, handshaker Handshaker) *multiAppConn {
|
||||
func NewMultiAppConn(config *viper.Viper, clientCreator ClientCreator, handshaker Handshaker) *multiAppConn {
|
||||
multiAppConn := &multiAppConn{
|
||||
config: config,
|
||||
handshaker: handshaker,
|
||||
|
||||
Reference in New Issue
Block a user