Overview

AR Flow

The Applicative Recursion workflow consists of four main steps:

1. Create Bucket

First, you need to create a bucket that will contain your related queries. Endpoint: POST /buckets Required Parameters:
  • aggregatorVersion: The version of the aggregator to use (e.g., “snos_aggregator_0.13.2”)
Optional Parameters:
  • externalId: Custom identifier for the bucket
  • nodeWidth: Width of the node (integer)
  • aggregatorParams: Additional parameters for the aggregator
Response:
{
  "atlanticBucket": {
    "id": "bucket_123456",
    "externalId": "my-custom-id",
    "status": "OPEN",
    "aggregatorVersion": "snos_aggregator_0.13.2",
    "nodeWidth": 4,
    "leaves": 0,
    "createdAt": "2024-01-01T00:00:00Z"
  }
}

2. Submit Queries with Bucket ID

Once you have a bucket, you can submit multiple queries to it. Each query must include:
  • bucketId: The ID of the bucket you created
  • bucketJobIndex: An incremental index (0, 1, 2, …) for each query in the bucket
Endpoint: POST /atlantic-query AR-Specific Parameters:
  • bucketId: The ID of the bucket to submit the query to
  • bucketJobIndex: The index of the job inside the bucket (must be sequential)
Example Request Body:
{
  "declaredJobSize": "M",
  "bucketId": "bucket_123456",
  "bucketJobIndex": 0,
  "programFile": "program.json",
  "result": "PROOF_GENERATION"
}
Important Notes:
  • Use the Swagger UI for submitting queries due to file upload limitations
  • Job indices must be sequential (0, 1, 2, …)

3. Close Bucket

After submitting all your queries to the bucket, you need to close it to signal that no more queries will be added. Endpoint: POST /buckets/close Parameters:
  • bucketId: The ID of the bucket to close
Response:
{
  "atlanticBucket": {
    "id": "bucket_123456",
    "status": "IN_PROGRESS",
    "aggregatorVersion": "snos_aggregator_0.13.2",
    "chain": "L1",
    "projectId": "proj_123",
    "createdAt": "2024-01-01T00:00:00Z"
  }
}

4. Wait for Results

Once the bucket is closed, Atlantic will process all queries in the bucket and aggregate the results. You can monitor the bucket status using the get bucket endpoint. Bucket Status Values:
  • OPEN: Bucket is open and accepting queries
  • IN_PROGRESS: Bucket is closed and processing queries
  • DONE: All queries in the bucket have been processed successfully
  • FAILED: One or more queries in the bucket failed

Managing AR Buckets

You can view and manage your Applicative Recursion buckets through the Herodotus Cloud console. The interface provides a comprehensive view of all your buckets with their current status and details. Atlantic AR Buckets Overview

Bucket Details View

When you select a specific bucket, you can see its details. Atlantic Bucket Details

Bucket Tree Structure

The Applicative Recursion system creates a tree-like structure. Atlantic AR Tree Structure

Complete Example

Here’s a complete example of using Applicative Recursion:

Step 1: Create Bucket

curl -X POST "https://atlantic.api.herodotus.cloud/buckets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "aggregatorVersion": "snos_aggregator_0.13.2",
    "externalId": "my-batch-1"
  }'

Step 2: Submit Multiple Queries

# Submit first query
curl -X POST "https://atlantic.api.herodotus.cloud/atlantic-query" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "declaredJobSize=M" \
  -F "bucketId=bucket_123456" \
  -F "bucketJobIndex=0" \
  -F "programFile=@program1.json" \
  -F "result=PROOF_GENERATION"

# Submit second query
curl -X POST "https://atlantic.api.herodotus.cloud/atlantic-query" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "declaredJobSize=M" \
  -F "bucketId=bucket_123456" \
  -F "bucketJobIndex=1" \
  -F "programFile=@program2.json" \
  -F "result=PROOF_GENERATION"

# Submit third query
curl -X POST "https://atlantic.api.herodotus.cloud/atlantic-query" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "declaredJobSize=M" \
  -F "bucketId=bucket_123456" \
  -F "bucketJobIndex=2" \
  -F "programFile=@program3.json" \
  -F "result=PROOF_GENERATION"

Step 3: Close Bucket

curl -X POST "https://atlantic.api.herodotus.cloud/buckets/close?bucketId=bucket_123456" \
  -H "Authorization: Bearer YOUR_API_KEY"

Step 4: Monitor Results

curl -X GET "https://atlantic.api.herodotus.cloud/buckets/bucket_123456" \
  -H "Authorization: Bearer YOUR_API_KEY"