Skip to content
Snippets Groups Projects
pipe.go 1.38 KiB
Newer Older
Ethan Buchman's avatar
Ethan Buchman committed
package core

import (
Silas Davis's avatar
Silas Davis committed
	erismint "github.com/eris-ltd/eris-db/manager/eris-mint"
	stypes "github.com/eris-ltd/eris-db/manager/eris-mint/state/types"
Ethan Buchman's avatar
Ethan Buchman committed

	bc "github.com/tendermint/tendermint/blockchain"
	server "github.com/eris-ltd/eris-db/server"
Ethan Buchman's avatar
Ethan Buchman committed
	"github.com/tendermint/tendermint/consensus"
	mempl "github.com/tendermint/tendermint/mempool"
	tmtypes "github.com/tendermint/tendermint/types"

	"github.com/tendermint/go-p2p"
)

var blockStore *bc.BlockStore
var consensusState *consensus.ConsensusState
var consensusReactor *consensus.ConsensusReactor
var mempoolReactor *mempl.MempoolReactor
var p2pSwitch *p2p.Switch
var privValidator *tmtypes.PrivValidator
var genDoc *stypes.GenesisDoc // cache the genesis structure
Silas Davis's avatar
Silas Davis committed
var erisMint *erismint.ErisMint
Ethan Buchman's avatar
Ethan Buchman committed

var config server.ServerConfig = server.ServerConfig{}
Ethan Buchman's avatar
Ethan Buchman committed

func SetConfig(c server.ServerConfig) {
Ethan Buchman's avatar
Ethan Buchman committed
	config = c
}

func SetApplication(em *erismint.ErisMint) {
Silas Davis's avatar
Silas Davis committed
	erisMint = em
Ethan Buchman's avatar
Ethan Buchman committed
}

func SetBlockStore(bs *bc.BlockStore) {
	blockStore = bs
}

func SetConsensusState(cs *consensus.ConsensusState) {
	consensusState = cs
}

func SetConsensusReactor(cr *consensus.ConsensusReactor) {
	consensusReactor = cr
}

func SetMempoolReactor(mr *mempl.MempoolReactor) {
	mempoolReactor = mr
}

func SetSwitch(sw *p2p.Switch) {
	p2pSwitch = sw
}

func SetPrivValidator(pv *tmtypes.PrivValidator) {
	privValidator = pv
}

func SetGenDoc(doc *stypes.GenesisDoc) {
	genDoc = doc
}