How score-technologies/score-predict works
Based on our analysis of the file tree and README, the Score Predict Subnet is a specialized blockchain subnet aimed at predicting football (soccer) match outcomes by having two primary roles: miners (which generate predictions using a base ML model like a Random Forest classifier) and validators (which challenge and score those predictions before setting on-chain weights). The project is a hybrid full-stack/subnet design, where there’s not only an on-chain prediction scoring system but also a centralized API (for match data fetch) plus a frontend “Score Predict App” used by end users to submit their own predictions.
Main components
• Miners: Represented by components such as neurons/miner.py, scorepredict/base/miner.py and all related utilities that support prediction generation.
• Validators: Represented by components such as neurons/validator.py, scorepredict/base/validator.py, and scorepredict/validator/forward.py & reward.py – these modules fetch upcoming matches, send challenges to miners, aggregate and score responses.
• Centralized API/Match Data Service: Even though its code isn’t deeply detailed here, the README explains that a centralized API is initially used to fetch upcoming matches and results. Include this as a distinct service.
• Supporting Modules: Additional libraries and utilities (e.g., config, logging, protocol definitions, and utility scripts) that help with configuration, data flow, and integration. These backend “glue” components support the miner and validator functionalities.
• Deployment and Infrastructure: Include elements such as script-based installations (install_miner.sh, install_validator.sh), CI/CD pipelines (.circleci folder), and deployment processes (pm2 usage) that indicate methods for managing the production servers.
Relationships and interactions
• Flow from the Centralized API to Validators:
• The API is used to fetch upcoming football matches and match outcomes.
• Validation Cycle:
• Validators use the match data fetched from the API to send out prediction challenges to miners.
• Miners’ prediction responses flow back to Validators.
• Scoring and Weight Setting:
• Once predictions are received, the scoring logic (detailed in scorepredict/protocol.py along with reward computation in validator/reward.py) calculates scores and applies multipliers.
• User Interaction:
• Deployment and Automated Updates:
• Components where automated scripts (validator_auto_update.sh, install scripts) manage deployment, node updates, and process management (pm2) as supporting infrastructure.
Architectural patterns and design principles
• Modular Design: The project splits its functionalities into modular components (miners, validators, API, base utilities) organized by directories such as neurons/, scorepredict/, and contrib/.
• Decoupled Services: Although the system is centrally coordinated (especially with the API), there is clear responsibility separation between generating predictions (miner) and processing/validating predictions (validator).
• Pluggability & Extensibility: The existence of a “base” model that miners can replace (or fine-tune) implies an architecture designed to be easily extended.
• Infrastructure Automation: The scripts and CI/CD configuration (in .circleci) illustrate that deployment and operational maintenance are factored into the design.
Technologies and libraries
• Python 3.8+ environment with pip dependencies (as specified in requirements.txt).
• PM2 for process management.
• External dependencies: interfacing with the Bittensor network (as noted in instructions), use of Random Forest classifier, etc.
• Shell scripts for installation and automated deployment.