types

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2017 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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(*abci_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