files

package
v0.0.0-...-bba5479 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect(config Config) error

func MustCollect

func MustCollect(config Config)

func MustCollectFromViper

func MustCollectFromViper()

Types

type Config

type Config struct {
	Indexer                string
	Fullnode               string
	DiscoveryPeersInterval time.Duration `default:"10m"`
	MinPeers               int           `default:"500"`
	Routines               int           `default:"500"`
	RpcBatch               uint64        `default:"200"`
	Mysql                  mysql.Config
}

type Discovery

type Discovery struct {
	// contains filtered or unexported fields
}

func NewDiscovery

func NewDiscovery(client *indexer.Client, config Config) (*Discovery, error)

func (*Discovery) Discover

func (d *Discovery) Discover() error

func (*Discovery) GetPeers

func (d *Discovery) GetPeers() ([]string, map[string]shard.ShardConfig)

type File

type File struct {
	ID          uint64
	TxSeq       uint64    `gorm:"not null; unique"`
	NumErrors   uint64    `gorm:"not null"`
	NumNotSync  uint64    `gorm:"not null"`
	NumSynced   uint64    `gorm:"not null"`
	NumUploaded uint64    `gorm:"not null"`
	NumReplica  int       `gorm:"not null"`
	UpdatedAt   time.Time `gorm:"not null; index"`
}

type Sampler

type Sampler struct {
	// contains filtered or unexported fields
}

func NewSampler

func NewSampler(indexerClient *indexer.Client, w3Client *web3go.Client) (*Sampler, error)

func NewSamplerWithFlow

func NewSamplerWithFlow(flowContractAddress common.Address, w3Client *web3go.Client) (*Sampler, error)

func (*Sampler) Random

func (s *Sampler) Random() uint64

func (*Sampler) Update

func (s *Sampler) Update() error

type ShardCounter

type ShardCounter struct {
	// contains filtered or unexported fields
}

func NewShardCounter

func NewShardCounter() *ShardCounter

func (*ShardCounter) Insert

func (counter *ShardCounter) Insert(config shard.ShardConfig)

func (*ShardCounter) Items

func (counter *ShardCounter) Items() map[uint64]map[uint64]int

func (*ShardCounter) Replica

func (counter *ShardCounter) Replica() int

type Store

type Store struct {
	// contains filtered or unexported fields
}

func MustNewStore

func MustNewStore(config mysql.Config) *Store

func (*Store) MaxTxSeq

func (s *Store) MaxTxSeq() (sql.NullInt64, error)

func (*Store) Upsert

func (s *Store) Upsert(files ...*File) error

Jump to

Keyboard shortcuts

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