Critical information in this section may be subject to change as the network is in early stages.Documentation Index
Fetch the complete documentation index at: https://docs.moca.network/llms.txt
Use this file to discover all available pages before exploring further.
Challenger Information
Minimum System Requirements
| Component | Minimum Specification |
|---|---|
| Hardware | Desktop or laptop running recent versions of Mac OS X or Linux |
| CPU | 4 cores |
| Memory (RAM) | 12 GB |
| Storage | 1 TB HDD/SSD |
| Bandwidth | 1 MB/s |
Setting up a challenger
Prerequisite
- Pull the
developbranch of themoca-challengerrepository. - The deployment of
moca-challengerrelies on validator binding initialization. If you want to deploy your ownmoca-challenger, you need to join as a new validator.
Challenger Introduction
Moca ensures data integrity by regularly issuing challenge events to storage providers to prove that stored data has not been tampered with. This service allows end-users to monitor challenge events in the blockchain and perform verification.Moca-challenger main components
moca-challenger includes 7 main goroutines: Monitor, Verifier, Vote Collector, Vote Broadcaster, Vote Collator, Tx Submitter, and Attest Monitor.
- Monitor: Polls the Moca blockchain to obtain new blocks, parse challenge events, and add them to the local database.
- Verifier: Verifies the integrity of the stored data by comparing root hashes.
- Vote Broadcaster: Broadcasts a signed vote on the blockchain for events that failed verification.
- Vote Collector: Polls the blockchain for votes broadcast by other Challenger services.
- Vote Collator: Collates votes to achieve a 2/3 consensus.
- Tx Submitter: Sends a
MsgAttestto the blockchain after enough consensus votes are received. - Attest Monitor: Polls the blockchain for successfully attested challenges and updates the database.
Deploy moca-challenger
Configuration file
Set your private key, deployment environment, and gas limit. Theprivate_key and bls_private_key can be obtained as described in the next section.
Run locally
Running MySQL in Docker
Create a database
Get validator BLS key and challenger key
Compile and launch moca-challenger
Assuming you have a validator running, compile and start the process.Test and Verification
Create your own SP
The process is similar to creating a validator.- Authorization: Grant spending limits.
- Submit a proposal: Use a JSON template to create a storage provider.
Tampering with data stored on SP
- Create a bucket and upload a file.
- Find the storage directory on your SP and modify the content of the data chunk file.
Challenge the data chunk of the object
- Regular challenge: Moca automatically generates random data availability challenges. The
moca-challengermonitors these events. If data has been tampered with, the root hashes will not match, and the challenge will be successful. The validator will vote, and if 2/3 consensus is reached, the SP will be slashed. - Manual challenge: Anyone can submit a transaction to challenge data availability.
Data recovery
Data recovery ensures that original data can be restored if lost on SPs.- Data is automatically recovered after a successful data challenge.
- Data is automatically recovered when users find that the data is unreadable.
- SPs can selectively recover lost data through tools.