Skip to content

kali113/somnia2

Repository files navigation

somnia2

Pixel Royale on Somnia Shannon Testnet.

Somnia testnet network info

  • Chain ID: 50312
  • Symbol: STT
  • RPC: https://dream-rpc.somnia.network
  • Explorer: https://shannon-explorer.somnia.network/
  • Faucet: https://cloud.google.com/application/web3/faucet/somnia/shannon

Source: Somnia docs (docs.somnia.network/developer/network-info).

Deploy PixelRoyale contract

  1. Fund your deployer wallet on Shannon faucet.
  2. Add env values in .env.local (or shell):
SOMNIA_DEPLOYER_PRIVATE_KEY=0xYOUR_DEPLOYER_PRIVATE_KEY
SOMNIA_ORCHESTRATOR_ADDRESS=0xYOUR_ORCHESTRATOR_ADDRESS
  1. Deploy:
pnpm deploy:somnia
  1. Use the printed address for:
  • NEXT_PUBLIC_PIXEL_ROYALE_ADDRESS (frontend)
  • GAME_CONTRACT_ADDRESS (backend)

Deployment metadata is written to contracts/deployments/somnia-shannon-50312.json.

Frontend setup

  1. Copy env file and add your deployed game contract:
cp .env.example .env.local
  1. Set the deployed contract address:
NEXT_PUBLIC_PIXEL_ROYALE_ADDRESS=0xYOUR_DEPLOYED_PIXEL_ROYALE_CONTRACT
  1. Install and run:
pnpm install
pnpm dev

Backend setup (orchestrator)

cd server
cp .env.example .env
pnpm install
pnpm dev

Required backend env:

  • GAME_CONTRACT_ADDRESS
  • ORCHESTRATOR_PRIVATE_KEY

GitHub Pages deployment

GitHub Pages does not read your local .env files.

Set repository variable:

  • NEXT_PUBLIC_PIXEL_ROYALE_ADDRESS

The workflow resolves the contract address from:

  • vars.NEXT_PUBLIC_PIXEL_ROYALE_ADDRESS (preferred), or
  • contracts/deployments/somnia-shannon-50312.json (contract.address) if the repo variable is missing.

If neither is present (or the address is invalid), the Pages build fails with a clear error.

Workflow: .github/workflows/deploy-pages.yml

About

somnia

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors