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.

65 lines
1.4 KiB

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