> For the complete documentation index, see [llms.txt](https://docs.allnodes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allnodes.com/eth/validator.md).

# Validator

## Host a validator (with private key)

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/node/hosting`

This endpoint allows you to host new validator.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                             | Type   | Description                                                                                                                                                                                   |
| ------------------------------------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| currencySymbol<mark style="color:red;">\*</mark> | string | Must be "ETH"                                                                                                                                                                                 |
| privateKey<mark style="color:red;">\*</mark>     | string | Validator private key in HEX (not withdrawal private key)                                                                                                                                     |
| network<mark style="color:red;">\*</mark>        | string | "mainnet" \| "pyrmont" \| "prater"                                                                                                                                                            |
| graffiti<mark style="color:red;">\*</mark>       | string | Graffiti of your new validator (not more than 17 bytes)                                                                                                                                       |
| relayId                                          | string | <p>MEV-Boost Relay of your new validator. Possible options:<br>\* "flashbots"<br>\* "ultrasound"<br>\* "maxprofit" (Enterprise plan required)<br>\* null (this option disables MEV-Boost)</p> |
| planType                                         | string | <p>Pricing plan. Possible options:<br>\* "advanced" (default)<br>\* "enterprise"</p>                                                                                                          |

{% tabs %}
{% tab title="201: Validator was successfully hosted." %}

```javascript
{
  id: string;
  ip: string;
  name: string;
  currencySymbol: string;
  createdAt: string;
  payoutFrequencySeconds: number;
  apr: string;
  instance: {
    version: string;
    status: string;
    uptimeSeconds: number | null;
    nodeId: number | null;
  };
  address: {
    rewardOwner: string;
    rewardsEarned: number;
    signingPublicKey: string;
  };
}
```

{% endtab %}

{% tab title="400: Bad Request Example of error response." %}

```javascript
{
  "error": "INVALID_GRAFFITI"
}
```

{% endtab %}
{% endtabs %}

## Host a validator (with keystore and password)

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/node/hosting`

This endpoint allows you to host new validator.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                             | Type   | Description                                                                                                                                                                                   |
| ------------------------------------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| currencySymbol<mark style="color:red;">\*</mark> | string | Must be "ETH"                                                                                                                                                                                 |
| keystore<mark style="color:red;">\*</mark>       | object | Your keystore content in JSON                                                                                                                                                                 |
| password<mark style="color:red;">\*</mark>       | string | Your keystore password                                                                                                                                                                        |
| networkName<mark style="color:red;">\*</mark>    | string | "mainnet" \| "pyrmont" \| "prater"                                                                                                                                                            |
| graffiti<mark style="color:red;">\*</mark>       | string | Graffiti of your new validator (not more than 17 bytes)                                                                                                                                       |
| relayId                                          | string | <p>MEV-Boost Relay of your new validator. Possible options:<br>\* "flashbots"<br>\* "ultrasound"<br>\* "maxprofit" (Enterprise plan required)<br>\* null (this option disables MEV-Boost)</p> |
| planType                                         | string | <p>Pricing plan. Possible options:<br>\* "advanced" (default)<br>\* "enterprise"</p>                                                                                                          |

{% tabs %}
{% tab title="201: Validator was successfully hosted." %}

```javascript
{
  id: string;
  ip: string;
  name: string;
  currencySymbol: string;
  createdAt: string;
  payoutFrequencySeconds: number;
  apr: string;
  instance: {
    version: string;
    status: string;
    uptimeSeconds: number | null;
    nodeId: number | null;
  };
  address: {
    rewardOwner: string;
    rewardsEarned: number;
    signingPublicKey: string;
  };
}
```

{% endtab %}

{% tab title="400: Bad Request Example of error response." %}

```javascript
{
  "error": "INVALID_GRAFFITI"
}
```

{% endtab %}
{% endtabs %}

## Get message to sign for Fee Recipient address change

<mark style="color:blue;">`GET`</mark> `https://www.allnodes.com/api/v1/node/{id}/fee-recipient/sign-message`

Use this endpoint before changing Fee Recipient address.

#### Path Parameters

| Name                                 | Type   | Description                                                                                                |
| ------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Node for which you want to change Fee Recipient address. ID can be extracted from the “Get all nodes” call |

#### Query Parameters

| Name                                      | Type   | Description                    |
| ----------------------------------------- | ------ | ------------------------------ |
| address<mark style="color:red;">\*</mark> | string | Your new Fee Recipient address |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  message: string;
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "error": "INVALID_ADDRESS"
}
```

{% endtab %}
{% endtabs %}

## Change Fee Recipient address

<mark style="color:orange;">`PUT`</mark> `https://www.allnodes.com/api/v1/node/{id}/fee-recipient`

This endpoint allows you to change Fee Recipient address of your validator.

#### Path Parameters

| Name                                 | Type   | Description                                                                                                |
| ------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Node for which you want to change Fee Recipient address. ID can be extracted from the “Get all nodes” call |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                        | Type   | Description                                                              |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| message<mark style="color:red;">\*</mark>   | string | Message to sign                                                          |
| signature<mark style="color:red;">\*</mark> | string | ECDSA signature (HEX). Must be signed by deposit or withdrawal addresses |
| address<mark style="color:red;">\*</mark>   | string | Your new Fee Recipient address                                           |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  nodeId: string;
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "error": "INVALID_ADDRESS"
}
```

{% endtab %}
{% endtabs %}

## Change MEV-Boost Relay

<mark style="color:orange;">`PUT`</mark> `https://www.allnodes.com/api/v1/node/{id}/relay`

This endpoint allows you to change MEV-Boost Relay of your validator.

#### Path Parameters

| Name                                 | Type   | Description                                                                                          |
| ------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Node for which you want to change MEV-Boost Relay. ID can be extracted from the “Get all nodes” call |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                      | Type   | Description                                                                                                                                                                                   |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| relayId<mark style="color:red;">\*</mark> | string | <p>MEV-Boost Relay of your new validator. Possible options:<br>\* "flashbots"<br>\* "ultrasound"<br>\* "maxprofit" (Enterprise plan required)<br>\* null (this option disables MEV-Boost)</p> |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  nodeId: string;
  newRelay: string;
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "error": "INVALID_RELAY_ID"
}
```

{% endtab %}
{% endtabs %}

## Get message to sign for Voluntary Exit request

<mark style="color:blue;">`GET`</mark> `https://www.allnodes.com/api/v1/node/{id}/voluntary-exit/sign-message`

Use this endpoint before requesting Voluntary Exit.

#### Path Parameters

| Name                                 | Type   | Description                                                              |
| ------------------------------------ | ------ | ------------------------------------------------------------------------ |
| id<mark style="color:red;">\*</mark> | string | Node you want to exit. ID can be extracted from the “Get all nodes” call |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  message: string;
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "error": "VOLUNTARY_EXIT_ALREADY_REQUESTED"
}
```

{% endtab %}
{% endtabs %}

## Request Voluntary Exit

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/node/{id}/voluntary-exit`

This endpoint allows you to request Voluntary Exit of your validator.

#### Path Parameters

| Name                                 | Type   | Description                                                              |
| ------------------------------------ | ------ | ------------------------------------------------------------------------ |
| id<mark style="color:red;">\*</mark> | string | Node you want to exit. ID can be extracted from the “Get all nodes” call |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                        | Type   | Description                                                              |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| message<mark style="color:red;">\*</mark>   | string | Message to sign                                                          |
| signature<mark style="color:red;">\*</mark> | string | ECDSA signature (HEX). Must be signed by deposit or withdrawal addresses |

{% tabs %}
{% tab title="201: Created " %}

```json
{
  nodeId: string;
}
```

{% endtab %}

{% tab title="403: Forbidden " %}

```
{
  "error": "VERIFICATION_FAILED"
}
```

{% endtab %}
{% endtabs %}
