Blockchain Transport Implementations

The race-transport module provides abstractions and concrete implementations for interacting with different blockchain networks. This allows Race Protocol to be chain-agnostic and enables developers to choose the blockchain that best suits their needs.

Transport Trait

The TransportTtrait defines a set of functions that any blockchain transport implementation must provide. These functions include methods for:

  • Creating and closing game accounts.

  • Registering servers and joining games.

  • Submitting votes and settlements.

  • Querying on-chain data, such as game accounts, game bundles, player profiles, and registrations.

  • Publishing game bundles as NFTs.

  • Creating and managing recipient accounts.

This trait ensures that the core Race Protocol logic can interact with different blockchains in a consistent and standardized manner.

Concrete Implementations

Currently, the race-transport module offers two concrete transport implementations:

  • Solana Transport: This implementation provides functions for interacting with the Solana blockchain. It utilizes the Solana SDK and leverages Solana-specific features, such as PDAs and associated token accounts, to implement the required functionalities.

  • Facade Transport: This implementation interacts with the Facade server, a mock blockchain environment used for local development and testing. It emulates the behavior of a real blockchain and allows developers to test their games without needing to deploy to a live network.

Chain Type and Builder

The ChainTypeenum defines the supported blockchain networks (currently Solana and Facade). The TransportBuilder helps developers create the appropriate transport implementation based on the specified chain type and configuration options.

Extensibility

The race-transport module is designed to be extensible, allowing developers to add support for additional blockchain networks in the future. By implementing the TransportT trait and providing the necessary blockchain-specific logic, new transports can be seamlessly integrated into the Race Protocol framework.

This modular approach to blockchain interaction allows Race Protocol to be flexible and adaptable to the evolving web3 landscape and provides developers with the freedom to choose the blockchain that best meets their requirements.

Last updated