# Launching the Local Relay Chain

{% hint style="info" %}
Magnet need a proper Substrate development environment to start. If you need a refresher setting up your Substrate environment, see [Substrate's Getting Started Guide](https://substrate.dev/docs/en/knowledgebase/getting-started/).
{% endhint %}

Using the [`custom-spec-raw.json`](https://docs.substrate.io/assets/tutorials/relay-chain-specs/raw-local-chainspec.json/) file provided by substrate.

1. **Build the relay chain node**

Clone the most recent release branch of the Polkadot repository to prepare a stable working environment.

```
git clone --branch release-v1.1.0 https://github.com/paritytech/polkadot-sdk.git
```

Change to the root of the polkadot directory by running the following command:

```
cd polkadot
```

Build the relay chain node by running the following command:

```
cargo build --release
```

Compiling the node can take 15 to 60 minuets to complete.

Verify the node built correctly by running the following command:

```
./target/release/polkadot --help
```

If command-line help is displayed, the node is ready to configure.

2. **Create the First Node**

```
nohup ./target/release/polkadot --alice --validator --chain custom-spec-raw.json --port 30333 --rpc-port 9944  --rpc-cors all --unsafe-rpc-external >alice.log 2>&1 &
```

3. **Create the Second Node**

```
nohup ./target/release/polkadot --bob --validator --chain custom-spec-raw.json --port 30334 --rpc-
```


---

# 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://doc.magport.io/product-guides/setup-a-local-node/launching-the-local-relay-chain.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.
