Scaffold the repository
Generate a new challenge repository from the template with the challenge CLI:create command renders the challenge template into the destination path and reports how many files were written. You can pass --name, --image, and --version to override the defaults, and --overwrite to replace existing files.
The template is rendered from a ChallengeTemplateContext built from the slug: the slug becomes the package name, display name, and the GHCR image reference for the new repository.
Implement the weight contract
In the generated repository, implement the weight function the subnet reads:Required API
Every challenge must expose the same minimal contract:/challenges/{slug}/....
Database and storage
Generated challenges use the async SQLAlchemy SDK and read their runtime database URL fromCHALLENGE_DATABASE_URL. The runtime is SQLite-backed; the subnet injects a URL pointing at the SQLite file on the challenge /data Swarm volume:
/data for the SQLite database, artifacts, analyzer output, uploaded files, and any local state that should survive restarts. It is the only persistent store for a challenge, and it is retained by default when a challenge service is removed.
Register and run
Once the image is built and published, register and activate the challenge through the admin CLI:Next
Challenge SDK
The shared challenge-side helpers used by generated challenges.
Related
Challenge integration
How the master reads weights and routes traffic to a challenge.
Challenge CLI
Full reference for
platform challenge commands.Sources:
base/docs/challenges.md (model, required API, create command), base/docs/challenge-integration.md (get_weights, database contract, storage), base/src/platform_network/cli_app/main.py:857 (challenge create) and :873 (challenge register), base/src/platform_network/template_engine.py:13 (ChallengeTemplateContext) and :62 (render_challenge_template).