warpy_sync

package
v0.2.187 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDownloader

type BlockDownloader struct {
	*task.Task

	Output        chan *BlockInfoPayload
	OutputPollTxs chan uint64
	// contains filtered or unexported fields
}

func NewBlockDownloader

func NewBlockDownloader(config *config.Config) (self *BlockDownloader)

When started, this task checks database for the latest block synced and store the result in lastSyncedBlockHeight field Then, compare lastSyncedBlockHeight to the current external network's block height and loads info for all of the missing blocks for the indicated range Lastly, it emits to the Output channel block's height, block's hash and all transactions that this block contains and update lastSyncedBlockHeight to the last processed block

func (*BlockDownloader) WithEthClient

func (self *BlockDownloader) WithEthClient(ethClient *ethclient.Client) *BlockDownloader

func (*BlockDownloader) WithInitStartBlockHeight

func (self *BlockDownloader) WithInitStartBlockHeight(db *gorm.DB, syncedComponent model.SyncedComponent) *BlockDownloader

func (*BlockDownloader) WithMonitor

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

func (*BlockDownloader) WithPollerCron added in v0.2.186

func (self *BlockDownloader) WithPollerCron() *BlockDownloader

type BlockInfoPayload

type BlockInfoPayload struct {
	Transactions types.Transactions
	Height       uint64
	Hash         string
	Timestamp    uint64
}

type Controller

type Controller struct {
	*task.Task
}

func NewController

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

type Input

type Input struct {
	Function string   `json:"function"`
	Points   int64    `json:"points"`
	AdminId  string   `json:"adminId"`
	Members  []Member `json:"members"`
	NoBoost  bool     `json:"noBoost"`
}

func (Input) MarshalJSON

func (input Input) MarshalJSON() ([]byte, error)

type InteractionPayload

type InteractionPayload struct {
	FromAddress string
	Points      int64
}

type LastSyncedBlockPayload

type LastSyncedBlockPayload struct {
	Height    uint64
	Hash      string
	Timestamp uint64
}

type Member

type Member struct {
	Id    string   `json:"id"`
	Roles []string `json:"roles"`
	TxId  string   `json:"txId"`
}

type PollerSommelier

type PollerSommelier struct {
	*task.Task

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

func NewPollerSommelier

func NewPollerSommelier(config *config.Config) (self *PollerSommelier)

func (*PollerSommelier) WithDB

func (self *PollerSommelier) WithDB(db *gorm.DB) *PollerSommelier

func (*PollerSommelier) WithInputChannel added in v0.2.186

func (self *PollerSommelier) WithInputChannel(v chan uint64) *PollerSommelier

func (*PollerSommelier) WithMonitor

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

type SommelierTransactionPayload

type SommelierTransactionPayload struct {
	Transaction *types.Transaction
	FromAddress string
	Block       *BlockInfoPayload
	Method      *abi.Method
	ParsedInput []byte
	Input       map[string]interface{}
}

type Store

type Store struct {
	*task.Processor[*LastSyncedBlockPayload, *LastSyncedBlockPayload]
	// contains filtered or unexported fields
}

Store is responsible for saving last synced block height in sync_state table It updates the table periodically to not overload database with updates done each time after new block has been processed

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 *LastSyncedBlockPayload) *Store

func (*Store) WithMonitor

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

func (*Store) WithSyncedComponent

func (self *Store) WithSyncedComponent(syncedComponent model.SyncedComponent) *Store

type StoreSommelier

type StoreSommelier struct {
	*task.Task
	// contains filtered or unexported fields
}

func NewStoreSommelier

func NewStoreSommelier(config *config.Config) (self *StoreSommelier)

func (*StoreSommelier) WithDB

func (self *StoreSommelier) WithDB(db *gorm.DB) *StoreSommelier

func (*StoreSommelier) WithInputChannel

func (self *StoreSommelier) WithInputChannel(v chan *SommelierTransactionPayload) *StoreSommelier

func (*StoreSommelier) WithMonitor

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

type SyncerDelta

type SyncerDelta struct {
	*task.Task

	Output                   chan *LastSyncedBlockPayload
	OutputInteractionPayload chan *InteractionPayload
	// contains filtered or unexported fields
}

func NewSyncerDelta

func NewSyncerDelta(config *config.Config) (self *SyncerDelta)

This task receives block info in the input channel, iterate through all of the block's transactions in order to check if any of it contains Redstone data and if so - writes an interaction to Warpy. It emits block height and block hash in the Output channel

func (*SyncerDelta) WithInputChannel

func (self *SyncerDelta) WithInputChannel(v chan *BlockInfoPayload) *SyncerDelta

func (*SyncerDelta) WithMonitor

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

type SyncerSommelier

type SyncerSommelier struct {
	*task.Task

	Output                   chan *LastSyncedBlockPayload
	OutputTransactionPayload chan *SommelierTransactionPayload
	// contains filtered or unexported fields
}

func NewSyncerSommelier

func NewSyncerSommelier(config *config.Config) (self *SyncerSommelier)

This task receives block info in the input channel, iterate through all of the block's transactions in order to check if any contains Sommelier transaction and saves transaction in the db

func (*SyncerSommelier) WithContractAbi

func (self *SyncerSommelier) WithContractAbi(contractAbi *abi.ABI) *SyncerSommelier

func (*SyncerSommelier) WithDb

func (self *SyncerSommelier) WithDb(v *gorm.DB) *SyncerSommelier

func (*SyncerSommelier) WithInputChannel

func (self *SyncerSommelier) WithInputChannel(v chan *BlockInfoPayload) *SyncerSommelier

func (*SyncerSommelier) WithMonitor

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

type Writer

type Writer struct {
	*task.Task
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(config *config.Config) (self *Writer)

func (*Writer) WithInputChannel

func (self *Writer) WithInputChannel(v chan *InteractionPayload) *Writer

func (*Writer) WithMonitor

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

func (*Writer) WithSequencerClient

func (self *Writer) WithSequencerClient(sequencerClient *sequencer.Client) *Writer

Jump to

Keyboard shortcuts

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