Automated validation for federated learning rounds on Solana blockchain.
- π Secure wallet integration with private key
- π¦ Dataset installation and management
- π€ Automatic pre-validation and post-validation
- β Trainer rating system support
- π° Easy reward claiming
- π Background auto-validation loop
- π― Support for any model architecture
# Clone or extract the validator kit
cd decloud-validator-kit
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Linux/Mac
# or: venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtpython main.py setupThis will prompt you for:
- Your Solana wallet private key (base58 encoded)
- Network selection (devnet/mainnet/testnet)
# List available datasets
python main.py dataset list --available
# Install specific datasets
python main.py dataset install Cifar10
python main.py dataset install Mnist
python main.py dataset install Imdb
# Install common datasets at once
python main.py dataset install-all# Show status
python main.py status
# View active rounds
python main.py rounds
# Start auto-validation
python main.py start| Command | Description |
|---|---|
setup |
Interactive setup wizard |
network -n <network> |
Change network (devnet/mainnet/testnet) |
status |
Show validator status |
balance |
Show wallet balance |
| Command | Description |
|---|---|
dataset list |
List installed datasets |
dataset list --available |
List all available datasets |
dataset install <name> |
Install a dataset |
dataset uninstall <name> |
Remove a dataset |
dataset install-all |
Install common datasets |
dataset install-all -c image |
Install all image datasets |
| Command | Description |
|---|---|
start |
Start auto-validation loop |
rounds |
Show active rounds |
round-info <id> |
Show detailed round info |
prevalidate <id> |
Manually prevalidate a round |
postvalidate <id> <trainer> |
Manually postvalidate a gradient |
| Command | Description |
|---|---|
claim <round_id> |
Claim rewards from finalized round |
- Cifar10, Cifar100
- Mnist, FashionMnist, Emnist, Kmnist
- Food101, Flowers102
- StanfordDogs, StanfordCars, OxfordPets
- Eurosat, Svhn, Caltech101, Caltech256
- Imdb, Sst2, Sst5
- AgNews, Dbpedia, YahooAnswers
- YelpReviews, AmazonPolarity, RottenTomatoes
- Banking77, SnipsIntent
- Iris, Wine, Diabetes, BreastCancer
- Titanic, HeartDisease
- CreditDefault, BankMarketing
- ChestXray, SkinCancer
- DiabeticRetinopathy, BrainTumor
- Malaria, BloodCells
Models are stored on IPFS with the following structure:
model_package/
βββ config.json # Architecture definition
βββ head.safetensors # Model weights
βββ embeddings.safetensors # Pre-computed embeddings (optional)
{
"head": {
"layers": [
{"type": "Linear", "params": {"in_features": 768, "out_features": 256}},
{"type": "ReLU", "params": {}},
{"type": "Dropout", "params": {"p": 0.1}},
{"type": "Linear", "params": {"in_features": 256, "out_features": 10}}
]
}
}- Linear, Conv1d, Conv2d
- BatchNorm1d, BatchNorm2d, LayerNorm
- ReLU, GELU, SiLU, Tanh, Sigmoid
- Dropout, Dropout2d
- MaxPool1d/2d, AvgPool1d/2d, AdaptiveAvgPool1d/2d
- Flatten, Embedding
- LSTM, GRU
- MultiheadAttention, TransformerEncoderLayer
- Validator checks active rounds matching installed datasets
- Downloads model from IPFS
- Runs model on test set
- Submits accuracy to blockchain
- When trainers submit gradients, validators check them
- Downloads gradient model from IPFS
- Validates against same test set
- Submits accuracy (improvement is calculated on-chain)
- 10% of round reward goes to validators
- Split equally among all validations
- 2% treasury fee on claims
The Decloud protocol includes a trainer rating system to ensure quality:
- Trainers start at 5.00 β rating
- If post-validation accuracy is lower than pre-validation (training made model worse), the trainer's rating is slashed by 0.01 β
- Creators can set minimum rating requirements for their rounds
- Validators help maintain network quality by providing accurate pre/post validation scores
When viewing rounds, you'll see the minimum trainer rating required for participation.
Config file location: ~/.decloud-validator/config.json
{
"private_key": "...",
"network": "devnet",
"installed_datasets": ["Cifar10", "Mnist"],
"auto_validate": true,
"poll_interval": 30,
"validation_batch_size": 1000,
"max_concurrent_validations": 3
}Run python main.py setup to configure your wallet.
Install the required dataset with python main.py dataset install <name>.
A trainer has already submitted a gradient, so prevalidation is no longer accepted.
You need SOL to pay transaction fees. Get devnet SOL from a faucet.
- Private key is stored locally in
~/.decloud-validator/config.json - Never share your private key
- Use a dedicated validator wallet, not your main wallet
- Consider using environment variables for production
# Run with debug output
python main.py --help
# Test validation locally
python -c "from validator import Validator; v = Validator('your-key'); print(v.get_balance())"MIT License