Command-line Tools

The race-cli module provides a set of command-line tools that allow developers and players to manage on-chain accounts and interact with Race Protocol games. These tools offer a convenient way to perform various tasks without needing to write custom scripts or interact directly with the blockchain.

Available Commands

The race-cli offers the following commands:

  • publish: This command allows developers to publish their game bundles as NFTs on the blockchain. It takes the game name, symbol, creator address, and path to the WASM bundle as arguments and handles the process of uploading the bundle to decentralized storage and minting the NFT.

  • bundle-info: This command queries the blockchain and displays information about a specific game bundle account, including its name and associated WASM data URI.

  • game-info: This command queries and displays information about a specific game account, including its address, title, bundle address, token address, players, servers, and other relevant data.

  • server-info: This command queries and displays information about a specific server account, including its address and endpoint.

  • create-reg: This command creates a new registration account on the blockchain, which can be either public or private.

  • reg-info: This command queries and displays information about a specific registration account, including its address, ownership status, capacity, and list of registered games.

  • create-game: This command creates a new game account based on a specification file provided as an argument. The specification file contains details like the game title, bundle address, token address, maximum players, and initial game data.

  • close-game: This command allows the game owner to close a game account, provided it is empty.

  • unreg-game: This command removes a game from its associated registration account.

  • create-recipient: This command creates a new recipient account based on a specification file provided as an argument. The specification file defines the slots and initial share distribution within the recipient account.

  • recipient-info: This command queries and displays information about a specific recipient account, including its address, capability address, and details about its slots and shares.

  • claim: This command allows a receiver to claim their share of tokens from a recipient account.

Usage Examples

Here are some examples of how to use the race-cli commands:

  • Publish a game bundle:

race-cli publish MyGame MGN 0x... target/my_game.wasm
  • Query information about a game account:

race-cli game-info solana 0x…
  • Create a new game based on a specification file:

race-cli create-game game_spec.json

These command-line tools provide a convenient and efficient way for developers and players to interact with Race Protocol and manage on-chain accounts, simplifying the development and gameplay experience.

Last updated