ens

package
v0.171.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MPL-2.0, MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 New

func New(node types.Node, logger *zap.Logger, timesource common.TimeSource, db *sql.DB, rpcEndpoint, contractAddress string) *Verifier

func (*Verifier) Add

func (v *Verifier) Add(pk, ensName string, clock uint64) (*VerificationRecord, error)

func (*Verifier) ENSVerified

func (v *Verifier) ENSVerified(pk, ensName string, clock uint64) error

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) SetOnline

func (v *Verifier) SetOnline(online bool)

func (*Verifier) Start

func (v *Verifier) Start() error

func (*Verifier) Stop

func (v *Verifier) Stop() error

func (*Verifier) Subscribe

func (v *Verifier) Subscribe() chan []*VerificationRecord

Jump to

Keyboard shortcuts

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