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.

46 lines
1.1 KiB

  1. package core
  2. import (
  3. bc "github.com/tendermint/tendermint/blockchain"
  4. "github.com/tendermint/tendermint/consensus"
  5. mempl "github.com/tendermint/tendermint/mempool"
  6. "github.com/tendermint/tendermint/p2p"
  7. stypes "github.com/tendermint/tendermint/state/types"
  8. "github.com/tendermint/tendermint/types"
  9. )
  10. var blockStore *bc.BlockStore
  11. var consensusState *consensus.ConsensusState
  12. var consensusReactor *consensus.ConsensusReactor
  13. var mempoolReactor *mempl.MempoolReactor
  14. var p2pSwitch *p2p.Switch
  15. var privValidator *types.PrivValidator
  16. var genDoc *stypes.GenesisDoc // cache the genesis structure
  17. func SetBlockStore(bs *bc.BlockStore) {
  18. blockStore = bs
  19. }
  20. func SetConsensusState(cs *consensus.ConsensusState) {
  21. consensusState = cs
  22. }
  23. func SetConsensusReactor(cr *consensus.ConsensusReactor) {
  24. consensusReactor = cr
  25. }
  26. func SetMempoolReactor(mr *mempl.MempoolReactor) {
  27. mempoolReactor = mr
  28. }
  29. func SetSwitch(sw *p2p.Switch) {
  30. p2pSwitch = sw
  31. }
  32. func SetPrivValidator(pv *types.PrivValidator) {
  33. privValidator = pv
  34. }
  35. func SetGenDoc(doc *stypes.GenesisDoc) {
  36. genDoc = doc
  37. }