Run the Prover
This guide walks you through running the prover for the Hardware Operator. Follow each step carefully to ensure a smooth and successful setup. By the end of this guide, you'll have the prover up and running, ready to contribute to the Kalypso network.
đ Prerequisitesâ
Before you begin, ensure that all the steps mentioned in the Set Up the Machine guide are complete. This includes having the necessary hardware, CUDA, and Docker installed and configured.
âšī¸ Why: Completing the machine setup ensures that your environment is properly configured to support the prover, leveraging GPU acceleration for optimal performance.
1. Clone the Prover Source Codeâ
Start by cloning the prover's source code from the official repository.
- mainnet
- beta
- stagenet
git clone https://github.com/marlinprotocol/kalypso-oyster-attestation-verifier-risczero
cd kalypso-oyster-attestation-verifier-risczero
git checkout mainnet
git clone https://github.com/marlinprotocol/kalypso-oyster-attestation-verifier-risczero
cd kalypso-oyster-attestation-verifier-risczero
git checkout beta
git clone https://github.com/marlinprotocol/kalypso-oyster-attestation-verifier-risczero
cd kalypso-oyster-attestation-verifier-risczero
git checkout package
stagenet will be removed soon
âšī¸ Why: Cloning the repository fetches the latest prover code, ensuring you have access to all necessary files and updates required to build and run the prover.
2. Build the Proverâ
- Cleanup before build
chmod +x bootstrap.sh
./bootstrap.sh clean - Build the prover using bootstrap script.
- gpu
- cpu
chmod +x bootstrap.sh
./bootstrap.sh --gpu
CPU proving is not competitve, but you can still participate
chmod +x bootstrap.sh
./bootstrap.sh --cpu
Sometimes you may encounter
warning: [email protected]: In file included from /usr/include/cuda_runtime.h:83,
warning: [email protected]: from <command-line>:
warning: [email protected]: /usr/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 12 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
warning: [email protected]: 132 | #error -- unsupported GNU version! gcc versions later than 12 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
...
...
...
error: failed to run custom build command for `risc0-sys v1.2.1`
This is because likely because CUDA has specific GCC version compatibility. Downgrading/Adding-alternative GCC version 12 ensures compatibility with the current CUDA toolkit you're using.
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-12
- Finally
chmod +x start.sh
3. Benchmark Your Setupâ
After successfully building the prover, it's essential to benchmark your setup to verify that everything is functioning correctly.
./start.sh benchmark
đĄ Benchmarking:
Note down the time taken to generate the proof. On an RTX 40xx GPU, it should roughly take around 12 minutes.
Recording the benchmark helps ensure that your setup meets the performance expectations. If the time taken significantly deviates, it may indicate configuration issues or hardware limitations.
4. Test Prover Connection (Optional)â
You can optionally test the prover connection by attempting to generate a proof for a live attestation. This step helps verify the prover's connectivity and functionality within the network.
./start.sh test-connection
5. Start the Proverâ
5.1 Configure Environment Variablesâ
Create a .env
file in the root directory of the cloned repository and add the necessary environment variables.
# .env
GENERATOR_ADDRESS=<<operator_address>>
GAS_KEY=<<private_key>>
HTTP_RPC_URL=<<l2_rpc_url>>
Ensure All Variables Are Declared:
Please ensure that you have properly configured the following variables in your .env
file:
- mainnet
- betanet/stagenet
Proper configuration of environment variables is crucial for the prover to interact with the blockchain network securely and efficiently.
5.2 Start the Proverâ
Run the prover:
./start.sh run-prover
Nitro Attestation Prover tracks some metrics which can be monitored via curl http://localhost:9999/metrics
. (Note: 9999 is the default metrics port)
metrics | Notes/Info |
---|---|
TaskAssigned | Number of jobs assigned to the operator |
TaskProven | Number of jobs proven post assignment |
TaskChallengedSuccessfully | Number of jobs challenged successfully, in case of an invalid request received |
JobTransactionSubmitted | Number of responses submitted successfully on-chain |
đ Next Stepsâ
With the prover up and running, you can now register it with the Kalypso Marketplace to start contributing to the network and earning rewards. Ensure that your prover maintains a stable connection and performs optimally to maximize your participation benefits.
If you encounter any issues or have questions, feel free to reach out to our Telegram channel for assistance.