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.

45 lines
1.0 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. "github.com/tendermint/tendermint/state"
  8. )
  9. var blockStore *bc.BlockStore
  10. var consensusState *consensus.ConsensusState
  11. var consensusReactor *consensus.ConsensusReactor
  12. var mempoolReactor *mempl.MempoolReactor
  13. var p2pSwitch *p2p.Switch
  14. var privValidator *state.PrivValidator
  15. var genDoc *state.GenesisDoc // cache the genesis structure
  16. func SetBlockStore(bs *bc.BlockStore) {
  17. blockStore = bs
  18. }
  19. func SetConsensusState(cs *consensus.ConsensusState) {
  20. consensusState = cs
  21. }
  22. func SetConsensusReactor(cr *consensus.ConsensusReactor) {
  23. consensusReactor = cr
  24. }
  25. func SetMempoolReactor(mr *mempl.MempoolReactor) {
  26. mempoolReactor = mr
  27. }
  28. func SetSwitch(sw *p2p.Switch) {
  29. p2pSwitch = sw
  30. }
  31. func SetPrivValidator(pv *state.PrivValidator) {
  32. privValidator = pv
  33. }
  34. func SetGenDoc(doc *state.GenesisDoc) {
  35. genDoc = doc
  36. }