Newer
Older
Benjamin Bollen
committed
// Copyright 2015, 2016 Eris Industries (UK) Ltd.
// This file is part of Eris-RT
// Eris-RT is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Eris-RT is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Eris-RT. If not, see <http://www.gnu.org/licenses/>.
package definitions
Benjamin Bollen
committed
import (
crypto "github.com/tendermint/go-crypto"
p2p "github.com/tendermint/go-p2p"
tendermint_types "github.com/tendermint/tendermint/types"
rpc_tendermint_types "github.com/eris-ltd/eris-db/rpc/tendermint/core/types"
Benjamin Bollen
committed
)
Benjamin Bollen
committed
// TODO: [ben] explore the value of abstracting the consensus into an interface
// currently we cut a corner here and suffices to have direct calls.
Benjamin Bollen
committed
// for now wrap the interface closely around the available Tendermint functions
Benjamin Bollen
committed
type ConsensusEngine interface {
Benjamin Bollen
committed
// BlockStore
Height() int
LoadBlockMeta(height int) *tendermint_types.BlockMeta
// Peer-2-Peer
IsListening() bool
Listeners() []p2p.Listener
Benjamin Bollen
committed
NodeInfo() *p2p.NodeInfo
Benjamin Bollen
committed
Benjamin Bollen
committed
// Private Validator
PublicValidatorKey() crypto.PubKey