sync

package
v0.1.224 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	*task.Task
}

func NewController

func NewController(config *config.Config) (self *Controller, err error)

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

type Parser

type Parser struct {
	*task.Task

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

Gets contract's source and init state

func NewParser

func NewParser(config *config.Config) (self *Parser)

Converts Arweave transactions into Warp's contracts

func (*Parser) WithInputChannel

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

func (*Parser) WithMonitor

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

type Payload

type Payload struct {
	BlockHeight    uint64
	BlockHash      arweave.Base64String
	BlockTimestamp uint64
	Interactions   []*model.Interaction
}

type Store

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

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

Store handles saving data to the database in na robust way. - groups incoming Interactions 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

Jump to

Keyboard shortcuts

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