Skip to main content

Using the CLI

The Boundless CLI provides the following command:
Terminal
boundless requestor status

Programmatically

When you submit a proof request to Boundless, you can track its status programmatically using the Boundless client. This allows you to integrate request monitoring directly into your applications.

Basic Request Tracking

Here’s how to wait for a request to be fulfilled:
no_run
# use boundless_market::{Client, StorageProviderConfig};
# use boundless_market::request_builder::OfferParams;
# use std::time::Duration;
# use anyhow::Result;
# use alloy_primitives::U256;
# use alloy::signers::local::PrivateKeySigner;
#
# async fn example() -> Result<()> {
# let private_key = PrivateKeySigner::random();
# let client = Client::builder().with_private_key(private_key).build().await?;
# let program = vec![0u8; 32]; // Example program bytes
# let input = vec![]; // Example input
# let offer_params = OfferParams::builder(); // Example auction parameters

// Submit your request
let request = client.new_request()
    .with_program(program)
    .with_stdin(input)
    .with_offer(offer_params);

let (request_id, expires_at) = client.submit_onchain(request).await?;

// Wait for the request to be fulfilled
tracing::info!("Waiting for request {:x} to be fulfilled", request_id);
let fulfillment = client
    .wait_for_request_fulfillment(
        request_id,
        Duration::from_secs(5), // check every 5 seconds
        expires_at,
    )
    .await?;
tracing::info!("Request {:x} fulfilled", request_id);
# Ok(())
# }

How It Works

The wait_for_request_fulfillment method:
  1. Polls the request status at the specified interval (e.g., every 5 seconds)
  2. Checks for completion states:
    • Fulfilled: Request completed successfully - returns journal and seal
    • Expired: Request timed out - returns an error
    • Other states: Continues polling
  3. Provides status updates via logging during the wait

Request Status Types

Boundless tracks these request states:
  • Unknown: Request may be open for bidding or not exist
  • Locked: A prover has committed to fulfilling the request
  • Fulfilled: Proof generation completed successfully
  • Expired: Request timed out before fulfillment

Error Handling

When tracking requests, handle these potential outcomes:
no_run
# use boundless_market::client::ClientError;
# use boundless_market::contracts::{boundless_market::MarketError, FulfillmentData};
# use boundless_market::Client;
# use std::time::Duration;
# use alloy_primitives::U256;
# use anyhow::Result;
#
# async fn example() -> Result<()> {
# let client = Client::builder().build().await?;
# let request_id = U256::from(0); // Example request ID
# let check_interval = Duration::from_secs(5);
# let expires_at = 0u64; // Example expiry time

match client.wait_for_request_fulfillment(request_id, check_interval, expires_at).await {
    Ok(fulfillment) => {
        // Process the fulfilled proof
        tracing::info!("Proof received with fulfillment data: {:?}", fulfillment.data()?);
    }
    Err(ClientError::MarketError(MarketError::RequestHasExpired(_))) => {
        tracing::error!("Request expired before fulfillment");
        // Handle expiration - maybe retry with different parameters
    }
    Err(e) => {
        tracing::error!("Request tracking failed: {}", e);
        // Handle other errors
    }
}
# Ok(())
# }

Advanced Tracking

For more control, you can manually check request status:
no_run
# use boundless_market::contracts::RequestStatus;
# use boundless_market::Client;
# use alloy_primitives::U256;
# use anyhow::Result;
# use std::time::Duration;
#
# async fn example() -> Result<()> {
# let client = Client::builder().build().await?;
# let request_id = U256::from(0); // Example request ID
# let expires_at = 0u64; // Example expiry time

// Check status once
let status = client.boundless_market.get_status(request_id, Some(expires_at)).await?;
match status {
    RequestStatus::Fulfilled => {
        // Retrieve the fulfillment for the fulfilled request
        let fulfillment = client
            .wait_for_request_fulfillment(request_id, Duration::from_secs(1), expires_at)
            .await?;
    }
    RequestStatus::Locked => {
        tracing::info!("Request locked by a prover, awaiting fulfillment");
    }
    RequestStatus::Expired => {
        tracing::warn!("Request has expired");
    }
    RequestStatus::Unknown => {
        tracing::info!("Request is open for bidding");
    }
}
# Ok(())
# }

Boundless Explorer

Getting Started

The Boundless Explorer provides a straightforward web interface to monitor and analyze proof activity on the Boundless network. Developers can track live proof request statuses, analyze associated costs, review transaction details, and assess proof performance metrics. Provers can monitor active requests, track earnings, evaluate their efficiency, and benchmark performance against peers. Boundless Explorer Access the explorer to:

Need Help?