2015-03-26 21:30:42 -07:00
|
|
|
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"
|
2015-08-10 20:38:45 -07:00
|
|
|
"github.com/tendermint/tendermint/types"
|
2015-03-26 21:30:42 -07:00
|
|
|
)
|
|
|
|
|
2016-10-10 02:58:13 -04:00
|
|
|
var eventSwitch types.EventSwitch
|
2015-03-25 00:15:18 -07:00
|
|
|
var blockStore *bc.BlockStore
|
2015-03-26 21:30:42 -07:00
|
|
|
var consensusState *consensus.ConsensusState
|
2015-04-25 11:49:26 -07:00
|
|
|
var consensusReactor *consensus.ConsensusReactor
|
2015-03-26 21:30:42 -07:00
|
|
|
var mempoolReactor *mempl.MempoolReactor
|
|
|
|
var p2pSwitch *p2p.Switch
|
2015-08-10 20:38:45 -07:00
|
|
|
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
|
2015-03-26 21:30:42 -07:00
|
|
|
|
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) {
|
2015-03-26 21:30:42 -07:00
|
|
|
blockStore = bs
|
|
|
|
}
|
|
|
|
|
2015-03-29 18:06:55 -07:00
|
|
|
func SetConsensusState(cs *consensus.ConsensusState) {
|
2015-03-26 21:30:42 -07:00
|
|
|
consensusState = cs
|
|
|
|
}
|
|
|
|
|
2015-04-25 11:49:26 -07:00
|
|
|
func SetConsensusReactor(cr *consensus.ConsensusReactor) {
|
|
|
|
consensusReactor = cr
|
|
|
|
}
|
|
|
|
|
2015-03-29 18:06:55 -07:00
|
|
|
func SetMempoolReactor(mr *mempl.MempoolReactor) {
|
2015-03-26 21:30:42 -07:00
|
|
|
mempoolReactor = mr
|
|
|
|
}
|
|
|
|
|
2015-03-29 18:06:55 -07:00
|
|
|
func SetSwitch(sw *p2p.Switch) {
|
2015-03-26 21:30:42 -07:00
|
|
|
p2pSwitch = sw
|
|
|
|
}
|
2015-03-31 04:53:34 -07:00
|
|
|
|
2015-08-10 20:38:45 -07:00
|
|
|
func SetPrivValidator(pv *types.PrivValidator) {
|
2015-05-12 19:03:05 -07:00
|
|
|
privValidator = pv
|
2015-03-31 04:53:34 -07:00
|
|
|
}
|
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
|
|
|
|
}
|