sequencer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: LGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name = "shard_sequencer"
)

Functions

This section is empty.

Types

type GetQueryCtxFn added in v1.1.0

type GetQueryCtxFn func(height int64, prove bool) (sdk.Context, error)

GetQueryCtxFn is a function provided by the Cosmos `App` type which gives us a context that can be used in module queries.

type Option

type Option func(*Sequencer)

func WithRouterKey added in v1.1.0

func WithRouterKey(key string) Option

type Sequencer

type Sequencer struct {
	shard.UnimplementedTransactionHandlerServer
	// contains filtered or unexported fields
}

Sequencer handles sequencing game shard transactions.

func New added in v1.1.0

func New(shardKeeper *keeper.Keeper, queryCtxGetter GetQueryCtxFn, opts ...Option) *Sequencer

New returns a new game shard sequencer server. It runs on a default port of 9601, unless the SHARD_SEQUENCER_PORT environment variable is set.

func (*Sequencer) FlushMessages

FlushMessages empties and returns all messages stored in the queue.

func (*Sequencer) QueryTransactions added in v1.1.0

QueryTransactions is a proxy method that calls x/shard's QueryTransactions. This is needed so Cardinal can just run a `Rift` gRPC client, instead of needing to run the `Cosmos` gRPC client.

func (*Sequencer) RegisterGameShard added in v1.1.0

RegisterGameShard saves a namespace <> gRPC address pair for use with Router.

func (*Sequencer) Serve

func (s *Sequencer) Serve()

Serve serves the server in a new go routine.

func (*Sequencer) Submit

Submit appends the game shard tx submission to the tx queue.

type TxQueue

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

TxQueue acts as a transaction queue. Transactions come in to the TxQueue with an epoch.

func NewTxQueue

func NewTxQueue(moduleAddr string) *TxQueue

func (*TxQueue) AddInitMsg added in v1.1.0

func (tc *TxQueue) AddInitMsg(namespace, routerAddr string)

func (*TxQueue) AddTx

func (tc *TxQueue) AddTx(namespace string, epoch, unixTimestamp, txID uint64, payload []byte)

AddTx adds a transaction to the queue.

func (*TxQueue) FlushInitQueue added in v1.1.0

func (tc *TxQueue) FlushInitQueue() []*namespacetypes.UpdateNamespaceRequest

func (*TxQueue) FlushTxQueue added in v1.1.0

func (tc *TxQueue) FlushTxQueue() []*types.SubmitShardTxRequest

FlushTxQueue gets all currently queued transactions sorted by namespace and by transaction ID, and then clears the queue.

Jump to

Keyboard shortcuts

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