relay

package
v0.2.201 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArweaveBlock added in v0.2.40

type ArweaveBlock struct {
	// Arweave Blocks with L1 transactions, parsed from Sequencer's txs
	Message *types.MsgArweaveBlock

	// Corresponding block downloaded from Arweave
	Block *arweave.Block

	// Transactions from the block
	Transactions []*arweave.Transaction

	// L1 interactions parsed from Arweave txs
	Interactions []*model.Interaction

	// Nested bundle with all meta info of txs from the block
	MetaInfoDataItems []*model.DataItem
}

type ArweaveMetaBundler added in v0.2.105

type ArweaveMetaBundler struct {
	*task.Task

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

Uses MsgArweaveBlock messages to create one nested bundle Contains data assigned by the sequencer to interactions in one Arweave block

func NewArweaveMetaBundler added in v0.2.105

func NewArweaveMetaBundler(config *config.Config) (self *ArweaveMetaBundler)

func (*ArweaveMetaBundler) WithInputChannel added in v0.2.105

func (self *ArweaveMetaBundler) WithInputChannel(v <-chan *Payload) *ArweaveMetaBundler

func (*ArweaveMetaBundler) WithMonitor added in v0.2.105

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

type ArweaveParser added in v0.2.40

type ArweaveParser struct {
	*task.Task

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

Parses Arweave transactions into Warp's interactions Passes other payloads through

func NewArweaveParser added in v0.2.40

func NewArweaveParser(config *config.Config) (self *ArweaveParser)

Converts Arweave transactions into Warp's interactions

func (*ArweaveParser) WithInputChannel added in v0.2.40

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

func (*ArweaveParser) WithMonitor added in v0.2.40

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

type Controller

type Controller struct {
	*task.Task
}

func NewController

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

type Decoder added in v0.2.99

type Decoder struct {
	*task.Task

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

Parses Sequencer's blocks into payload This is the first step - decoding sequencer's transactions into messages Messages are processed in another task

func NewDecoder added in v0.2.99

func NewDecoder(config *config.Config) (self *Decoder)

Converts Arweave transactions into Warp's contracts

func (*Decoder) Decode added in v0.2.99

func (self *Decoder) Decode(txBytes []byte) (tx cosmostypes.Tx, err error)

Used by other tasks

func (*Decoder) WithInputChannel added in v0.2.99

func (self *Decoder) WithInputChannel(v chan *types.Block) *Decoder

func (*Decoder) WithMonitor added in v0.2.99

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

type LastArweaveBlockProvider added in v0.2.99

type LastArweaveBlockProvider struct {
	*task.Task

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

Fills the last arweave block in the Payload Upon startup get info from the Sequencer, but later it just caches the info

func NewLastArweaveBlockProvider added in v0.2.99

func NewLastArweaveBlockProvider(config *config.Config) (self *LastArweaveBlockProvider)

Converts Arweave transactions into Warp's contracts

func (*LastArweaveBlockProvider) WithClient added in v0.2.99

func (*LastArweaveBlockProvider) WithDecoder added in v0.2.99

func (self *LastArweaveBlockProvider) WithDecoder(decoder *Decoder) *LastArweaveBlockProvider

func (*LastArweaveBlockProvider) WithInputChannel added in v0.2.99

func (self *LastArweaveBlockProvider) WithInputChannel(v <-chan *Payload) *LastArweaveBlockProvider

func (*LastArweaveBlockProvider) WithMonitor added in v0.2.99

type MsgArweaveBlockParser added in v0.2.99

type MsgArweaveBlockParser struct {
	*task.Task

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

Parses sequencer.sequencer.MsgArweaveBlock

func NewMsgArweaveBlockParser added in v0.2.99

func NewMsgArweaveBlockParser(config *config.Config) (self *MsgArweaveBlockParser)

Converts Arweave transactions into Warp's contracts

func (*MsgArweaveBlockParser) WithInputChannel added in v0.2.99

func (self *MsgArweaveBlockParser) WithInputChannel(v <-chan *Payload) *MsgArweaveBlockParser

func (*MsgArweaveBlockParser) WithMonitor added in v0.2.99

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

type MsgDataItemParser added in v0.2.99

type MsgDataItemParser struct {
	*task.Task

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

Parses Sequencer's blocks into payload

func NewMsgDataItemParser added in v0.2.99

func NewMsgDataItemParser(config *config.Config) (self *MsgDataItemParser)

Converts Arweave transactions into Warp's contracts

func (*MsgDataItemParser) WithInputChannel added in v0.2.99

func (self *MsgDataItemParser) WithInputChannel(v <-chan *Payload) *MsgDataItemParser

func (*MsgDataItemParser) WithMonitor added in v0.2.99

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

type OneBlockDownloader added in v0.2.40

type OneBlockDownloader struct {
	*task.Task

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

Task for filling in the arweave blocks in Payload

func NewOneBlockDownloader added in v0.2.40

func NewOneBlockDownloader(config *config.Config) (self *OneBlockDownloader)

Using Arweave client periodically checks for blocks of transactions

func (*OneBlockDownloader) WithClient added in v0.2.40

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

func (*OneBlockDownloader) WithInputChannel added in v0.2.40

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

func (*OneBlockDownloader) WithMonitor added in v0.2.40

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

type Payload

type Payload struct {
	SequencerBlockHash      bytes.HexBytes
	SequencerBlockHeight    int64
	SequencerBlockTimestamp int64

	// Arweave block height used to generate sort keys for this sequencer height
	LastArweaveBlock *types.ArweaveBlockInfo

	// Raw messages from the block, only decoded
	Messages []cosmostypes.Msg

	// L2 interactions parsed from Sequencer's txs
	Interactions []*model.Interaction

	// Bundle items that will be sent to bundlr.network
	BundleItems []*model.BundleItem

	// Info about Arweave blocks
	ArweaveBlocks []*ArweaveBlock
}

type Source

type Source struct {
	*task.Task

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

Produces a stream of Sequencer's blocks Blocks are put on the Output channel in order of height It uses Streamer to get new blocks from the Sequencer It uses Sequencer's REST API to download historical or missing blocks Handles gaps in the input 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[*Payload, *Payload]

	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) WithIsReplacing added in v0.2.55

func (self *Store) WithIsReplacing(v bool) *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

type TransactionDownloader added in v0.2.70

type TransactionDownloader struct {
	*task.Task

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

Fills in transactions for a given block

func NewTransactionDownloader added in v0.2.70

func NewTransactionDownloader(config *config.Config) (self *TransactionDownloader)

Using Arweave client periodically checks for blocks of transactions

func (*TransactionDownloader) WithClient added in v0.2.70

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

func (*TransactionDownloader) WithInputChannel added in v0.2.70

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

func (*TransactionDownloader) WithMonitor added in v0.2.70

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

Jump to

Keyboard shortcuts

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