Submit Data
This guide walks through the full submission lifecycle: finding an open target, scoring your data against it, submitting on-chain, and claiming your reward.
-
Find an open target
Section titled “Find an open target”Each epoch, validators generate new targets. Query the network for targets that are still accepting submissions.
Terminal window soma target list --status opentargets = await client.get_targets(status="open")Each
Targetobject contains:Field Description idUnique target identifier statusCurrent state ( open,closed, etc.)embeddingThe point in embedding space the network wants data near model_idsModels that will score submissions distance_thresholdMaximum allowed distance from the target reward_poolTotal reward available for this target generation_epochEpoch when the target was created bond_amountRequired bond in shannons -
Get model manifests
Section titled “Get model manifests”Before scoring, fetch the manifests for the models associated with your target. Manifests tell you where to download model weights and how to verify them.
manifests = await client.get_model_manifests(target)Each
ModelManifestcontains:Field Description urlDownload URL for the model weights checksumHash to verify the download sizeFile size in bytes decryption_keyKey to decrypt the weights after download -
Score your data
Section titled “Score your data”Run the target’s models against your data to compute an embedding and distance score. Lower distance means your data is closer to what the network needs.
Terminal window soma target score --target-id <id> --data-url <url>result = await client.score(data_url,models=manifests,target_embedding=target.embedding,data=raw_data,seed=0,)The
ScoreResultcontains:Field Description winnerIndex into the models list indicating which model scored best loss_scorePer-model loss scores ( list[float])embeddingComputed embedding for your data ( list[float])distancePer-model distance from target ( list[float])The
winneris the index of the model that produced the lowest distance. Use the correspondingmodel_idwhen submitting. -
Build and submit
Section titled “Build and submit”Compute a commitment hash for your data, upload it to an accessible URL, then submit on-chain.
Terminal window soma target submit \--target-id <id> \--data-commitment <hex> \--data-url <url> \--data-checksum <hex> \--data-size <bytes> \--model-id <model_id> \--embedding <comma-separated-floats> \--distance-score <float> \--bond-coin <coin_id># Compute the commitment hashcommitment = SomaClient.commitment(data)# Upload data to accessible storage, then submitawait client.submit_data(signer,target_id,data,data_url,model_id,embedding,distance_score,)The bond amount is specified in shannons (1 SOMA = 1,000,000,000 shannons). Convert with:
bond_in_soma = SomaClient.to_soma(target.bond_amount)Verify your submission was recorded:
Terminal window soma target info <target_id> -
Claim rewards
Section titled “Claim rewards”After the challenge window closes (2 epochs after submission), the winning submitter can claim their reward.
Terminal window soma target claim <target_id>await client.claim_rewards(signer, target_id)Verify your balance updated:
Terminal window soma client balancebalance = await client.get_balance(address)