Documentation
¶
Index ¶
- Variables
- type PairmintFilePV
- func (p *PairmintFilePV) GetPubKey() (tmcrypto.PubKey, error)
- func (p *PairmintFilePV) HandleMessage(msg *privvalproto.Message, pubkey tmcrypto.PubKey, ...) error
- func (p *PairmintFilePV) Missed() error
- func (p *PairmintFilePV) Reset()
- func (p *PairmintFilePV) Run(rwc *connection.ReadWriteConn, pubkey tmcrypto.PubKey, sigCh chan os.Signal)
- func (p *PairmintFilePV) SignProposal(chainID string, proposal *tmproto.Proposal) error
- func (p *PairmintFilePV) SignVote(chainID string, vote *tmproto.Vote) error
- func (p *PairmintFilePV) Update()
- type Pairminter
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMissingPubKey is thrown if there is no priv_validator_key.json // in the configuration directory and thus no pubkey is to be found. ErrMissingPubKey = errors.New("no pubkey found") // ErrNoSigner is thrown if the validator is currently ranked #2 or lower // and is therefore denied signing permissions. ErrNoSigner = errors.New("validator has no permission to sign votes/proposals") // ErrUninitialized is thrown if pairmint has not yet been initialized in // terms of missing a pairmint.toml and the pm-identity.key. ErrUninitialized = errors.New("pairmint is not initialized") // ErrTooManyMissedBlocks is thrown if pairmint exceeds the threshold of // too many missed blocks in a row. ErrTooManyMissedBlocks = errors.New("too many missed blocks in a row") // ErrCatchingUp is thrown if the validator is catching up with the // global blockchain state. ErrCatchingUp = errors.New("validator is catching up") // ErrNoCommitSigs is thrown if the validators /commit endpoint is // not available and no commitsigs can be retrieved. ErrNoCommitSigs = errors.New("couldn't get commitsigs from validator") // ErrWrongChainID is thrown if an incoming request is for a different // chainid than the one specified in the pairmint.toml file. ErrWrongChainID = errors.New("wrong chainid") )
Functions ¶
This section is empty.
Types ¶
type PairmintFilePV ¶
type PairmintFilePV struct {
// Logger is the logger used to log pairmint messages.
Logger *log.Logger
// Config is the node's configuration from the pairmint.toml file.
Config *config.Config
// MissedInARow is the counter used to count missed blocks in a row.
MissedInARow int
// CounterUnlocked is the toggle used for allowing the node to count
// missed blocks in a row.
CounterUnlocked bool
// FilePV is Tendermint's file-based signer.
FilePV *privval.FilePV
// CurrentHeight keeps track of the current height based on the
// messages pairmint receives from the validator. It is used to keep
// track of which height the commitsigs were retrieved at.
CurrentHeight int64
}
PairmintFilePV is a wrapper for Tendermint's FilePV. Implements the Pairminter and PrivValidator interfaces.
func NewPairmintFilePV ¶
func NewPairmintFilePV() *PairmintFilePV
NewPairmintFilePV returns a new instance of PairmintFilePV.
func (*PairmintFilePV) GetPubKey ¶
func (p *PairmintFilePV) GetPubKey() (tmcrypto.PubKey, error)
GetPubKey returns the public key of the validator. Implements the PrivValidator interface.
func (*PairmintFilePV) HandleMessage ¶
func (p *PairmintFilePV) HandleMessage(msg *privvalproto.Message, pubkey tmcrypto.PubKey, rwc *connection.ReadWriteConn) error
HandleMessage handles all incoming messages from Tendermint.
func (*PairmintFilePV) Missed ¶
func (p *PairmintFilePV) Missed() error
Missed implements the Pairminter interface.
func (*PairmintFilePV) Reset ¶
func (p *PairmintFilePV) Reset()
Reset implements the Pairminter interface.
func (*PairmintFilePV) Run ¶
func (p *PairmintFilePV) Run(rwc *connection.ReadWriteConn, pubkey tmcrypto.PubKey, sigCh chan os.Signal)
Run runs the routine for the file-based signer.
func (*PairmintFilePV) SignProposal ¶
func (p *PairmintFilePV) SignProposal(chainID string, proposal *tmproto.Proposal) error
SignProposal signs a canonical representation of the proposal, along with the chainID. Implements the PrivValidator interface.
func (*PairmintFilePV) SignVote ¶
func (p *PairmintFilePV) SignVote(chainID string, vote *tmproto.Vote) error
SignVote signs a canonical representation of the vote, along with the chainID. Implements the PrivValidator interface.
func (*PairmintFilePV) Update ¶
func (p *PairmintFilePV) Update()
Update implements the Pairminter interface.
type Pairminter ¶
type Pairminter interface {
// Missed increments the internal counter for missed blocks in a
// row. Once the threshold of too many missed blocks in a row is
// exceeded, it throws an error.
Missed() error
// Reset resets the counter for missed blocks in a row.
Reset()
// Update performs a rank update, moving all backup nodes up one
// rank and the current signer to the last rank.
Update()
}
Pairminter defines the functionality of a validator that monitors the blockchain for missed blocks in a row and keeps their rank up to date.