• /v1/trace-generation

This endpoint submits query for trace generation only.

How to use?

This endpoint has two ways how you can use it:

  1. Using programFile

If you are going to generate trace for the given program only a few times, or you are experimenting with different programs, you can upload compiled Cairo program file directly in the request with programFile parameter.

  1. Using programHash

If you are going to generate trace for the same program multiple times, it is better if you first submit the program to program registry. Then you can use its unique program hash to avoid reuploading. This way you can save bandwidth and time.

Moreover, in both cases you can specify inputFile parameter which is private input data for the Cairo program.

Sending Request

Note: Remember not to use programHash and programFile at the same time.

  • Query Parameters
    • apiKey (string, required)
  • Request Body
    • For Option 1 (programFile)
      • programFile (file - .json, required) - A compiled Cairo program in JSON format.
    • For Option 2 (programHash)
      • programHash (string, required) - A unique hash representing Cairo program, which has been previously registered in program registry.
    • In addition for both options
      • inputFile (file - .json, optional) - Input data for Cairo program if used.
      • cairoVersion (string, required, default: 0) - For now only version 0 is supported

Responses

  • Success (201 created)
    • Content-Type:application/json
    • Response Body
    {
        "atlanticQueryId": "string"
    }
    
    • You can use this atlanticQueryId to check status of that request.
  • Error Responses
    • 400 Bad Request - Indicates that parameters are invalid such as providing programFile with programHash at the same request.
    • 500 Internal Server Error - This says error is on our side.

Example Requests

  1. using programFile

    curl -X 'POST' \
      'https://atlantic.api.herodotus.cloud/v1/trace-generation?apiKey=<your-api-key>' \
      -H 'accept: application/json' \
      -H 'Content-Type: multipart/form-data' \
      -F 'programHash=string' \
      -F 'programFile=@sha_test.json;type=application/json' \
      -F 'cairoVersion=0'
    
  2. using programHash

    curl -X 'POST' \
      'https://atlantic.api.herodotus.cloud/v1/trace-generation?apiKey=<your-api-key>' \
      -H 'accept: application/json' \
      -H 'Content-Type: multipart/form-data' \
      -F 'programHash=0x6f07b23ab2a11d0f06735180ed774fac02932dfaca1d0836a8bf65a1cd142d3' \
      -F 'programFile=@sha_test.json;type=application/json' \
      -F 'cairoVersion=0'