# Deploy a Elastic Prover

## Deploy a Elastic Prover

1. Log in [Snarkify Console](https://console.snarkify.io) with your GitHub account.
2. For first time users, we have prepared a demo prover for you to try it out. Just Click `Try It First` to get started. You will be redirected to github for some configurations if this is the first service on your team.&#x20;

<figure><img src="https://902313018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9nQFlJH6XQCyYmRvUwtw%2Fuploads%2Fb6pugJgpaG6LV7Sam6Mi%2Fimage.png?alt=media&#x26;token=ec2bae45-156d-45e0-af7e-bb0f4086ffd2" alt=""><figcaption></figcaption></figure>

3. Once the configuration is done, you can continue to deploy the demo prover. You can simply use the default values and directly click `Deploy` .🚀&#x20;

{% hint style="info" %}
Deploying a demo prover will clone the template repository into your github account first, don't get surprised : )
{% endhint %}

<figure><img src="https://902313018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9nQFlJH6XQCyYmRvUwtw%2Fuploads%2FjFXRDQkLtt8Uly1ZtXow%2Fimage.png?alt=media&#x26;token=9db9f3b0-f0e0-4743-bd0e-c5827b362c60" alt=""><figcaption></figcaption></figure>

4. The service will be rendered  `Unready` for about 5 minutes while our backend pipeline is actively building and deploying your code. Grab some coffee :).

<figure><img src="https://902313018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9nQFlJH6XQCyYmRvUwtw%2Fuploads%2Fjr0hG6Ofo6EVHr2YEIXy%2Fimage.png?alt=media&#x26;token=d72d5cd7-f55d-42d3-a5dc-85e14c797154" alt=""><figcaption></figcaption></figure>

5. Once the deployment succeeds, the service status will become `Ready` , and an **Endpoint** will be generated and shown. Note the **Endpoint** of your deployed service, and we will need it to issue a proof generation request to your prover.

<figure><img src="https://902313018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9nQFlJH6XQCyYmRvUwtw%2Fuploads%2F1DSJLO6F65clllzISJdX%2Fimage.png?alt=media&#x26;token=f0e65a59-db06-4e41-bd52-73fe3d48fc7b" alt=""><figcaption></figcaption></figure>

6. Alternatively, you can also deploy your own prover implementation on the Snarkify Network. Please checkout [integrate-elastic-prover-sdk](https://docs.snarkify.io/serverless-gpu-proving/deploy-a-elastic-prover/integrate-elastic-prover-sdk "mention").

## Issue a Proof Generation Request

In this section, we will show you how to issue a proof generation request to your prover and how to query the generated proof from the command line.

### Create an API key

* Go to the "Access Keys" tab, click the `Create Key` button, and give it a good name.

<figure><img src="https://902313018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9nQFlJH6XQCyYmRvUwtw%2Fuploads%2FBJrtRrTyHcLAmOEkMeKS%2Fimage-5.png?alt=media&#x26;token=55b0071f-2675-439c-bb7c-369aea8fcd77" alt=""><figcaption></figcaption></figure>

* Upon clicking the `Create` button, your key will be generated and shown. **Please save your access key securely, as the key will only be shown once.**

<figure><img src="https://902313018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9nQFlJH6XQCyYmRvUwtw%2Fuploads%2Fp4N9KlvVhKNATvJrfaiO%2Fimage-6.png?alt=media&#x26;token=73a8cd91-235c-44dc-a364-154c9f0d04d8" alt=""><figcaption></figcaption></figure>

### Issue a Proof Generation Request

Get your **endpoint** and **access key** ready, and type the following command in your terminal.

```
ENDPOINT=<your_endpoint_url>
ACCESS_KEY=<your_access_key>
```

Use the following curl command to issue your proof generation request against the demo prover:

```sh
curl --request POST $ENDPOINT \
--header "x-api-key: $ACCESS_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
    "input": {
        "private_input": [0, 1, 2, 3, 4],
        "public_input": "20304616028358001435806807494046171997958789835068077254356069730773893150537"
    }
}
'
```

Requests are processed asynchronously by your prover service. You will receive a confirmation response with a `PENDING` state like the following,

```json
{
    "service_id": "0872ccea325846ee9dd6f697b9af1863",
    "task_id": "ec5e67fecbab4f66b5c4a1551105e795",
    "service_name": "poseidon",
    "creator_id": "5a5fd35f890349aea7ac9dc17d97d32b",
    "result": null,
    "state": "PENDING",
    "input": "{\"private_input\": [0, 1, 2, 3, 4], \"public_input\": \"13037709793114148810823325920380362524528554380279235267325741570708489436263\"}",
    "started": null,
    "finished": null,
    "created": "2023-11-04T03:14:25"
}
```

Please note the `task_id` for the next step.

### Query results

#### **From Command Line**

Get your **task ID** and **access key** ready, and type the following command in your terminal.

```
TASK_ID=<your_task_id>
ACCESS_KEY=<your_access_key>
```

The proof generation result can be queried with the following command,

<pre class="language-sh"><code class="lang-sh"><strong>curl --request GET "https://api.snarkify.io/v1/tasks/$TASK_ID" \
</strong>--header "x-api-key: $ACCESS_KEY"
</code></pre>

Then you will see the task information like below once the task is processed:

```json
{
    "service_id": "aa143bd5b48647569720096ab7493cd2",
    "task_id": "4b1fd782a0f44f499a88a8cab31f066f",
    "service_name": "poseidon",
    "creator_id": "e95d87b33f8f45ea9e1f845eca18031d",
    "result": "\"nc/6L2N4Jo1DU1SQ5IsVJ4EnqYo0pJBr1Zfv/Reez2LvtaFnHc/GzVpb2EBfAQhWBbk3OJNr5CBgS7TIJEtpQvPzw4PokhbAsvBsS6oK5Nu/zvJwVS4xrWgHD3uPT3ZWO7/U4n6YzZHBwgSN1bAK4ofFGQl7czSsS52ROInTJyVMGLtza6/UUh9IZmRkbw6ibZkJC5CIPfADf9LpNh71ZgAP3E66q8iqclzXdN4/i3fQ64i8KqrkGRUtPJYBWzxIvJXotC2OF3X/se371MTit0i3cR8C9eNLK4UglouWUCvJAyMdhlsrf7xKb/DI1V7I8jmKp0IGFt6hc6EDy/IOLEkzIGeqRmmmuLdfP+TwkQ+7ldAue56d0/NC22x2NJQpe8DwF6y/FHJxyi394HZEAZ8lYDhH2gjdW9FOj7jgLmZ0PyVM0i+hnssUSztiI+Lz0i6f7qmSQJZWR49QotjbbugIthJoYyrRF+aJh6dUSyv1d1cw06RhWcRa5H5q0j9hyW1z8pzghUhushcV66aUd1CYDefvVuvn2SygfOf1pm09cWyUewBDpSbHMpuMxhs7UODdbmoXDyq5THQ0jYKqSR57X5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DS9LcpKYZ5DydKjMzFbKg9ARii6n7feSnTerZdN+ip1994wl13EfCIZM1cG66OQ6888IK7UlPvZN+9r+bMXiO+6AwH1us4SEhaGmVgSbYH5iCkQfR+rzR1k0crPCsAsquUg5xnS4USskd3SMZxGBzyL0HB8JDzvzGYFIIePw/vAwvaFLrdHGwTUEDkeWN4Iir5QiBTc4ajpCnrzkVfMMwRg81HGFoOuSfQOHrUBYysCxzLcgFlz/63SClAh9CJCUzogHaLTuvn+zltCYGQ1FsjxhV1i+ZXb6wK9fXC55YVMHQGH+ve/1PFik6ta0gJoBSlKnI9BaGK/2BU6C2r8cZWxm2WtEN0jMIBvxfejgyx+0vMlc\"",
    "state": "SUCCESS",
    "input": "{\"private_input\": [0, 1, 2, 3, 4], \"public_input\": \"20304616028358001435806807494046171997958789835068077254356069730773893150537\"}",
    "started": "2023-11-10T02:08:22",
    "finished": "2023-11-10T02:08:23",
    "created": "2023-11-10T02:08:22"
}
```

#### **From Cloud Console**

Alternatively, you can also check your task history through our UI:

1. click the setting button

<figure><img src="https://902313018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9nQFlJH6XQCyYmRvUwtw%2Fuploads%2FQUd2JFxjUa1cS46JP5TD%2Fimage.png?alt=media&#x26;token=c845800a-5a7c-45ad-8b93-81e5cbc420eb" alt=""><figcaption></figcaption></figure>

2. Go to the `Task Hisotry` page

<figure><img src="https://902313018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9nQFlJH6XQCyYmRvUwtw%2Fuploads%2F1rd1xWQCImSfg8cydqLc%2Fimage.png?alt=media&#x26;token=6c919b41-b5ee-4e6b-854d-7dfcdee1121e" alt=""><figcaption></figcaption></figure>

## What's Next

Following this [tutorial](https://docs.snarkify.io/serverless-gpu-proving/deploy-a-elastic-prover/integrate-elastic-prover-sdk) to make your own ZK circuits *cloud-ready* with the **`snarkify-sdk`**.
