Skip to content

Commit ff7c97f

Browse files
brunopgalvao0xlukemeshaben
authored
Add Install Polkadot SDK (#1139)
* Add install polkadot sdk * formating fix * Apply suggestions from code review Co-authored-by: Erin Shaben <[email protected]> * feedback * fix titles --------- Co-authored-by: 0xlukem <[email protected]> Co-authored-by: Lucas Malizia <[email protected]> Co-authored-by: Erin Shaben <[email protected]>
1 parent 9433199 commit ff7c97f

File tree

17 files changed

+349
-127
lines changed

17 files changed

+349
-127
lines changed

.ai/categories/basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4146,7 +4146,7 @@ From here, follow the quick starts to get connected, iterate locally with your p
41464146

41474147
---
41484148

4149-
Page Title: Install Polkadot SDK Dependencies
4149+
Page Title: Install Polkadot SDK
41504150

41514151
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-install-polkadot-sdk.md
41524152
- Canonical (HTML): https://docs.polkadot.com/parachains/install-polkadot-sdk/

.ai/categories/dapps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5430,7 +5430,7 @@ A blockchain indexer is a specialized infrastructure tool that processes, organi
54305430

54315431
---
54325432

5433-
Page Title: Install Polkadot SDK Dependencies
5433+
Page Title: Install Polkadot SDK
54345434

54355435
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-install-polkadot-sdk.md
54365436
- Canonical (HTML): https://docs.polkadot.com/parachains/install-polkadot-sdk/

.ai/categories/infrastructure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5240,7 +5240,7 @@ Westend is a Parity-maintained, Polkadot SDK-based blockchain that serves as a t
52405240

52415241
---
52425242

5243-
Page Title: Install Polkadot SDK Dependencies
5243+
Page Title: Install Polkadot SDK
52445244

52455245
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-install-polkadot-sdk.md
52465246
- Canonical (HTML): https://docs.polkadot.com/parachains/install-polkadot-sdk/

.ai/categories/networks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4515,7 +4515,7 @@ Westend is a Parity-maintained, Polkadot SDK-based blockchain that serves as a t
45154515

45164516
---
45174517

4518-
Page Title: Install Polkadot SDK Dependencies
4518+
Page Title: Install Polkadot SDK
45194519

45204520
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-install-polkadot-sdk.md
45214521
- Canonical (HTML): https://docs.polkadot.com/parachains/install-polkadot-sdk/

.ai/categories/parachains.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9394,7 +9394,7 @@ Westend is a Parity-maintained, Polkadot SDK-based blockchain that serves as a t
93949394

93959395
---
93969396

9397-
Page Title: Install Polkadot SDK Dependencies
9397+
Page Title: Install Polkadot SDK
93989398

93999399
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-install-polkadot-sdk.md
94009400
- Canonical (HTML): https://docs.polkadot.com/parachains/install-polkadot-sdk/

.ai/categories/polkadot-protocol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5073,7 +5073,7 @@ Westend is a Parity-maintained, Polkadot SDK-based blockchain that serves as a t
50735073

50745074
---
50755075

5076-
Page Title: Install Polkadot SDK Dependencies
5076+
Page Title: Install Polkadot SDK
50775077

50785078
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-install-polkadot-sdk.md
50795079
- Canonical (HTML): https://docs.polkadot.com/parachains/install-polkadot-sdk/

.ai/categories/tooling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13501,7 +13501,7 @@ A blockchain indexer is a specialized infrastructure tool that processes, organi
1350113501

1350213502
---
1350313503

13504-
Page Title: Install Polkadot SDK Dependencies
13504+
Page Title: Install Polkadot SDK
1350513505

1350613506
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-install-polkadot-sdk.md
1350713507
- Canonical (HTML): https://docs.polkadot.com/parachains/install-polkadot-sdk/

.ai/pages/parachains-install-polkadot-sdk.md

Lines changed: 116 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
---
2-
title: Install Polkadot SDK Dependencies
3-
description: Install everything you need to begin working with Substrated-based blockchains and the Polkadot SDK, the framework for building blockchains.
2+
title: Install Polkadot SDK
3+
description: Install everything you need to begin working with the Polkadot SDK, the framework for building blockchains.
44
categories: Basics, Tooling
55
url: https://docs.polkadot.com/parachains/install-polkadot-sdk/
66
---
77

8-
# Install Polkadot SDK Dependencies
8+
# Install Polkadot SDK
99

10-
This guide provides step-by-step instructions for installing the dependencies you need to work with the Polkadot SDK-based chains on macOS, Linux, and Windows. Follow the appropriate section for your operating system to ensure all necessary tools are installed and configured properly.
10+
This guide provides step-by-step instructions for installing the Polkadot SDK on macOS, Linux, and Windows. The installation process consists of two main parts:
1111

12-
## macOS
12+
1. **Installing Dependencies** - Setting up Rust, required system packages, and development tools
13+
2. **Building the Polkadot SDK** - Cloning and compiling the Polkadot SDK repository
14+
15+
Follow the appropriate section for your operating system to ensure all necessary tools are installed and configured properly.
16+
17+
## Part 1: Install Dependencies
18+
19+
### macOS
1320

1421
You can install Rust and set up a Substrate development environment on Apple macOS computers with Intel or Apple M1 processors.
1522

16-
### Before You Begin
23+
#### Before You Begin
1724

1825
Before you install Rust and set up your development environment on macOS, verify that your computer meets the following basic requirements:
1926

@@ -57,7 +64,7 @@ Protobuf must be installed before the build process can begin. To install it, ru
5764
brew install protobuf
5865
```
5966

60-
### Install Required Packages and Rust
67+
#### Install Required Packages and Rust
6168

6269
Because the blockchain requires standard cryptography to support the generation of public/private key pairs and the validation of transaction signatures, you must also have a package that provides cryptography, such as `openssl`.
6370

@@ -98,18 +105,19 @@ To install `openssl` and the Rust toolchain on macOS:
98105
rustup component add rust-src
99106
```
100107

101-
8. [Verify your installation](#verifying-installation).
102-
9. Install `cmake` using the following command:
108+
8. Install `cmake` using the following command:
103109

104110
```bash
105111
brew install cmake
106112
```
107113

108-
## Linux
114+
9. Proceed to [Part 2: Build the Polkadot SDK](#part-2-build-the-polkadot-sdk).
115+
116+
### Linux
109117

110118
Rust supports most Linux distributions. Depending on the specific distribution and version of the operating system you use, you might need to add some software dependencies to your environment. In general, your development environment should include a linker or C-compatible compiler, such as `clang` and an appropriate integrated development environment (IDE).
111119

112-
### Before You Begin {: #before-you-begin-linux }
120+
#### Before You Begin
113121

114122
Check the documentation for your operating system for information about the installed packages and how to download and install any additional packages you might need. For example, if you use Ubuntu, you can use the Ubuntu Advanced Packaging Tool (`apt`) to install the `build-essential` package:
115123

@@ -125,7 +133,7 @@ clang curl git make
125133

126134
Because the blockchain requires standard cryptography to support the generation of public/private key pairs and the validation of transaction signatures, you must also have a package that provides cryptography, such as `libssl-dev` or `openssl-devel`.
127135

128-
### Install Required Packages and Rust {: #install-required-packages-and-rust-linux }
136+
#### Install Required Packages and Rust
129137

130138
To install the Rust toolchain on Linux:
131139

@@ -194,15 +202,15 @@ To install the Rust toolchain on Linux:
194202
rustup component add rust-src
195203
```
196204

197-
9. [Verify your installation](#verifying-installation).
205+
9. Proceed to [Part 2: Build the Polkadot SDK](#part-2-build-the-polkadot-sdk).
198206

199-
## Windows (WSL)
207+
### Windows (WSL)
200208

201209
In general, UNIX-based operating systems—like macOS or Linux—provide a better development environment for building Substrate-based blockchains.
202210

203211
However, suppose your local computer uses Microsoft Windows instead of a UNIX-based operating system. In that case, you can configure it with additional software to make it a suitable development environment for building Substrate-based blockchains. To prepare a development environment on a Microsoft Windows computer, you can use Windows Subsystem for Linux (WSL) to emulate a UNIX operating environment.
204212

205-
### Before You Begin {: #before-you-begin-windows }
213+
#### Before You Begin
206214

207215
Before installing on Microsoft Windows, verify the following basic requirements:
208216

@@ -211,7 +219,7 @@ Before installing on Microsoft Windows, verify the following basic requirements:
211219
- **For Windows server**: You must be running Microsoft Windows Server 2019, or later, to install WSL on a server operating system.
212220
- You have good internet connection and access to a shell terminal on your local computer.
213221

214-
### Set Up Windows Subsystem for Linux
222+
#### Set Up Windows Subsystem for Linux
215223

216224
WSL enables you to emulate a Linux environment on a computer that uses the Windows operating system. The primary advantage of this approach for Substrate development is that you can use all of the code and command-line examples as described in the Substrate documentation. For example, you can run common commands—such as `ls` and `ps`—unmodified. By using WSL, you can avoid configuring a virtual machine image or a dual-boot operating system.
217225

@@ -247,7 +255,7 @@ To prepare a development environment using WSL:
247255

248256
For more information about setting up WSL as a development environment, see the [Set up a WSL development environment](https://learn.microsoft.com/en-us/windows/wsl/setup/environment){target=\_blank} docs.
249257

250-
### Install Required Packages and Rust {: #install-required-packages-and-rust-windows }
258+
#### Install Required Packages and Rust
251259

252260
To install the Rust toolchain on WSL:
253261

@@ -295,31 +303,103 @@ To install the Rust toolchain on WSL:
295303
rustup component add rust-src
296304
```
297305

298-
11. [Verify your installation](#verifying-installation).
306+
11. Proceed to [Part 2: Build the Polkadot SDK](#part-2-build-the-polkadot-sdk).
307+
308+
## Part 2: Build the Polkadot SDK
309+
310+
After installing all dependencies, you can now clone and compile the Polkadot SDK repository to verify your setup.
311+
312+
### Clone the Polkadot SDK
313+
314+
1. Clone the Polkadot SDK repository:
315+
316+
```bash
317+
git clone https://github.com/paritytech/polkadot-sdk.git
318+
```
319+
320+
2. Navigate into the project directory:
299321

300-
## Verifying Installation
322+
```bash
323+
cd polkadot-sdk
324+
```
325+
326+
### Compile the Polkadot SDK
327+
328+
Compile the entire Polkadot SDK repository to ensure your environment is properly configured:
329+
330+
```bash
331+
cargo build --release --locked
332+
```
333+
334+
!!!warning
335+
This initial compilation will take significant time (30-60 minutes or more) depending on your machine specifications. The `--release` flag optimizes for performance. This step compiles all components of the Polkadot SDK to verify your toolchain is correctly configured.
336+
337+
### Verify the Build
301338

302-
Verify the configuration of your development environment by running the following command:
339+
Once the build completes successfully, verify the installation by checking the compiled binaries:
303340

304341
```bash
305-
rustup show
342+
ls target/release
306343
```
307344

308-
The command displays output similar to the following:
309-
310-
<div id="termynal" data-termynal>
311-
<span data-ty="input"><span class="file-path"></span>rustup show</span>
312-
<span data-ty>...</span>
313-
<br />
314-
<span data-ty>active toolchain</span>
315-
<span data-ty>----------------</span>
316-
<span data-ty>name: stable-aarch64-apple-darwin</span>
317-
<span data-ty>active because: it's the default toolchain</span>
318-
<span data-ty>installed targets:</span>
319-
<span data-ty> aarch64-apple-darwin</span>
320-
<span data-ty> wasm32-unknown-unknown</span>
321-
</div>
345+
You should see several binaries including:
346+
347+
- `polkadot` - The Polkadot relay chain node
348+
- `polkadot-parachain` - The parachain collator node
349+
- `polkadot-omni-node` - The omni node for running parachains
350+
- `substrate-node` - The kitchensink node with many pre-configured pallets
351+
352+
Verify the Polkadot binary works by checking its version:
353+
354+
```bash
355+
./target/release/polkadot --version
356+
```
357+
358+
This should display version information similar to:
359+
360+
```bash
361+
polkadot 1.16.0-1234abcd567
362+
```
363+
364+
If you see the version output without errors, your development environment is correctly configured and ready for Polkadot SDK development!
365+
366+
## Optional: Run the Kitchensink Node
367+
368+
The Polkadot SDK includes a feature-rich node called "kitchensink" located at `substrate/bin/node`. This node comes pre-configured with many pallets and features from the Polkadot SDK, making it an excellent reference for exploring capabilities and understanding how different components work together.
369+
370+
!!!note
371+
If you've already compiled the Polkadot SDK in the previous step, the `substrate-node` binary is already built and ready to use. You can skip directly to running the node.
372+
373+
### Run the Kitchensink Node in Development Mode
374+
375+
From the `polkadot-sdk` root directory, start the kitchensink node in development mode:
376+
377+
```bash
378+
./target/release/substrate-node --dev
379+
```
380+
381+
The `--dev` flag enables development mode, which:
382+
383+
- Runs a single-node development chain
384+
- Produces and finalizes blocks automatically
385+
- Uses pre-configured development accounts (Alice, Bob, etc.)
386+
- Deletes all data when stopped, ensuring a clean state on restart
387+
388+
You should see log output indicating the node is running and producing blocks, with increasing block numbers after `finalized`.
389+
390+
### Interact with the Kitchensink Node
391+
392+
The kitchensink node is accessible at `ws://localhost:9944`. To explore its features using the Polkadot.js Apps interface:
393+
394+
1. Open [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank} in your web browser
395+
2. Click the network icon in the top left corner
396+
3. Scroll to **Development** and select **Local Node**
397+
4. Click **Switch** to connect to your local node
398+
399+
You can now explore the various pallets and features included in the kitchensink node, making it a valuable reference as you develop your own blockchain applications.
400+
401+
To stop the node, press `Control-C` in the terminal.
322402

323403
## Where to Go Next
324404

325-
- **[Parachain Zero to Hero Tutorials](/tutorials/polkadot-sdk/parachains/zero-to-hero/){target=\_blank}**: A series of step-by-step guides to building, testing, and deploying custom pallets and runtimes using the Polkadot SDK.
405+
- **[Get Started with Parachain Development](/parachains/get-started/){target=\_blank}**: Practical examples and tutorials for building and deploying Polkadot parachains, covering everything from launch to customization and cross-chain messaging.

0 commit comments

Comments
 (0)