<!-- Generated from the function registry (sdk/src/functions) by `cd sdk && npm run gen`. Do not edit. -->

# Node

> **Status:** Current (generated)

A validator's own port, not exposed by the gateway: raw submission, Prometheus metrics, safety checks, fault injection.

| Function | Kind | Description |
|---|---|---|
| [`chain.evidence`](#chainevidence) | read | Slashing: proofs of equivocation this validator holds (for relaying to where the key is bonded), offences recorded here, jailed nodes, the key registry |
| [`chain.commit_hashes`](#chaincommit_hashes) | read | Fingerprints of consecutive commits from `from`, for checking that validators agree (`mox check`) |
| [`node.set_fault`](#nodeset_fault) | write | Switch this validator's injected fault at runtime (builds with the `testnet-faults` feature only), for fault campaigns |
| [`tx.submit_raw`](#txsubmit_raw) | write | Submit signed transactions without JSON or hex, for high-rate clients: the body is each transaction as a 4-byte little-endian length and its bytes; the reply has, per transaction, 0 and the 32-byte hash, or 1, a 2-byte length and the error |
| [`node.status`](#nodestatus) | read | A validator's status over plain HTTP (the same as chain.status), for health checks |
| [`node.metrics`](#nodemetrics) | read | A validator's metrics in the Prometheus text format |
| [`node.events_stream`](#nodeevents_stream) | stream | Contract events from one validator as Server-Sent Events (the gateway relays this as events.stream) |
| [`node.dag_stream`](#nodedag_stream) | stream | One validator's live DAG as Server-Sent Events (the gateway relays this as events.dag_stream) |

## chain.evidence

Slashing: proofs of equivocation this validator holds (for relaying to where the key is bonded), offences recorded here, jailed nodes, the key registry.

- **Kind:** read
- **Runs:** JSON-RPC `mox_evidence` (`POST /`) on the a validator's own RPC port only (not through the gateway)

**Input**

None.

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `proofs` | array of object |  |  |
| `offences` | array of object |  |  |
| `jailed` | array of integer |  |  |
| `validators` | array of object |  |  |

## chain.commit_hashes

Fingerprints of consecutive commits from `from`, for checking that validators agree (`mox check`).

- **Kind:** read
- **Runs:** JSON-RPC `mox_commitHashes` (`POST /`) on the a validator's own RPC port only (not through the gateway)

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `from` | integer |  | First commit |
| `limit` | integer |  | Most to return |

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `from` | integer |  | First commit returned |
| `hashes` | array of string |  |  |
| `oldest` | integer or null |  |  |
| `newest` | integer or null |  |  |

## node.set_fault

Switch this validator's injected fault at runtime (builds with the `testnet-faults` feature only), for fault campaigns. Null clears it.

- **Kind:** write: acts at once (no wallet signature)
- **Runs:** JSON-RPC `mox_setFault` (`POST /`) on the a validator's own RPC port only (not through the gateway)

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `fault` | string or null | yes |  |

**Output**

boolean.

## tx.submit_raw

Submit signed transactions without JSON or hex, for high-rate clients: the body is each transaction as a 4-byte little-endian length and its bytes; the reply has, per transaction, 0 and the 32-byte hash, or 1, a 2-byte length and the error.

- **Kind:** write: acts at once (no wallet signature)
- **Runs:** `POST /submit` on the a validator's own RPC port only (not through the gateway)

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `body` | hex | yes | The length-prefixed transactions: 0x hex |

**Output**

hex: The binary reply: 0x hex.

## node.status

A validator's status over plain HTTP (the same as chain.status), for health checks.

- **Kind:** read
- **Runs:** `GET /status` on the a validator's own RPC port only (not through the gateway)

**Input**

None.

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `validator` | integer |  | Node index |
| `member` | integer or null |  |  |
| `epoch` | integer |  | Epoch |
| `chain_id` | integer |  | Chain id |
| `commit_index` | integer |  | Latest commit decided |
| `executed_index` | integer |  | Latest commit executed (use as a transaction's snapshot) |
| `highest_round` | integer |  | Highest DAG round seen |
| `effects` | string |  | Effects digest after executed_index |
| `mempool` | integer |  | Transactions waiting |
| `peers_connected` | integer |  | Peers |
| `halted` | boolean |  | Stopped on a safety alarm |
| `executed_txs` | integer |  | Transactions executed |
| `alarms` | array of string |  |  |
| `excluded_leaders` | array of integer |  |  |

## node.metrics

A validator's metrics in the Prometheus text format.

- **Kind:** read
- **Runs:** `GET /metrics` on the a validator's own RPC port only (not through the gateway)

**Input**

None.

**Output**

string: Prometheus exposition text.

## node.events_stream

Contract events from one validator as Server-Sent Events (the gateway relays this as events.stream).

- **Kind:** stream
- **Runs:** `GET /events` on the a validator's own RPC port only (not through the gateway)

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `contract` | hex32 |  | Only events of this contract: 32 bytes, 0x hex |
| `topic` | string |  | Only this event: its name (e.g. Transfer) or its 32-byte topic hex |
| `address` | hex32 |  | Only events mentioning this address: 32 bytes, 0x hex |
| `from` | integer |  | Start at this cursor |

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `seq` | integer |  | Event cursor |
| `commit` | integer |  | Commit |
| `tx` | hex |  | Transaction hash: 0x hex |
| `contract` | hex |  | Contract: 0x hex |
| `topics` | array of hex |  |  |
| `data` | hex |  | Data: 0x hex |

## node.dag_stream

One validator's live DAG as Server-Sent Events (the gateway relays this as events.dag_stream).

- **Kind:** stream
- **Runs:** `GET /dag` on the a validator's own RPC port only (not through the gateway)

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `from` | integer |  | Start at this cursor |

**Output**

object.
