shard

package
v1.0.2-beta Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	WriteAdapter
	QueryAdapter
}

Adapter is a type that helps facilitate communication with the EVM base shard.

func NewAdapter

func NewAdapter(cfg AdapterConfig, opts ...Option) (Adapter, error)

type AdapterConfig

type AdapterConfig struct {
	// ShardSequencerAddr is the address to submit transactions to the EVM base shard's game shard sequencer server.
	ShardSequencerAddr string

	// EVMBaseShardAddr is the address to query the EVM base shard's shard storage cosmos module.
	EVMBaseShardAddr string
}

type Option

type Option func(adapter *adapterImpl)

func WithCredentials

func WithCredentials(credPath string) Option

type QueryAdapter

type QueryAdapter interface {
	// QueryTransactions queries transactions stored on-chain. This is primarily used to rebuild state during world
	// recovery.
	QueryTransactions(
		context.Context,
		*shardtypes.QueryTransactionsRequest) (*shardtypes.QueryTransactionsResponse, error)
}

QueryAdapter provides the functionality to query transactions from the EVM base shard.

type WriteAdapter

type WriteAdapter interface {
	// Submit submits a transaction to the EVM base shard's game tx sequencer, where the tx data will be sequenced and
	// stored on chain.
	Submit(ctx context.Context, p *sign.Transaction, txID, epoch uint64) error
}

WriteAdapter provides the functionality to send transactions to the EVM base shard.

Jump to

Keyboard shortcuts

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