Skip to main content

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.

    git clone https://github.com/marlinprotocol/kalypso-oyster-attestation-verifier-risczero
cd kalypso-oyster-attestation-verifier-risczero
git checkout mainnet

ℹī¸ 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​

  1. Cleanup before build
        chmod +x bootstrap.sh
    ./bootstrap.sh clean
  2. Build the prover using bootstrap script.
chmod +x bootstrap.sh
./bootstrap.sh --gpu
info

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
  1. 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.

Benchmarking

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>>
info

Ensure All Variables Are Declared:

Please ensure that you have properly configured the following variables in your .env file:

env variablesNotes/Info
GENERATOR_ADDRESSThe address of your operator. The prover will only listen to jobs assigned to this address
HTTP_RPC_URLThe RPC URL of the Arbitrum One Network. (Note: It is recommended to use services such as Alchemy or Infura for reliable RPC endpoints.)
Ensure All Variables Are Declared

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)

metricsNotes/Info
TaskAssignedNumber of jobs assigned to the operator
TaskProvenNumber of jobs proven post assignment
TaskChallengedSuccessfullyNumber of jobs challenged successfully, in case of an invalid request received
JobTransactionSubmittedNumber 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.

Need Help?

If you encounter any issues or have questions, feel free to reach out to our Telegram channel for assistance.

Happy Proving!