store

package
v0.79.0-preview.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const SQLMigrationsDir = "migrations"

Variables

View Source
var (
	ErrTxNotFound      = errors.New("transaction not found")
	ErrMultipleTxFound = errors.New("multiple transactions found")
)
View Source
var EmbedMigrations embed.FS

Functions

func DropAllTablesAndViews added in v0.58.0

func DropAllTablesAndViews(log *logging.Logger, config Config) error

func MigrateToLatestSchema added in v0.58.0

func MigrateToLatestSchema(log *logging.Logger, config Config) error

Types

type Config

type Config struct {
	Postgres             config.PostgresConnection `group:"database" namespace:"postgres"`
	MigrateData          bool                      `` /* 144-byte string literal not displayed */
	MigrateBlockDuration time.Duration             `` /* 144-byte string literal not displayed */
	MigratePauseInterval time.Duration             `` /* 144-byte string literal not displayed */
}

func NewDefaultConfig

func NewDefaultConfig() Config

type Migrator added in v0.74.0

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator is a data migration agent that will migrate tx_results data that is required for providing data for the block explorer APIs. The tx_results table is populated by Tendermint and the number of records can be very large. This causes data migration difficult when there is a need to add additional information to tx_results in order to fulfill requirements for the block explorer APIs. The migration agent will allow migrations to run in the background without blocking upgrades with slow database migration scripts.

func NewMigrator added in v0.74.0

func NewMigrator(pool *pgxpool.Pool, config Config) *Migrator

NewMigrator creates a new data migration agent.

func (*Migrator) Migrate added in v0.74.0

func (m *Migrator) Migrate(ctx context.Context) error

Migrate will run the data migration.

type Store

type Store struct {
	// contains filtered or unexported fields
}

func MustNewStore

func MustNewStore(config Config, log *logging.Logger) *Store

func NewStore

func NewStore(config Config, log *logging.Logger) (*Store, error)

func (*Store) Close added in v0.73.0

func (s *Store) Close()

func (*Store) GetTransaction added in v0.58.0

func (s *Store) GetTransaction(ctx context.Context, txID string) (*pb.Transaction, error)

func (*Store) ListTransactions

func (s *Store) ListTransactions(ctx context.Context,
	filters map[string]string,
	cmdTypes, exclCmdTypes, parties []string,
	first uint32,
	after *entities.TxCursor,
	last uint32,
	before *entities.TxCursor,
) ([]*pb.Transaction, error)

func (*Store) Migrate added in v0.74.0

func (s *Store) Migrate(ctx context.Context) error

Jump to

Keyboard shortcuts

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