tendermint/rpc/core/pipe.go

65 lines
1.4 KiB
Go
Raw Normal View History

package core
import (
2016-05-11 23:33:09 -04:00
cfg "github.com/tendermint/go-config"
2015-11-01 11:34:08 -08:00
"github.com/tendermint/go-p2p"
2016-05-11 23:33:09 -04:00
2015-04-01 17:30:16 -07:00
bc "github.com/tendermint/tendermint/blockchain"
"github.com/tendermint/tendermint/consensus"
mempl "github.com/tendermint/tendermint/mempool"
2016-08-22 16:00:48 -04:00
"github.com/tendermint/tendermint/proxy"
"github.com/tendermint/tendermint/types"
)
2016-10-10 02:58:13 -04:00
var eventSwitch types.EventSwitch
var blockStore *bc.BlockStore
var consensusState *consensus.ConsensusState
var consensusReactor *consensus.ConsensusReactor
var mempoolReactor *mempl.MempoolReactor
var p2pSwitch *p2p.Switch
var privValidator *types.PrivValidator
2015-11-01 11:34:08 -08:00
var genDoc *types.GenesisDoc // cache the genesis structure
2016-08-22 16:00:48 -04:00
var proxyAppQuery proxy.AppConnQuery
2016-05-11 23:33:09 -04:00
var config cfg.Config = nil
func SetConfig(c cfg.Config) {
config = c
}
2016-10-10 02:58:13 -04:00
func SetEventSwitch(evsw types.EventSwitch) {
2016-06-27 20:43:09 -04:00
eventSwitch = evsw
}
2015-03-29 18:06:55 -07:00
func SetBlockStore(bs *bc.BlockStore) {
blockStore = bs
}
2015-03-29 18:06:55 -07:00
func SetConsensusState(cs *consensus.ConsensusState) {
consensusState = cs
}
func SetConsensusReactor(cr *consensus.ConsensusReactor) {
consensusReactor = cr
}
2015-03-29 18:06:55 -07:00
func SetMempoolReactor(mr *mempl.MempoolReactor) {
mempoolReactor = mr
}
2015-03-29 18:06:55 -07:00
func SetSwitch(sw *p2p.Switch) {
p2pSwitch = sw
}
func SetPrivValidator(pv *types.PrivValidator) {
2015-05-12 19:03:05 -07:00
privValidator = pv
}
2015-06-14 18:18:17 -04:00
2015-12-01 20:12:01 -08:00
func SetGenesisDoc(doc *types.GenesisDoc) {
2015-06-14 18:18:17 -04:00
genDoc = doc
}
2016-08-22 16:00:48 -04:00
func SetProxyAppQuery(appConn proxy.AppConnQuery) {
proxyAppQuery = appConn
}