db

package
v0.0.30 Latest Latest
Warning

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

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

Documentation

Overview

Package db contains the database implementation for the relayer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCTPRelayerDB

type CCTPRelayerDB interface {
	CCTPRelayerDBReader
	CCTPRelayerDBWriter
	SubmitterDB() submitterDB.Service
}

CCTPRelayerDB is the interface for the database service.

type CCTPRelayerDBReader

type CCTPRelayerDBReader interface {
	// GetLastBlockNumber gets the last block number that had a message for the respective origin chain in the database.
	GetLastBlockNumber(ctx context.Context, chainID uint32) (uint64, error)
	// GetMessagesByState gets all messages with the given state.
	GetMessagesByState(ctx context.Context, states ...types.MessageState) ([]types.Message, error)
	// GetMessageByOriginHash gets a message by its origin hash.
	GetMessageByOriginHash(ctx context.Context, originHash common.Hash) (*types.Message, error)
	// GetMessageByRequestID gets a message by its request id.
	GetMessageByRequestID(ctx context.Context, requestID string) (*types.Message, error)
}

CCTPRelayerDBReader is the interface for reading from the database.

type CCTPRelayerDBWriter

type CCTPRelayerDBWriter interface {
	// StoreMessage stores a message in the database.
	StoreMessage(ctx context.Context, message types.Message) error
}

CCTPRelayerDBWriter is the interface for writing to the database.

Directories

Path Synopsis
sql
Package sql provides a common interface for starting sql-lite databases
Package sql provides a common interface for starting sql-lite databases
base
Package base contains the base sql implementation
Package base contains the base sql implementation
mysql
Package mysql contains a mysql db
Package mysql contains a mysql db
sqlite
Package sqlite implements the sqlite package
Package sqlite implements the sqlite package

Jump to

Keyboard shortcuts

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