irisnet

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: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServicedKeyFile string = "irisnet"
View Source
var ServicedTMCore chains.NodeType = chains.NodeType{Version: "0.32.2", Network: "irishub", ProtocolVersionApp: "2", ProtocolVersionBlock: "9", ProtocolVersionP2p: "5"}

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

Functions

func GenerateKeyFile

func GenerateKeyFile(fileLocation string)

func RegisterConsensusMessages

func RegisterConsensusMessages(cdc *amino.Codec)

func RegisterPacket

func RegisterPacket(cdc *amino.Codec)

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)

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
}

func (*BitArray) Size

func (bA *BitArray) Size() int

Size returns the number of bits in the bitarray

type BlockID

type BlockID struct {
	Hash        cmn.HexBytes  `json:"hash"`
	PartsHeader PartSetHeader `json:"parts"`
}

type BlockPartMessage

type BlockPartMessage struct {
	Height int64
	Round  int
	Part   Part
}

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

func (*BlockPartMessage) String

func (m *BlockPartMessage) String() string

String returns a string representation.

func (*BlockPartMessage) ValidateBasic

func (m *BlockPartMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type CanonicalBlockID

type CanonicalBlockID struct {
	Hash        cmn.HexBytes
	PartsHeader CanonicalPartSetHeader
}

func CanonicalizeBlockID

func CanonicalizeBlockID(blockID BlockID) CanonicalBlockID

type CanonicalPartSetHeader

type CanonicalPartSetHeader struct {
	Hash  cmn.HexBytes
	Total int
}

func CanonicalizePartSetHeader

func CanonicalizePartSetHeader(psh PartSetHeader) CanonicalPartSetHeader

type CanonicalProposal

type CanonicalProposal struct {
	Type      byte  // type alias for byte
	Height    int64 `binary:"fixed64"`
	Round     int64 `binary:"fixed64"`
	POLRound  int64 `binary:"fixed64"`
	BlockID   CanonicalBlockID
	Timestamp time.Time
	ChainID   string
}

func CanonicalizeProposal

func CanonicalizeProposal(chainID string, proposal *Proposal) CanonicalProposal

type CanonicalVote

type CanonicalVote struct {
	Type      byte  // type alias for byte
	Height    int64 `binary:"fixed64"`
	Round     int64 `binary:"fixed64"`
	BlockID   CanonicalBlockID
	Timestamp time.Time
	ChainID   string
}

func CanonicalizeVote

func CanonicalizeVote(chainID string, vote *Vote) CanonicalVote

type ConsensusMessage

type ConsensusMessage interface {
	ValidateBasic() error
}

Consensus Message

type DefaultNodeInfo

type DefaultNodeInfo struct {
	ProtocolVersion ProtocolVersion `json:"protocol_version"`

	ID_        string `json:"id"`          // authenticated identifier
	ListenAddr string `json:"listen_addr"` // accepting incoming

	// Check compatibility.
	// Channels are HexBytes so easier to read as JSON
	Network  string       `json:"network"`  // network/chain ID
	Version  string       `json:"version"`  // major.minor.revision
	Channels cmn.HexBytes `json:"channels"` // channels this node knows about

	// ASCIIText fields
	Moniker string               `json:"moniker"` // arbitrary moniker
	Other   DefaultNodeInfoOther `json:"other"`   // other application specific data
}

type DefaultNodeInfoOther

type DefaultNodeInfoOther struct {
	TxIndex    string `json:"tx_index"`
	RPCAddress string `json:"rpc_address"`
}

DefaultNodeInfoOther is the misc. applcation specific data

type HasVoteMessage

type HasVoteMessage struct {
	Height int64
	Round  int
	Type   byte
	Index  int
}

func (*HasVoteMessage) String

func (m *HasVoteMessage) String() string

String returns a string representation.

func (*HasVoteMessage) ValidateBasic

func (m *HasVoteMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type NewRoundStepMessage

type NewRoundStepMessage struct {
	Height                int64
	Round                 int
	Step                  uint8
	SecondsSinceStartTime int
	LastCommitRound       int
}

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

func (*NewRoundStepMessage) String

func (m *NewRoundStepMessage) String() string

String returns a string representation.

func (*NewRoundStepMessage) ValidateBasic

func (m *NewRoundStepMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type NewValidBlockMessage

type NewValidBlockMessage struct {
	Height           int64
	Round            int
	BlockPartsHeader PartSetHeader
	BlockParts       BitArray
	IsCommit         bool
}

func (*NewValidBlockMessage) String

func (m *NewValidBlockMessage) String() string

String returns a string representation.

func (*NewValidBlockMessage) ValidateBasic

func (m *NewValidBlockMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type P2PConnection

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

type Packet

type Packet interface {
	AssertIsPacket()
}

type PacketMsg

type PacketMsg struct {
	ChannelID byte
	EOF       byte // 1 means message ends here.
	Bytes     []byte
}

func (PacketMsg) AssertIsPacket

func (_ PacketMsg) AssertIsPacket()

func (PacketMsg) String

func (mp PacketMsg) String() string

type PacketPing

type PacketPing struct {
}

func (PacketPing) AssertIsPacket

func (_ PacketPing) AssertIsPacket()

type PacketPong

type PacketPong struct {
}

func (PacketPong) AssertIsPacket

func (_ PacketPong) AssertIsPacket()

type Part

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

type PartSetHeader

type PartSetHeader struct {
	Total int          `json:"total"`
	Hash  cmn.HexBytes `json:"hash"`
}

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 Proposal

type Proposal struct {
	Type      byte
	Height    int64     `json:"height"`
	Round     int       `json:"round"`
	POLRound  int       `json:"pol_round"` // -1 if null.
	BlockID   BlockID   `json:"block_id"`
	Timestamp time.Time `json:"timestamp"`
	Signature []byte    `json:"signature"`
}

type ProposalMessage

type ProposalMessage struct {
	Proposal Proposal
}

ProposalMessage is sent when a new block is proposed.

func (*ProposalMessage) String

func (m *ProposalMessage) String() string

String returns a string representation.

func (*ProposalMessage) ValidateBasic

func (m *ProposalMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type ProposalPOLMessage

type ProposalPOLMessage struct {
	Height           int64
	ProposalPOLRound int
	ProposalPOL      *cmn.BitArray
}

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

func (*ProposalPOLMessage) String

func (m *ProposalPOLMessage) String() string

String returns a string representation.

func (*ProposalPOLMessage) ValidateBasic

func (m *ProposalPOLMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type ProtocolVersion

type ProtocolVersion struct {
	P2P   uint64 `json:"p2p"`
	Block uint64 `json:"block"`
	App   uint64 `json:"app"`
}

type TendermintHandler

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

type Validator

type Validator struct {
	PublicKey ed25519.PubKeyEd25519
	Address   string
}

type Vote

type Vote struct {
	Type             byte         `json:"type"`
	Height           int64        `json:"height"`
	Round            int          `json:"round"`
	BlockID          BlockID      `json:"block_id"` // zero if vote is nil.
	Timestamp        time.Time    `json:"timestamp"`
	ValidatorAddress cmn.HexBytes `json:"validator_address"`
	ValidatorIndex   int          `json:"validator_index"`
	Signature        []byte       `json:"signature"`
}

Vote represents a prevote, precommit, or commit vote from validators for consensus.

func (*Vote) SignBytes

func (vote *Vote) SignBytes(chainID string, cdc *amino.Codec) []byte

type VoteMessage

type VoteMessage struct {
	Vote Vote
}

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

func (*VoteMessage) String

func (m *VoteMessage) String() string

String returns a string representation.

func (*VoteMessage) ValidateBasic

func (m *VoteMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type VoteSetBitsMessage

type VoteSetBitsMessage struct {
	Height  int64
	Round   int
	Type    byte
	BlockID BlockID
	Votes   *cmn.BitArray
}

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

func (*VoteSetBitsMessage) String

func (m *VoteSetBitsMessage) String() string

String returns a string representation.

func (*VoteSetBitsMessage) ValidateBasic

func (m *VoteSetBitsMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type VoteSetMaj23Message

type VoteSetMaj23Message struct {
	Height  int64
	Round   int
	Type    byte
	BlockID BlockID
}

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

func (*VoteSetMaj23Message) String

func (m *VoteSetMaj23Message) String() string

String returns a string representation.

func (*VoteSetMaj23Message) ValidateBasic

func (m *VoteSetMaj23Message) ValidateBasic() error

ValidateBasic performs basic validation.

Directories

Path Synopsis
libs
cli
common
nolint
nolint
errors
Package errors contains errors that are thrown across packages.
Package errors contains errors that are thrown across packages.
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.
log
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.

Jump to

Keyboard shortcuts

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