You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.4 KiB

  1. package core
  2. import (
  3. cfg "github.com/tendermint/go-config"
  4. "github.com/tendermint/go-p2p"
  5. bc "github.com/tendermint/tendermint/blockchain"
  6. "github.com/tendermint/tendermint/consensus"
  7. mempl "github.com/tendermint/tendermint/mempool"
  8. "github.com/tendermint/tendermint/proxy"
  9. "github.com/tendermint/tendermint/types"
  10. )
  11. var eventSwitch types.EventSwitch
  12. var blockStore *bc.BlockStore
  13. var consensusState *consensus.ConsensusState
  14. var consensusReactor *consensus.ConsensusReactor
  15. var mempoolReactor *mempl.MempoolReactor
  16. var p2pSwitch *p2p.Switch
  17. var privValidator *types.PrivValidator
  18. var genDoc *types.GenesisDoc // cache the genesis structure
  19. var proxyAppQuery proxy.AppConnQuery
  20. var config cfg.Config = nil
  21. func SetConfig(c cfg.Config) {
  22. config = c
  23. }
  24. func SetEventSwitch(evsw types.EventSwitch) {
  25. eventSwitch = evsw
  26. }
  27. func SetBlockStore(bs *bc.BlockStore) {
  28. blockStore = bs
  29. }
  30. func SetConsensusState(cs *consensus.ConsensusState) {
  31. consensusState = cs
  32. }
  33. func SetConsensusReactor(cr *consensus.ConsensusReactor) {
  34. consensusReactor = cr
  35. }
  36. func SetMempoolReactor(mr *mempl.MempoolReactor) {
  37. mempoolReactor = mr
  38. }
  39. func SetSwitch(sw *p2p.Switch) {
  40. p2pSwitch = sw
  41. }
  42. func SetPrivValidator(pv *types.PrivValidator) {
  43. privValidator = pv
  44. }
  45. func SetGenesisDoc(doc *types.GenesisDoc) {
  46. genDoc = doc
  47. }
  48. func SetProxyAppQuery(appConn proxy.AppConnQuery) {
  49. proxyAppQuery = appConn
  50. }