old

package
v0.0.0-...-089bed4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitArray

type BitArray struct {
	Bits  int      `json:"bits"`  // NOTE: persisted via reflect, must be exported
	Elems []uint64 `json:"elems"` // NOTE: persisted via reflect, must be exported
	// contains filtered or unexported fields
}

type Block

type Block struct {
	*Header    `json:"header"`
	*Data      `json:"data"`
	LastCommit *Commit `json:"last_commit"`
}

type BlockMeta

type BlockMeta struct {
	Hash        []byte        `json:"hash"`         // The block hash
	Header      *Header       `json:"header"`       // The block's Header
	PartsHeader PartSetHeader `json:"parts_header"` // The PartSetHeader, for transfer
}

type BlockStoreStateJSON

type BlockStoreStateJSON struct {
	Height int
}

type Commit

type Commit struct {
	// NOTE: The Precommits are in order of address to preserve the bonded ValidatorSet order.
	// Any peer with a block can gossip precommits by index with a peer without recalculating the
	// active ValidatorSet.
	Precommits []*Vote `json:"precommits"`
	// contains filtered or unexported fields
}

type ConsensusLogMessage

type ConsensusLogMessage struct {
	Time time.Time                    `json:"time"`
	Msg  ConsensusLogMessageInterface `json:"msg"`
}

cswal

type ConsensusLogMessageInterface

type ConsensusLogMessageInterface interface{}

type ConsensusMessage

type ConsensusMessage interface{}

type Data

type Data struct {
	// Txs that will be applied by state @ block.Height+1.
	// NOTE: not all txs here are valid.  We're just agreeing on the order first.
	// This means that block.AppHash does not include these txs.
	Txs Txs `json:"txs"`
	// contains filtered or unexported fields
}

type DefaultSigner

type DefaultSigner struct {
	// contains filtered or unexported fields
}

Implements Signer

func NewDefaultSigner

func NewDefaultSigner(priv crypto.PrivKey) *DefaultSigner

func (*DefaultSigner) Sign

func (ds *DefaultSigner) Sign(msg []byte) crypto.Signature

Implements Signer

type EventDataRoundState

type EventDataRoundState struct {
	Height int    `json:"height"`
	Round  int    `json:"round"`
	Step   string `json:"step"`
	// private, not exposed to websockets
	RoundState interface{} `json:"-"`
}

0x01

type GenesisDoc

type GenesisDoc struct {
	GenesisTime time.Time          `json:"genesis_time"`
	ChainID     string             `json:"chain_id"`
	Validators  []GenesisValidator `json:"validators"`
	AppHash     []byte             `json:"app_hash"`
}

func GenesisDocFromJSON

func GenesisDocFromJSON(jsonBlob []byte) (genState *GenesisDoc)

type GenesisValidator

type GenesisValidator struct {
	PubKey crypto.PubKey `json:"pub_key"`
	Amount int64         `json:"amount"`
	Name   string        `json:"name"`
}
type Header struct {
	ChainID        string        `json:"chain_id"`
	Height         int           `json:"height"`
	Time           time.Time     `json:"time"`
	NumTxs         int           `json:"num_txs"`
	LastBlockHash  []byte        `json:"last_block_hash"`
	LastBlockParts PartSetHeader `json:"last_block_parts"`
	LastCommitHash []byte        `json:"last_commit_hash"`
	DataHash       []byte        `json:"data_hash"`
	ValidatorsHash []byte        `json:"validators_hash"`
	AppHash        []byte        `json:"app_hash"` // state merkle root of txs from the previous block
}

type MsgInfo

type MsgInfo struct {
	Msg     ConsensusMessage `json:"msg"`
	PeerKey string           `json:"peer_key"`
}

0x02

type Part

type Part struct {
	Index int                `json:"index"`
	Bytes []byte             `json:"bytes"`
	Proof merkle.SimpleProof `json:"proof"`
	// contains filtered or unexported fields
}

type PartSetHeader

type PartSetHeader struct {
	Total int    `json:"total"`
	Hash  []byte `json:"hash"`
}

type PrivValidator

type PrivValidator struct {
	Address       []byte           `json:"address"`
	PubKey        crypto.PubKey    `json:"pub_key"`
	LastHeight    int              `json:"last_height"`
	LastRound     int              `json:"last_round"`
	LastStep      int8             `json:"last_step"`
	LastSignature crypto.Signature `json:"last_signature"` // so we dont lose signatures
	LastSignBytes []byte           `json:"last_signbytes"` // so we dont lose signatures
	// PrivKey should be empty if a Signer other than the default is being used.
	PrivKey crypto.PrivKey `json:"priv_key"`
	Signer  `json:"-"`
	// contains filtered or unexported fields
}

func LoadPrivValidator

func LoadPrivValidator(filePath string) *PrivValidator

type RoundStepType

type RoundStepType uint8 // These must be numeric, ordered.

type Signer

type Signer interface {
	Sign(msg []byte) crypto.Signature
}

type State

type State struct {
	GenesisDoc      *GenesisDoc
	ChainID         string
	LastBlockHeight int // Genesis state has this set to 0.  So, Block(H=0) does not exist.
	LastBlockHash   []byte
	LastBlockParts  PartSetHeader
	LastBlockTime   time.Time
	Validators      *ValidatorSet
	LastValidators  *ValidatorSet
	AppHash         []byte
	// contains filtered or unexported fields
}

type TimeoutInfo

type TimeoutInfo struct {
	Duration time.Duration `json:"duration"`
	Height   int           `json:"height"`
	Round    int           `json:"round"`
	Step     RoundStepType `json:"step"`
}

0x03 internally generated messages which may update the state

type Tx

type Tx []byte

type Txs

type Txs []Tx

type Validator

type Validator struct {
	Address          []byte        `json:"address"`
	PubKey           crypto.PubKey `json:"pub_key"`
	LastCommitHeight int           `json:"last_commit_height"`
	VotingPower      int64         `json:"voting_power"`
	Accum            int64         `json:"accum"`
}

type ValidatorSet

type ValidatorSet struct {
	Validators []*Validator // NOTE: persisted via reflect, must be exported.
	// contains filtered or unexported fields
}

type Vote

type Vote struct {
	Height           int                     `json:"height"`
	Round            int                     `json:"round"`
	Type             byte                    `json:"type"`
	BlockHash        []byte                  `json:"block_hash"`         // empty if vote is nil.
	BlockPartsHeader PartSetHeader           `json:"block_parts_header"` // zero if vote is nil.
	Signature        crypto.SignatureEd25519 `json:"signature"`
}

Jump to

Keyboard shortcuts

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