Documentation ¶
Index ¶
- Variables
- type EtcdSigningWrapper
- func (es *EtcdSigningWrapper) GetPubKey() (crypto.PubKey, error)
- func (es *EtcdSigningWrapper) OnStart() error
- func (es *EtcdSigningWrapper) OnStop()
- func (es *EtcdSigningWrapper) SignProposal(chainID string, proposal *tmproto.Proposal) error
- func (es *EtcdSigningWrapper) SignVote(chainID string, vote *tmproto.Vote) error
- type Locker
- func (l *Locker) Disconnect()
- func (l *Locker) TryLock(validatorName, lockType string, height int64, round int) (bool, error)
- func (l *Locker) TryLockCheckHash(validatorName, lockType string, height int64, round int, blockHash string) (bool, error)
- func (l *Locker) TryLockSetHash(validatorName, lockType string, height int64, round int, blockHash string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSignatureRejected indicates that the signature is already locked or locking failed ErrSignatureRejected = errors.New("signature rejected") )
Functions ¶
This section is empty.
Types ¶
type EtcdSigningWrapper ¶
type EtcdSigningWrapper struct { service.BaseService // contains filtered or unexported fields }
EtcdSigningWrapper implements PrivValidator by wrapping the etcd locking around a PrivValidator
func NewEtcdSigningWrapper ¶
func NewEtcdSigningWrapper( logger log.Logger, privVal types.PrivValidator, timeout time.Duration, validatorName string, lockerEndpoints []string, ) *EtcdSigningWrapper
NewEtcdSigningWrapper returns an instance of EtcdSigningWrapper.
func (*EtcdSigningWrapper) GetPubKey ¶
func (es *EtcdSigningWrapper) GetPubKey() (crypto.PubKey, error)
GetPubKey returns the public key of the validator. Implements PrivValidator.
func (*EtcdSigningWrapper) OnStart ¶
func (es *EtcdSigningWrapper) OnStart() error
OnStart implements cmn.Service.
func (*EtcdSigningWrapper) OnStop ¶
func (es *EtcdSigningWrapper) OnStop()
OnStop implements cmn.Service.
func (*EtcdSigningWrapper) SignProposal ¶
func (es *EtcdSigningWrapper) SignProposal(chainID string, proposal *tmproto.Proposal) error
SignProposal signs a canonical representation of the proposal, along with the chainID. Implements PrivValidator.
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker can be used to lock signature steps in Tendermint using etcd to prevent double signing
func (*Locker) Disconnect ¶
func (l *Locker) Disconnect()
Disconnect closes the underlying etcd connection
func (*Locker) TryLock ¶
TryLock tries to lock a specific signature step Returns false if the signature step is already locked
func (*Locker) TryLockCheckHash ¶
func (l *Locker) TryLockCheckHash(validatorName, lockType string, height int64, round int, blockHash string) (bool, error)
TryLockCheckHash tries to lock a specific signature step. This should be used for the precommit step. Returns false if the signature step is already locked
func (*Locker) TryLockSetHash ¶
func (l *Locker) TryLockSetHash(validatorName, lockType string, height int64, round int, blockHash string) (bool, error)
TryLockSetHash tries to lock a specific signature step for this h/r pair. This should be used for the prevote step. Returns false if the signature step is already locked