2015-03-26 21:30:42 -07:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2015-11-01 11:34:08 -08:00
|
|
|
"github.com/tendermint/go-p2p"
|
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"
|
2015-08-10 20:38:45 -07:00
|
|
|
"github.com/tendermint/tendermint/types"
|
2015-03-26 21:30:42 -07:00
|
|
|
)
|
|
|
|
|
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
|
2015-03-26 21:30:42 -07:00
|
|
|
|
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-11-01 11:34:08 -08:00
|
|
|
func SetGenDoc(doc *types.GenesisDoc) {
|
2015-06-14 18:18:17 -04:00
|
|
|
genDoc = doc
|
|
|
|
}
|