palsp / solrace

The first Drive to Earn (D2E) game build on Solana Blockchain. Aiming to bring the seamless integration of unique racing experience and blockchain mechanics. #D2EGAME
https://solrace.xyz
8 stars 4 forks source link

SOLRACE

SolRace is a blockchain racing game on the Solana blockchain inspired by the Mario kart.

Technology

Game code and deployed game

the code and game can be downloaded from the google drive link here: https://drive.google.com/drive/folders/16On1ksGkRvLx1HPzvb9onXWU-oL0zL5I?usp=sharing

WindowsNoEditor.rar is a fully deployed game, you can extract and run the game on the application file.

GameFile.rar is an unreal project file that can be opened via Unreal Engine Project File (.uproject)

The project file is built in Unreal Engine 4 version 4.26, containing multiple Unreal Engine Asset Files (.uasset). If you want to fully see all the game component's in detail, please download the engine from the link here: https://www.unrealengine.com/en-US/download

Deploy

if you want use our devnet program, please skip this section.

yarn build yarn deploy

create pool for your nft

Set your program id in cli/.env file.

SOL_RACE_STAKING_PROGRAM_ID=

copy the generated types and idl

anchor run copy_types
anchor run copy_types_backend
anchor run copy_types_cli

The following command will do the following.

  1. create mint account of if not exist.
  2. create associate token account for deployer if not exist.
  3. mint token to ata
    yarn init-faucet --name <TOKEN_NAME> --decimals

The initialize pool by run the following

yarn init-pool --pool-name <POOL_NAME> --solr-mint <MINT_ADDRESS> --pool-authority <POOL_AUTHORITY_ADDRESS>

Update the addresses in backend/src/solana/addresses.ts and frontend/src/api/solana/addresses.ts. Theses is what you needed

  1. SOLR_MINT_ADDRESS
  2. GARAGE_CREATOR
  3. GARAGE_CM_ID
  4. KART_CREATOR
  5. KART_CM_ID
  6. SOL_RACE_CORE_PROGRAM_ID

setup aws resource

See the details in aws/README.md

setup metaplex candy machine and nft's assets

See the details in scripts/README.md

setup and start the backend server

See the details in backend/README.md

setup and start the frontend

Set the environment variables. Follow frontend/.env.example for more details

    yarn dev

Program Detail

The program consist of two main features

  1. staking nft (garage)
    • user can stake our nft aka garage to earn SOLR, our governance token.
  1. upgrade (kart)