Documentation
¶
Index ¶
Constants ¶
View Source
const ( CodeSuccess = uint32(iota) CodeTxFailed CodeNoResult CodeServerUnresponsive CodeUnsupportedMessage CodeInvalidFormat )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { GetMessageByName(string) (types.Message, bool) GetMessageByID(id types.MessageID) (types.Message, bool) HandleEVMQuery(name string, abiRequest []byte) ([]byte, error) GetPersonaForEVMAddress(string) (string, error) WaitForNextTick() bool AddEVMTransaction(id types.MessageID, msgValue any, tx *sign.Transaction, evmTxHash string) ( tick uint64, txHash types.TxHash, ) ConsumeEVMMsgResult(evmTxHash string) ([]byte, []error, string, bool) }
Provider provides the Router with the necessary functionality to handle API requests from the EVM. The ecs.Engine is expected to implement these methods.
type Router ¶
type Router interface { // SubmitTxBlob submits transactions processed in a tick to the base shard. SubmitTxBlob( ctx context.Context, processedTxs txpool.TxMap, epoch, unixTimestamp uint64, ) error TransactionIterator() iterator.Iterator // Shutdown gracefully stops the EVM gRPC handler. Shutdown() // Start serves the EVM gRPC server. Start() error }
Router provides functionality for Cardinal to interact with the EVM Base Shard. This involves a few responsibilities:
- Receiving API requests from EVM smart contracts on the base shard.
- Sending transactions to the base shard's game sequencer.
- Querying transactions from the base shard to rebuild game state.
Click to show internal directories.
Click to hide internal directories.