Documentation ¶
Index ¶
- Variables
- type GetQueryCtxFn
- type Option
- type Sequencer
- func (s *Sequencer) FlushMessages() ([]*types.SubmitShardTxRequest, []*namespacetypes.UpdateNamespaceRequest)
- func (s *Sequencer) QueryTransactions(_ context.Context, request *shard.QueryTransactionsRequest) (*shard.QueryTransactionsResponse, error)
- func (s *Sequencer) RegisterGameShard(_ context.Context, req *shard.RegisterGameShardRequest) (*shard.RegisterGameShardResponse, error)
- func (s *Sequencer) Serve()
- func (s *Sequencer) Submit(_ context.Context, req *shard.SubmitTransactionsRequest) (*shard.SubmitTransactionsResponse, error)
- type TxQueue
- func (tc *TxQueue) AddInitMsg(namespace, routerAddr string) error
- func (tc *TxQueue) AddTx(namespace string, epoch, unixTimestamp, txID uint64, payload []byte) error
- func (tc *TxQueue) FlushInitQueue() []*namespacetypes.UpdateNamespaceRequest
- func (tc *TxQueue) FlushTxQueue() []*types.SubmitShardTxRequest
Constants ¶
This section is empty.
Variables ¶
var (
Name = "shard_sequencer"
)
Functions ¶
This section is empty.
Types ¶
type GetQueryCtxFn ¶ added in v1.1.0
GetQueryCtxFn is a function provided by the Cosmos `App` type which gives us a context that can be used in module queries.
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 ¶
func (s *Sequencer) FlushMessages() ([]*types.SubmitShardTxRequest, []*namespacetypes.UpdateNamespaceRequest)
FlushMessages empties and returns all messages stored in the queue.
func (*Sequencer) QueryTransactions ¶ added in v1.1.0
func (s *Sequencer) QueryTransactions( _ context.Context, request *shard.QueryTransactionsRequest, ) (*shard.QueryTransactionsResponse, error)
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
func (s *Sequencer) RegisterGameShard( _ context.Context, req *shard.RegisterGameShardRequest, ) (*shard.RegisterGameShardResponse, error)
RegisterGameShard saves a namespace <> gRPC address pair for use with Router.
func (*Sequencer) Submit ¶
func (s *Sequencer) Submit(_ context.Context, req *shard.SubmitTransactionsRequest) ( *shard.SubmitTransactionsResponse, error, )
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 (*TxQueue) AddInitMsg ¶ added in v1.1.0
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.