iris

package
v0.0.0-...-113e32b Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServicedKeyFile string = "iris"
View Source
var ServicedTMCore chains.NodeType = chains.NodeType{Version: "", Network: "irishub-1", ProtocolVersionApp: "0", ProtocolVersionBlock: "11", ProtocolVersionP2p: "8"}

ServicedTMCore is a string associated with each TM core handler to decipher which handler is to be attached.

Functions

func AsSha256

func AsSha256(o interface{}) string

func CanonicalizeBlockID

func CanonicalizeBlockID(bid tmproto.BlockID) *tmproto.CanonicalBlockID

func CanonicalizePartSetHeader

func CanonicalizePartSetHeader(psh tmproto.PartSetHeader) tmproto.CanonicalPartSetHeader

CanonicalizeVote transforms the given PartSetHeader to a CanonicalPartSetHeader.

func CanonicalizeVote

func CanonicalizeVote(chainID string, vote *tmproto.Vote) tmproto.CanonicalVote

CanonicalizeVote transforms the given Vote to a CanonicalVote, which does not contain ValidatorIndex and ValidatorAddress fields.

func GenerateKeyFile

func GenerateKeyFile(fileLocation string)

func RunDataConnect

func RunDataConnect(peerAddr string,
	marlinTo chan marlinTypes.MarlinMessage,
	marlinFrom chan marlinTypes.MarlinMessage,
	isConnectionOutgoing bool,
	keyFile string,
	listenPort int)

func RunSpamFilter

func RunSpamFilter(rpcAddr string,
	marlinTo chan marlinTypes.MarlinMessage,
	marlinFrom chan marlinTypes.MarlinMessage)

RunSpamFilter serves as the entry point for a TM Core handler when serving as a spamfilter

func VerifyKeyFile

func VerifyKeyFile(fileLocation string) (bool, error)

func VoteSignBytes

func VoteSignBytes(chainID string, vote *tmproto.Vote) []byte

Types

type BlockID

type BlockID struct {
	Hash          []byte        `json:"hash"`
	PartSetHeader PartSetHeader `json:"parts"`
}

-------------------------------------

func BlockIDFromProto

func BlockIDFromProto(bID *tmproto.BlockID) (*BlockID, error)

FromProto sets a protobuf BlockID to the given pointer. It returns an error if the block id is invalid.

func (*BlockID) ToProto

func (blockID *BlockID) ToProto() tmproto.BlockID

type BlockPartMessage

type BlockPartMessage struct {
	Height int64
	Round  int32
	Part   *Part
}

BlockPartMessage is sent when gossipping a piece of the proposed block.

type HasVoteMessage

type HasVoteMessage struct {
	Height int64
	Round  int32
	Type   tmproto.SignedMsgType
	Index  int32
}

HasVoteMessage is sent to indicate that a particular vote has been received.

type Message

type Message interface {
}

Message is a message that can be sent and received on the Reactor

func MsgFromProto

func MsgFromProto(msg *tmcons.Message) (Message, error)

MsgFromProto takes a consensus proto message and returns the native go type

type NewRoundStepMessage

type NewRoundStepMessage struct {
	Height                int64
	Round                 int32
	Step                  int8
	SecondsSinceStartTime int64
	LastCommitRound       int32
}

NewRoundStepMessage is sent for every step taken in the ConsensusState. For every height/round/step transition

type NewValidBlockMessage

type NewValidBlockMessage struct {
	Height             int64
	Round              int32
	BlockPartSetHeader PartSetHeader
	BlockParts         *bits.BitArray
	IsCommit           bool
}

NewValidBlockMessage is sent when a validator observes a valid block B in some round r, i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r. In case the block is also committed, then IsCommit flag is set to true.

type P2PConnection

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

type Part

type Part struct {
	Index uint32       `json:"index"`
	Bytes []byte       `json:"bytes"`
	Proof merkle.Proof `json:"proof"`
}

-------------------------------------

func PartFromProto

func PartFromProto(pb *tmproto.Part) (*Part, error)

type PartSetHeader

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

-------------------------------------

func PartSetHeaderFromProto

func PartSetHeaderFromProto(ppsh *tmproto.PartSetHeader) (*PartSetHeader, error)

FromProto sets a protobuf PartSetHeader to the given pointer

func (*PartSetHeader) ToProto

func (psh *PartSetHeader) ToProto() tmproto.PartSetHeader

ToProto converts PartSetHeader to protobuf

type Proposal

type Proposal struct {
	Type      tmproto.SignedMsgType
	Height    int64     `json:"height"`
	Round     int32     `json:"round"`     // there can not be greater than 2_147_483_647 rounds
	POLRound  int32     `json:"pol_round"` // -1 if null.
	BlockID   BlockID   `json:"block_id"`
	Timestamp time.Time `json:"timestamp"`
	Signature []byte    `json:"signature"`
}

func ProposalFromProto

func ProposalFromProto(pp *tmproto.Proposal) (*Proposal, error)

FromProto sets a protobuf Proposal to the given pointer. It returns an error if the proposal is invalid.

type ProposalMessage

type ProposalMessage struct {
	Proposal *Proposal
}

ProposalMessage is sent when a new block is proposed.

type ProposalPOLMessage

type ProposalPOLMessage struct {
	Height           int64
	ProposalPOLRound int32
	ProposalPOL      *bits.BitArray
}

ProposalPOLMessage is sent when a previous proposal is re-proposed.

type TendermintHandler

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

type Validator

type Validator struct {
	PublicKey ed25519.PubKey
	Address   string
}

type Vote

type Vote struct {
	Type             tmproto.SignedMsgType `json:"type"`
	Height           int64                 `json:"height"`
	Round            int32                 `json:"round"`    // assume there will not be greater than 2_147_483_647 rounds
	BlockID          BlockID               `json:"block_id"` // zero if vote is nil.
	Timestamp        time.Time             `json:"timestamp"`
	ValidatorAddress crypto.Address        `json:"validator_address"`
	ValidatorIndex   int32                 `json:"validator_index"`
	Signature        []byte                `json:"signature"`
}

-------------------------------------

func VoteFromProto

func VoteFromProto(pv *tmproto.Vote) (*Vote, error)

FromProto converts a proto generetad type to a handwritten type return type, nil if everything converts safely, otherwise nil, error

func (*Vote) ToProto

func (vote *Vote) ToProto() *tmproto.Vote

ToProto converts the handwritten type to proto generated type return type, nil if everything converts safely, otherwise nil, error

type VoteMessage

type VoteMessage struct {
	Vote *Vote
}

VoteMessage is sent when voting for a proposal (or lack thereof).

type VoteSetBitsMessage

type VoteSetBitsMessage struct {
	Height  int64
	Round   int32
	Type    tmproto.SignedMsgType
	BlockID BlockID
	Votes   *bits.BitArray
}

VoteSetBitsMessage is sent to communicate the bit-array of votes seen for the BlockID.

type VoteSetMaj23Message

type VoteSetMaj23Message struct {
	Height  int64
	Round   int32
	Type    tmproto.SignedMsgType
	BlockID BlockID
}

VoteSetMaj23Message is sent to indicate that a given BlockID has seen +2/3 votes.

Directories

Path Synopsis
merkle
Package merkle computes a deterministic minimal height Merkle tree hash.
Package merkle computes a deterministic minimal height Merkle tree hash.
xchacha20poly1305
Package xchacha20poly1305 creates an AEAD using hchacha, chacha, and poly1305 This allows for randomized nonces to be used in conjunction with chacha.
Package xchacha20poly1305 creates an AEAD using hchacha, chacha, and poly1305 This allows for randomized nonces to be used in conjunction with chacha.
libs
cli
events
Package events - Pub-Sub in go with event caching
Package events - Pub-Sub in go with event caching
flowrate
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
json
Package json provides functions for marshaling and unmarshaling JSON in a format that is backwards-compatible with Amino JSON encoding.
Package json provides functions for marshaling and unmarshaling JSON in a format that is backwards-compatible with Amino JSON encoding.
log
net
os
pubsub
Package pubsub implements a pub-sub model with a single publisher (Server) and multiple subscribers (clients).
Package pubsub implements a pub-sub model with a single publisher (Server) and multiple subscribers (clients).
pubsub/query
Package query provides a parser for a custom query format: abci.invoice.number=22 AND abci.invoice.owner=Ivan See query.peg for the grammar, which is a https://en.wikipedia.org/wiki/Parsing_expression_grammar.
Package query provides a parser for a custom query format: abci.invoice.number=22 AND abci.invoice.owner=Ivan See query.peg for the grammar, which is a https://en.wikipedia.org/wiki/Parsing_expression_grammar.
proto

Jump to

Keyboard shortcuts

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