Documentation ¶
Index ¶
- Constants
- type Persistence
- func (p *Persistence) AddRecord(record VerificationRecord) (response *VerificationRecord, err error)
- func (p *Persistence) GetENSToBeVerified(now uint64) ([]*VerificationRecord, error)
- func (p *Persistence) GetVerifiedRecord(publicKey string) (*VerificationRecord, error)
- func (p *Persistence) UpdateRecords(records []*VerificationRecord) (err error)
- type VerificationRecord
- type Verifier
- func (v *Verifier) Add(pk, ensName string, clock uint64) (*VerificationRecord, error)
- func (v *Verifier) ENSVerified(pk, ensName string, clock uint64) error
- func (v *Verifier) GetVerifiedRecord(pk string) (*VerificationRecord, error)
- func (v *Verifier) ReverseResolve(address gethcommon.Address) (string, error)
- func (v *Verifier) SetOnline(online bool)
- func (v *Verifier) Start() error
- func (v *Verifier) Stop() error
- func (v *Verifier) Subscribe() chan []*VerificationRecord
Constants ¶
View Source
const ENSBackoffTimeSec uint64 = 30
ENSBackoffTimeSec is the step of the exponential backoff we retry roughly for 17 hours after receiving the message 2^11 * 30
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Persistence ¶
type Persistence struct {
// contains filtered or unexported fields
}
func NewPersistence ¶
func NewPersistence(db *sql.DB) *Persistence
func (*Persistence) AddRecord ¶
func (p *Persistence) AddRecord(record VerificationRecord) (response *VerificationRecord, err error)
AddRecord adds a record or return the latest available if already in the database and hasn't changed
func (*Persistence) GetENSToBeVerified ¶
func (p *Persistence) GetENSToBeVerified(now uint64) ([]*VerificationRecord, error)
func (*Persistence) GetVerifiedRecord ¶ added in v0.90.0
func (p *Persistence) GetVerifiedRecord(publicKey string) (*VerificationRecord, error)
func (*Persistence) UpdateRecords ¶
func (p *Persistence) UpdateRecords(records []*VerificationRecord) (err error)
type VerificationRecord ¶
type VerificationRecord struct { PublicKey string Name string Clock uint64 Verified bool VerifiedAt uint64 VerificationRetries uint64 NextRetry uint64 }
func (*VerificationRecord) CalculateNextRetry ¶
func (e *VerificationRecord) CalculateNextRetry()
We calculate if it's too early to retry, by exponentially backing off
func (*VerificationRecord) Valid ¶
func (e *VerificationRecord) Valid() bool
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
func (*Verifier) Add ¶
func (v *Verifier) Add(pk, ensName string, clock uint64) (*VerificationRecord, error)
func (*Verifier) ENSVerified ¶
ENSVerified adds an already verified entry to the ens table
func (*Verifier) GetVerifiedRecord ¶ added in v0.90.0
func (v *Verifier) GetVerifiedRecord(pk string) (*VerificationRecord, error)
func (*Verifier) ReverseResolve ¶ added in v0.156.1
func (v *Verifier) ReverseResolve(address gethcommon.Address) (string, error)
func (*Verifier) Subscribe ¶
func (v *Verifier) Subscribe() chan []*VerificationRecord
Click to show internal directories.
Click to hide internal directories.