contract

package
v0.2.198 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractData

type ContractData struct {
	Contract *model.Contract
	Source   *model.ContractSource
}

type Controller

type Controller struct {
	*task.Task
}

func NewController

func NewController(config *config.Config, startBlockHeight, stopBlockHeight uint64, replaceExisting bool) (self *Controller, err error)

Main class that orchestrates main syncer functionalities Setups listening and storing interactions

type Loader

type Loader struct {
	*task.Task

	Output chan *Payload
	// contains filtered or unexported fields
}

Gets contract's source and init state

func NewLoader

func NewLoader(config *config.Config) (self *Loader)

Converts Arweave transactions into Warp's contracts

func (*Loader) WithClient

func (self *Loader) WithClient(client *arweave.Client) *Loader

func (*Loader) WithDB

func (self *Loader) WithDB(v *gorm.DB) *Loader

func (*Loader) WithInputChannel

func (self *Loader) WithInputChannel(v chan *listener.Payload) *Loader

func (*Loader) WithMonitor

func (self *Loader) WithMonitor(monitor monitoring.Monitor) *Loader

type Payload

type Payload struct {
	BlockHeight    uint64
	BlockTimestamp uint64
	BlockHash      arweave.Base64String
	Data           []*ContractData
}

type Store

type Store struct {
	*task.Processor[*Payload, *ContractData]

	DB *gorm.DB
	// contains filtered or unexported fields
}

Store handles saving data to the database in na robust way. - groups incoming contracts into batches, - ensures data isn't stuck even if a batch isn't big enough

func NewStore

func NewStore(config *config.Config) (self *Store)

func (*Store) WithDB

func (self *Store) WithDB(v *gorm.DB) *Store

func (*Store) WithInputChannel

func (self *Store) WithInputChannel(v chan *Payload) *Store

func (*Store) WithMonitor

func (self *Store) WithMonitor(v monitoring.Monitor) *Store

func (*Store) WithReplaceExistingData

func (self *Store) WithReplaceExistingData(replace bool) *Store

Jump to

Keyboard shortcuts

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