# Nodeos Producer API

The `producer_api_plugin` exposes a number of endpoints for the `producer_plugin` to the RPC API interface managed by the `http_plugin`.

For API request, it needs to perform a `POST` line with required parameters. The manual presents examples of requests using `curl`. Return code *201* indicates successful operation.

**Producer API requests supported:**

* [pause](/software_manuals/api_reference/nodeos_producer_api.md#pause)
* [resume](/software_manuals/api_reference/nodeos_producer_api.md#resume)
* [paused](/software_manuals/api_reference/nodeos_producer_api.md#paused)
* [get\_runtime\_options](/software_manuals/api_reference/nodeos_producer_api.md#get_runtime_options)
* [update\_runtime\_options](/software_manuals/api_reference/nodeos_producer_api.md#update_runtime_options)

## pause

The request puts a producer node in pause state and returns nothing.

**Params:**\
No params required.

**Request example:**

```bash
curl --request POST  --data '' http://<node>/v1/producer/pause
```

### Responses

**Code:** 201 OK

**Value:**\
Returns nothing.

## resume

The request switches a producer node from "pause" state to "resume" state and returns nothing.

**Params:**\
No params required.

**Request example:**

```bash
curl --request POST  --data '' http://<node>/v1/producer/resume
```

### Responses

**Code:** 201 OK

**Value:**\
Returns nothing.

## paused

The request retreives paused status for producer node.

**Params:**\
No params required.

**Request example:**

```bash
curl --request POST  --data '' http://<node>/v1/producer/paused
```

### Responses

**Code:** 201 OK

**Value:**

```
{
  "pause_production": true  // "true" if producer node is paused, "false" otherwise (that is, the node produces blocks)
}
```

## get\_runtime\_options

The request retreives run time options for producer node.

**Params:**\
No params required.

**Request example:**

```bash
curl --request POST --data '' http://<node>/v1/producer/get_runtime_options
```

### Responses

**Code:** 201 OK

**Value:**

```
{
  "max_transaction_time": 800,       // Time (in milliseconds) allocated to a transaction
  "max_irreversible_block_age": -1,  // Time (in seconds) allocated to irreversible block age
  "produce_time_offset_us": 0,       // Produce time offset (in microseconds)
  "last_block_time_offset_us": 0,    // Last block time offset (in microseconds)
  "max_scheduled_transaction_time_per_block_ms": 2000  // Max scheduled transaction time per block (in milliseconds)
}
```

## update\_runtime\_options

The operation updates run time options for producer node.\
Each of parameters specified in the operation is optional.

**Params:**

* `(integer) max_transaction_time` — Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute before being considered invalid. Defauts to *1000*.
* `(integer) max_irreversible_block_age` — Limits the maximum age (in seconds) of the DPOS Irreversible Block for a chain this node will produce blocks on (use negative value to indicate unlimited). Defaults to *-1*.
* `(integer) produce_time_offset_us` — Offset of non last block producing time (in microseconds). Negative number results in blocks to go out sooner, and positive number results in blocks to go out later. Defaults to *0*.
* `(integer) last_block_time_offset_us` — Offset of last block producing time (in microseconds). Negative number results in blocks to go out sooner, and positive number results in blocks to go out later. Defaults to *0*.
* `(integer) max_scheduled_transaction_time_per_block_ms` — Maximum wall-clock time (in milliseconds) spent retiring scheduled transactions in any block before returning to normal transaction processing. Defaults to *1000*.
* `(integer) incoming_defer_ratio` — Ratio between incoming transations and deferred transactions when both are exhausted. Defaults to *1.0* that  means *1:1*.

**Request examples:**

```bash
curl --request POST  -d '{"max_transaction_time": 1500, "last_block_time_offset_us": 5}' http://<node>/v1/producer/update_runtime_options
```

```bash
curl --request POST  -d '{"max_transaction_time": 1500, "max_irreversible_block_age": 5, "produce_time_offset_us": 10, "last_block_time_offset_us": 10, "max_scheduled_transaction_time_per_block_ms": 1000, "incoming_defer_ratio": 1.2}' http://<node>/v1/producer/update_runtime_options
```

### Responses

**Code:** 201 OK

**Value:**\
Returns Nothing.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cyberway.io/software_manuals/api_reference/nodeos_producer_api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
