Documentation ¶
Index ¶
Constants ¶
const ( // KeyFile is Tendermint's default file name for the private validator's keys. KeyFile = "priv_validator_key.json" // StateFile is Tendermint's default file name for the private validator's state. StateFile = "priv_validator_state.json" )
const (
// DefaultHTTPPort is the default port which SCFilePV's HTTP server listens on.
DefaultHTTPPort = 8080
)
Variables ¶
var ( // ErrRankObsolete is returned if the requested vote height is too far ahead of the last // block the validator signed. The gap must be at least {threshold} blocks. ErrRankObsolete = errors.New("at least one threshold was exceeded between requested vote height and last_signed_height") )
Functions ¶
func HandleRequest ¶
func HandleRequest(ctx context.Context, msg *tm_privvalproto.Message, pv *SCFilePV) (*tm_privvalproto.Message, error)
HandleRequest handles all incoming requests from the validator.
func KeyFilePath ¶
KeyFilePath returns the absolute path to the priv_validator_key.json file.
func StateFilePath ¶
StateFilePath returns the absolute path to the priv_validator_state.json file.
Types ¶
type SCFilePV ¶
type SCFilePV struct { types.BaseService types.BaseSignCtrled Logger *types.SyncLogger Config config.Config State config.State TMFilePV tm_types.PrivValidator SecretConn net.Conn HTTP *http.Server Gauges types.Gauges }
SCFilePV is a wrapper for tm_privval.FilePV. Implements the SignCtrled interface by embedding BaseSignCtrled. Implements the Service interface by embedding BaseService.
func NewSCFilePV ¶
func NewSCFilePV(logger *types.SyncLogger, cfg config.Config, state config.State, tmpv tm_types.PrivValidator, http *http.Server) *SCFilePV
NewSCFilePV creates a new instance of SCFilePV.
func (*SCFilePV) OnMissedTooMany ¶
func (pv *SCFilePV) OnMissedTooMany()
OnMissedTooMany sets the prometheus gauge for the validator's counter for missed blocks in a row. Implements the SignCtrled interface.
func (*SCFilePV) OnPromote ¶
func (pv *SCFilePV) OnPromote()
OnPromote sets the prometheus gauge for the validator's rank. Implements the SignCtrled interface.
func (*SCFilePV) OnStart ¶
OnStart starts the main loop of the SignCtrled PrivValidator. Implements the Service interface.
func (*SCFilePV) OnStop ¶
OnStop terminates the main loop of the SignCtrled PrivValidator. Implements the Service interface.
func (*SCFilePV) StartHTTPServer ¶
StartHTTPServer starts an HTTP server.
type StatusResponse ¶
type StatusResponse struct { Height int64 `json:"height"` Rank int `json:"rank"` SetSize int `json:"set_size"` Counter int `json:"counter"` Threshold int `json:"threshold"` }
StatusResponse defines the response JSON for status requests.
func GetStatus ¶
func GetStatus() (*StatusResponse, error)
GetStatus retrieves the node's status in terms of current height, rank and blocks missed in a row.