Game Registration
Game registration is simple and easy as deploying a smart contract to Mina. You can deploy your game contract to Mina by using the Deploy Script (opens in a new tab).
Manual Deployment
Create a .env file in the root of the project and add the following variables:
MINA_NODE_URL=
MINA_ARCHIVE_URL=
GAME_TOKEN_NAME=
PUBLISHER_KEY=
GAMEPRICE=
DISCOUNT=
TIMEOUTINTERVAL=
MAXDEVICEALLOWED=
MINA_NODE_URL
- Default Mina node URL ishttps://api.minascan.io/node/devnet/v1/graphql
MINA_ARCHIVE_URL
- Default Mina archive URL ishttps://api.minascan.io/archive/devnet/v1/graphql
GAME_TOKEN_NAME
- Name of the game token you want to create, default isDRM
PUBLISHER_KEY
- FeePayer and game creator's private keyGAMEPRICE
- Price of the game in Mina (in nano mina)DISCOUNT
- Discount for the game in Mina (in nano mina)TIMEOUTINTERVAL
- Timeout interval for the game in ms. Default is 600000 ms.MAXDEVICEALLOWED
- Maximum number of devices allowed to play the game. Default is 4, also maximum is 4.
Build and deploy the game contract by running the following command:
cd contracts
pnpm run build
node build/src/scripts/gameDeployer.js
After the deployment, you will get the GameToken contract address, DRM contract address and their private keys.
Using the Web App to Deploy (Recommended)
You can also use the website (opens in a new tab) to deploy the game contract. The Web App collect and validate the required information and create deployment to Mina for you.
In the Register Game (opens in a new tab) page fill the required information and click on the Deploy Game Token
button. After the deployment, you will get the GameToken contract address, DRM contract address and their private keys. Please save them for future use (never share your private keys with anyone).
Update Game Contract
You can update the game contract by using the web app. In the Register Game (opens in a new tab) page, click on the GameToken Update
section and fetch your contract, fill the required information. After filling the information, click on the Update Game Token
button and approve the transaction in your wallet.