> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

# Set up boot node

Boot nodes serve as initial connection points for nodes joining the Midnight Network. They help new nodes discover and connect to active peers in the network. While running a boot node is optional, doing so strengthens network decentralization and improves peer discovery.

This guide provides step-by-step instructions for setting up a boot node for Midnight.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

Before setting up your Midnight boot node, ensure you have the following:

* [Cardano-db-sync instance set up](https://docs.midnight.network/nodes/cardano-db-sync.md) with accessible PostgreSQL port.
* [Midnight node set up](https://docs.midnight.network/nodes/full-node.md#install-midnight-node) with the environment variables set.

## Set up a boot node[​](#set-up-a-boot-node "Direct link to Set up a boot node")

Use the following command to run Midnight node in boot node mode. Choose the configuration for your target network.

Run the command from your home directory. The node reads its settings from `res/cfg` in the directory you start it from. `CFG_PRESET` loads the settings for your network. `CARDANO_SECURITY_PARAMETER` is `432` for Preview and `2160` for Preprod and Mainnet.

* Preview
* Preprod
* Mainnet

```
CFG_PRESET=preview CARDANO_SECURITY_PARAMETER=432 midnight-node \

  --chain /home/midnight/res/preview/chain-spec-raw.json \

  --base-path /home/midnight/data \

  --listen-addr /ip4/0.0.0.0/tcp/30333 \

  --bootnodes /dns/bootnode-1.preview.midnight.network/tcp/30333/ws/p2p/12D3KooWK66i7dtGVNSwDh9tTeqov1q6LSdWsRLJvTyzTCaywYgK \

  --bootnodes /dns/bootnode-2.preview.midnight.network/tcp/30333/ws/p2p/12D3KooWHqFfXFwb7WW4jwR8pr4BEf562v5M6c8K3CXAJq4Wx6ym \

  --no-private-ip
```

```
CFG_PRESET=preprod CARDANO_SECURITY_PARAMETER=2160 midnight-node \

  --chain /home/midnight/res/preprod/chain-spec-raw.json \

  --base-path /home/midnight/data \

  --listen-addr /ip4/0.0.0.0/tcp/30333 \

  --bootnodes /dns/bootnode-1.preprod.midnight.network/tcp/30333/ws/p2p/12D3KooWQxxUgq7ndPfAaCFNbAxtcKYxrAzTxDfRGNktF75SxdX5 \

  --no-private-ip
```

```
CFG_PRESET=mainnet CARDANO_SECURITY_PARAMETER=2160 midnight-node \

  --chain /home/midnight/res/mainnet/chain-spec-raw.json \

  --base-path /home/midnight/data \

  --listen-addr /ip4/0.0.0.0/tcp/30333 \

  --bootnodes /dns4/bootnode-whippet-bengal.mainnet.midnight.network/tcp/30333/ws/p2p/12D3KooWMmfho3eEFvcnThAfzc9QfieTc91fdhvByL4a2naRjbr2 \

  --no-private-ip
```

Mainnet and the ledger 9 upgrade

Every Mainnet boot node must run node 2.1.101 before the governance upgrade that moves Mainnet to ledger 9. A node that still runs 1.0.400 stops at the fork block. Upgrade directly from 1.0.400 or 2.1.100, upgrade block producers together, and take a snapshot of the data directory first, because the binary upgrade is one-way. For the steps, see [What node operators need to do](https://docs.midnight.network/relnotes/ledger-9.md#what-node-operators-need-to-do).

## Known network boot nodes[​](#known-network-boot-nodes "Direct link to Known network boot nodes")

Use the boot nodes corresponding to your target network environment.

* Preview
* Preprod
* Mainnet

```
--bootnodes /dns/bootnode-1.preview.midnight.network/tcp/30333/ws/p2p/12D3KooWK66i7dtGVNSwDh9tTeqov1q6LSdWsRLJvTyzTCaywYgK \

--bootnodes /dns/bootnode-2.preview.midnight.network/tcp/30333/ws/p2p/12D3KooWHqFfXFwb7WW4jwR8pr4BEf562v5M6c8K3CXAJq4Wx6ym
```

```
--bootnodes /dns/bootnode-1.preprod.midnight.network/tcp/30333/ws/p2p/12D3KooWQxxUgq7ndPfAaCFNbAxtcKYxrAzTxDfRGNktF75SxdX5 \

--bootnodes /dns/bootnode-2.preprod.midnight.network/tcp/30333/ws/p2p/12D3KooWNrUBs22FfmgjqFMa9ZqKED2jnxwsXWw5E4q2XVwN35TJ
```

```
--bootnodes /dns4/bootnode-whippet-bengal.mainnet.midnight.network/tcp/30333/ws/p2p/12D3KooWMmfho3eEFvcnThAfzc9QfieTc91fdhvByL4a2naRjbr2 \

--bootnodes /dns4/bootnode-labrador-marten.mainnet.midnight.network/tcp/30333/ws/p2p/12D3KooWK2c9vf4UtrjGB27A8weKd6eiBnRQSfeR4TVmQv9MDdDt \

--bootnodes /dns4/bootnode-glider-spaniel.bn.midnight.network/tcp/30333/ws/p2p/12D3KooWHif7N1ZPhrB8WxTFqjWTxo2U2a2FtJuSA8XRBdFMss6i \

--bootnodes /dns4/bootnode-dog-pelican.bn.midnight.network/tcp/30333/ws/p2p/12D3KooWQ2NCZCnqkYKHKsYVUc8amBKAk4jhEMJyYDAJjmSuM4uK
```

## Next steps[​](#next-steps "Direct link to Next steps")

With the boot node set up, run the [RPC node](https://docs.midnight.network/nodes/rpc-node.md) to interact with the Midnight blockchain.
