# Set Up A Bootnode

Bootnodes are essential for helping subnet nodes discover peers and join the network. When a node starts, it needs to find other nodes, and bootnodes provide an initial point of contact. Once connected, a node can expand its peer connections and play its role in the network, like participating as a validator.

Each subnet must have bootnodes for other peers to connect to and should be on its own isolated servers.

## Prerequisites

A bootnode can be run only by a registered peer to pass the [proof-of-stake](/subnet-template/proof-of-stake.md) mechanism.

{% hint style="info" %}
When registering a node, you must include a bootnode peer ID. You can also update the bootnode peer ID at any time.
{% endhint %}

## Run A Bootnode

We suggest using a terminal multiplexer of your choosing, such a [tmux](https://github.com/tmux/tmux/wiki).

```bash
subnet-dht-api \
--host_maddrs /ip4/0.0.0.0/tcp/31330 /ip4/0.0.0.0/udp/31330/quic \
--announce_maddrs /ip4/YOUR IP HERE/tcp/31330 /ip4/YOUR IP HERE/udp/31330/quic \
--identity_path bootnode.id \
--subnet_id 1
```

This will output logs:

{% code overflow="wrap" %}

```bash
[INFO] Running a DHT instance. To connect other peers to this one, use --initial_peers /ip4/IP/tcp/31330/p2p/QmSjcNmhbRvek3YDQAAQ3rV8GKR8WByfW8LC4aMxk6gj7v /ip4/IP/udp/31330/quic/p2p/QmSjcNmhbRvek3YDQAAQ3rV8GKR8WByfW8LC4aMxk6gj7v
```

{% endcode %}

{% hint style="success" %}
The bootnode exposes [bootnode API](/subnet-template/bootnode-api.md) endpoints.
{% endhint %}


---

# 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.hypertensor.org/build-a-subnet-1/set-up-a-bootnode.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.
