types

package
v0.12.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2016 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusEngine

type ConsensusEngine interface {
	// Peer-2-Peer
	IsListening() bool
	Listeners() []p2p.Listener
	NodeInfo() *p2p.NodeInfo
	Peers() []*Peer

	// Private Validator
	PublicValidatorKey() crypto.PubKey

	// Memory pool
	BroadcastTransaction(transaction []byte,
		callback func(*tmsp_types.Response)) error

	// Events
	// For consensus events like NewBlock
	Events() event.EventEmitter

	// List pending transactions in the mempool, passing 0 for maxTxs gets an
	// unbounded number of transactions
	ListUnconfirmedTxs(maxTxs int) ([]txs.Tx, error)
	ListValidators() []Validator
	ConsensusState() *ConsensusState
	// TODO: Consider creating a real type for PeerRoundState, but at the looks
	// quite coupled to tendermint
	PeerConsensusStates() map[string]string
}

type ConsensusState

type ConsensusState struct {
	Height     int                        `json:"height"`
	Round      int                        `json:"round"`
	Step       uint8                      `json:"step"`
	StartTime  time.Time                  `json:"start_time"`
	CommitTime time.Time                  `json:"commit_time"`
	Validators []Validator                `json:"validators"`
	Proposal   *tendermint_types.Proposal `json:"proposal"`
}

ConsensusState

type Peer

type Peer struct {
	NodeInfo   *p2p.NodeInfo `json:"node_info"`
	IsOutbound bool          `json:"is_outbound"`
}

type TendermintValidator

type TendermintValidator struct {
	*tendermint_types.Validator `json:"validator"`
}

Anticipating moving to our own definition of Validator, or at least augmenting Tendermint's.

func (*TendermintValidator) Address

func (tendermintValidator *TendermintValidator) Address() []byte

func (*TendermintValidator) AssertIsValidator

func (tendermintValidator *TendermintValidator) AssertIsValidator()

type Validator

type Validator interface {
	AssertIsValidator()
	Address() []byte
}

func FromTendermintValidators

func FromTendermintValidators(tmValidators []*tendermint_types.Validator) []Validator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL