Welcome to ByteBeasts Tamagotchi Game! 🎮 This interactive web-based game brings to life the magical creatures of Etheria known as ByteBeast. 🐾 Players act as guardians responsible for nurturing and caring for their Beasts, building a unique bond, and ensuring their companion grows strong and healthy. 💖
To run the frontend locally over HTTPS (required for Controller), follow these steps:
Open a terminal and run:
brew install mkcertmkcert is a simple tool for making locally-trusted development certificates.
Run the following commands in the project root (or in the client folder):
mkcert -install
mkcert localhostThis will generate the files:
localhost.pem(certificate)localhost-key.pem(private key)
In your vite.config.ts, add the following server configuration:
import fs from 'fs';
export default defineConfig({
server: {
https: {
key: fs.readFileSync('localhost-key.pem'),
cert: fs.readFileSync('localhost.pem'),
},
},
});Make sure you're inside the client directory, then install dependencies and run the app:
cd client
pnpm install
pnpm run devEnsure the HTTPS certificates (
localhost.pemandlocalhost-key.pem) are present in the root of theclientproject.
- Node.js (make sure it’s installed)
- pnpm (recommended for managing dependencies)
Ensure the following dependencies are installed:
- Dojo:
v1.2.1 - Scarb:
v2.9.2
To compile the smart contracts:
sozo buildTo execute the test suite:
sozo testInstructions for local and testnet deployment are provided below.
Launch a local Starknet node:
katana --disable-fee --allowed-origins "*"# Build the contracts
sozo build
# Deploy the world locally
sozo migrate
# Start the Torii indexer
torii --world <WORLD_ADDRESS> --allowed-origins "*"Replace
<WORLD_ADDRESS>with the address returned bysozo migrate.
cp .env.example .env.sepoliaEdit .env.sepolia and provide the following:
STARKNET_RPC_URL→https://api.cartridge.gg/x/starknet/sepoliaDOJO_ACCOUNT_ADDRESS→ Your deployment account addressDOJO_PRIVATE_KEY→ Your deployment private key
⚠️ Ensure this account is funded before proceeding.
source .env.sepoliascarb run sepoliaAfter deployment, the CLI will output your world address, which is required to interact with the deployed game.
- At this point you should have a new manufest for sepolia here
dojo/manifest_sepolia.jsoncopy the whole file to the front end manifestclient/src/dojo/manifest_dev.json - There are the new contract address for the actiond and the world address, copy the world address and make sure It's the same in thie file
dojo/torii-config.toml - Copy the contract address for the game contract and the player contract and paste It in the
client/src/config/cartridgeConnector.tsxfile in the variablesCONTRACT_ADDRESS_TAMAGOTCHI_SYSTEMandCONTRACT_ADDRESS_PLAYER_SYSTEM+ go to this fileclient/src/utils/tamagotchi.tsxand update the address for fetch age and status with the game contract adrress - Now, let's create a new Torii for the new world address, please make sure you have latest
slotupversion, make sure you are in the dojo folder in your terminal, and execute this command
slot auth login
slot d create [name of the torii] torii --config ./torii-config.toml --version v1.5.1
or try
slot deployments create DEPLOYMENT_NAME torii --world YOUR_WORLD_ADDRESS --rpc YOUR_NEW_RPC_URL- Use that new torii name to replace It in these files
client/src/dojo/dojoConfig.ts(line 17) +client/src/config/cartridgeConnector.tsx(line 102) - Last step, update your env file with the new Torii address
- Run de app
Here is an example of a clean integration of the new sepolia contracts https://github.com/ByteBuildersLabs/Tamagotchi/commit/2742f7e79c5aa0191519e5a1d7b163953569cd28
Rolando |
Luis |
Marco |
Daniel |




