This project includes the boilerplate code for a GenLayer use case implementation, specifically a football bets game.
Configuration file template
An example of an intelligent contract (Football Bets)
npm install -g genlayerDeploy the contract from /contracts/football_bets.py using the GenLayer CLI:
1. Choose the network that you want to use (studionet, localnet, or tesnet-*): genlayer network
2. Execute the deploy command genlayer deploy. This command is going to execute the deploy script located in /deploy/deployScript.ts
/frontend folder..env.example file in the frontend folder and rename it to .env, then fill in the values for your configuration. The provided NEXT_PUBLIC_GENLAYER_RPC_URL value is the backend of the hosted GenLayer Studio./frontend/.env under the variable NEXT_PUBLIC_CONTRACT_ADDRESSExecute the following commands in your terminal:
Using bun:
shell
cd frontend
bun install
bun dev
Using npm:
shell
cd frontend
npm install
npm run dev
The terminal should display a link to access your frontend app (usually at http://localhost:3000/). For more information on the code see GenLayerJS.
requirements.txt file in a virtual environment.shell
gltestThe Football Bets contract allows users to create bets for football matches, resolve those bets, and earn points for correct bets. Here's a breakdown of its main functionalities:
The contract checks if the game has already finished and if the user has already made a bet for this match.
Resolving Bets:
If the Bet was correct, the user earns a point.
Querying Data:
The contract also allows querying of points, either for all players or for a specific player.
Getting Points:
This project includes integration tests that interact with the contract deployed in the Studio. These tests cover the main functionalities of the Football Bets contract:
The tests simulate real-world interactions with the contract, ensuring that it behaves correctly under various scenarios. They use the GenLayer Studio to deploy and interact with the contract, providing a comprehensive check of the contract's functionality in a controlled environment.
To run the tests, use the gltest command as mentioned in the "Steps to run this example" section.
Connect with the GenLayer community to discuss, collaborate, and share insights: - Discord Channel: Our primary hub for discussions, support, and announcements. - Telegram Group: For more informal chats and quick updates.
Your continuous feedback drives better product development. Please engage with us regularly to test, discuss, and improve GenLayer.
For detailed information on how to use GenLayerJS SDK, please refer to our documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
$ claude mcp add genlayer-project-boilerplate \
-- python -m otcore.mcp_server <graph>