relay

package
v0.1.289 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 15 Imported by: 0

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)

type Payload

type Payload struct {
	BlockHash      arweave.Base64String
	BlockHeight    int64
	BlockTimestamp int64
	Transactions   []*arweave.Transaction
}

type Source

type Source struct {
	*task.Task

	Output chan *types.Block
	// contains filtered or unexported fields
}

Produces a stream of Sequencer's blocks It uses Streamer to get new blocks from the Sequencer It uses Sequencer's REST API for downloading historical blocks Downloads historical blocks in case there's a gap in the stream

func NewSource

func NewSource(config *config.Config) (self *Source)

func (*Source) WithClient

func (self *Source) WithClient(client *rpchttp.HTTP) *Source

func (*Source) WithDB

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

func (*Source) WithInputChannel

func (self *Source) WithInputChannel(input <-chan *types.Block) *Source

func (*Source) WithMonitor

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

type Store

type Store struct {
	*task.Processor[*types.Block, types.Tx]

	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 *types.Block) *Store

func (*Store) WithMonitor

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

type Streamer

type Streamer struct {
	*task.Task

	Output chan *types.Block
	// contains filtered or unexported fields
}

Streams new blocks from the sequencer

func NewStreamer

func NewStreamer(config *config.Config) (self *Streamer)

Maintains a persistent websocket connection to the sequencer Gets new blocks through the websocket

func (*Streamer) Pause

func (self *Streamer) Pause()

func (*Streamer) Resume

func (self *Streamer) Resume()

func (*Streamer) WithClient

func (self *Streamer) WithClient(client *rpchttp.HTTP) *Streamer

func (*Streamer) WithMonitor

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

Jump to

Keyboard shortcuts

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