# 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-
```
