Skip to content

Commit

Permalink
Build Section Reorg - "Polkadot Developer Portal" (#5332)
Browse files Browse the repository at this point in the history
* start refactor

* add description

* structure + new pages

* moved lots of stuff around

* specifiy light clients

* clean up portal layout

* little more scaffolding

* fill out more pages

* add todos

* Remove ss58 page

* add generated index page

* minor edits to grammar

* minor grammar edits

* minor grammar edits

---------

Co-authored-by: filippoweb3 <[email protected]>
  • Loading branch information
CrackTheCode016 and filippoweb3 authored Nov 15, 2023
1 parent f1e7435 commit d3aae50
Show file tree
Hide file tree
Showing 14 changed files with 245 additions and 173 deletions.
67 changes: 67 additions & 0 deletions docs/build/build-dapp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
id: build-dapp
title: Building dApps
sidebar_label: Building dApps
description: An overview about building dApps on Polkadot
keywords: [data, index, query, explorer, dashboard, dapp, uapp, app, frontend, client]
slug: ../build-dapp
---

import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem";

As with any blockchain, building decentralized applications (dApps) is a huge part of how a
developer can build on Polkadot. Within the ecosystem, you also hear the term "Unstoppable App", or
uApp. While the naming isn't too important, what is important is building resilient applications
using decentralized technology.

As an application developer, you can compose your front-end apps in a few different ways. Because
Polkadot and its parachains are all built using Substraste; you can often use the same SDK to
communicate with Polkadot, a parachain, or any other Substrate-based chain.

:::note Substrate-based chains use an SS58 encoding for their address formats.

Please see the [SS58 registry](https://github.com/paritytech/ss58-registry/) to see which
[chain corresponds to a given prefix](https://github.com/paritytech/ss58-registry/blob/main/ss58-registry.json),
and which prefixes are available.

:::

## SDKS & Libraries

If one aims to develop a **dApp** (Decentralized App) or **uApp** (Unstoppable App), the Polkadot
ecosystem contains various SDKs to tap into the relay chain and parachains. There are several
languages already supported -
[see the tooling page for a detailed overview of different SDKs and libraries that are available.](./build-tools-index.md)

## Frameworks & Toolkits

For front-end applications, several options exist for interfacing with Substrate-based chains
(parachains, relay chains, etc.) and smart contracts. These often will interact with the RPC of a
Substrate node:

<!-- prettier-ignore -->
<Tabs groupId="clients" values={[ {label: 'Polkadot.js', value: 'pjs'}, {label: 'Subxt', value: 'subxt'}, {label: 'React Hooks for ink!', value: 'useink'}, {label: 'ink!athon Boilerplate', value: 'inkathon'}, { label: 'Polkadot Cloud', value: 'pcloud'} ]}>

<TabItem value="pjs"> Promise and RxJS APIs around Polkadot and Substrate-based chains via RPC
calls. It is dynamically generated based on what the Substrate runtime provides regarding metadata.
Full documentation & examples
available&nbsp;<a href="https://polkadot.js.org/docs" target="_blank">here</a>. </TabItem>

<TabItem value="subxt"> Query and submit extrinsics (transactions) to a Substrate node via RPC using
Rust. Also referred to as Rust Parity. Full documentation & examples
available&nbsp;<a href="https://github.com/paritytech/subxt" target="_blank">here</a>. </TabItem>

<TabItem value="useink"> React hooks library for ink! smart contracts that abstract the
functionality of polkadot.js. Full documentation & examples
available&nbsp;<a href="https://use.ink" target="_blank">here</a>. </TabItem>

<TabItem value="inkathon">ink!athon is a starter kit for full-stack dApp development with ink! smart
contracts and a React-based frontend in one place. With convenient helper scripts and a
pre-configured project setup, you can quickly scaffold any dApp. Live example & full documentation
available&nbsp;<a href="https://inkathon.xyz" target="_blank">here</a>. </TabItem>

<TabItem value="pcloud">Polkadot Cloud hosts a library of assets, ranging from data sources,
graphical elements, to fully functional components, for app developers to plug and play into their
codebases. &nbsp;<a href="https://polkadot.cloud/" target="_blank">Learn more here</a>. </TabItem>

</Tabs>
4 changes: 2 additions & 2 deletions docs/build/build-data.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: build-data
title: Data Analytics
sidebar_label: Data
title: Explorer, Data, & Indexing Tools
sidebar_label: Explorer, Data, & Indexing Tools
description: An overview about building with data analytics
keywords: [data, index, query, explorer, dashboard]
slug: ../build-data
Expand Down
112 changes: 33 additions & 79 deletions docs/build/build-guide.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
id: build-guide
title: Builders Starter's Guide
sidebar_label: Builders Starter's Guide
title: Polkadot Developer Portal
sidebar_label: Polkadot Developer Portal
description: Start building with Polkadot/Kusama.
keywords: [build, how to build, develop, parachain, smart contract]
slug: ../build-guide
---

import Tabs from "@theme/Tabs";
import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; import DocCardList from
'@theme/DocCardList';

import TabItem from "@theme/TabItem";
<DocCardList />

{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} is a blockchain protocol with two
goals: providing **shared security** among all connected parachains and allowing all connected
Expand All @@ -24,14 +25,13 @@ with {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}. It will exp
between a [parachain](../learn/learn-parachains.md) and a smart contract in deciding which best fits
your architectural needs.

This build guide provides four different tracks:
This build guide provides three different tracks:

1. [Building Parachains](#building-parachains)
2. [Building a Pallet](#building-a-pallet)
3. [Developing Smart Contracts](#developing-smart-contracts)
4. [Developing a dApp](#developing-a-dappuapp)
1. [Protocol Development - Blockchain & Parachain Development](#building-parachains)
2. [Developing Smart Contracts](#developing-smart-contracts)
3. [Developing a dApp](#developing-a-dappuapp)

:::info
:::tip Keep reading to find out more, or visit each respective track

Keep in mind that these tracks are merely suggestive, and there are many ways to utilize
{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}, Substrate, and their various
Expand All @@ -40,10 +40,6 @@ developmental components. For more inspiration, look at the

:::

Before diving into any one of these tracks, it is encouraged to read about
{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} and its networks in order to gain
context about the application you could make.

## Development Ecosystem Overview

```mermaid
Expand Down Expand Up @@ -88,33 +84,11 @@ Before diving into the various paths, one can take in developing on
{{ polkadot: Polkadot :polkadot }}, it's important to realize and know key terms that make up the
following sections. Even before considering what kind of application you want to build, it's prudent
to understand what {{ polkadot: Polkadot :polkadot }} _is_ and how {{ kusama: Kusama :kusama }}
relates to it, and how what each developmental component can do for you within the Polkadot
ecosystem.

### Polkadot Ecosystem Networks

- Mainnet: **Polkadot**
- Canary network: **Kusama**
- [Kusama](https://kusama.network/) is a value-bearing canary network that gets features before
Polkadot does. _Expect Chaos_.
- Official testnets:
- **Westend** - Functionality equal to the current Polkadot mainnet, with possible next-generation
testing of features from time to time that will eventually migrate onto Polkadot. Perma-testnet
(is not reset back to genesis block).
- **Canvas** - Wasm-based Smart Contract enabled testnet, primarily for [`ink!`](https://use.ink/)
development.
- **Rococo** - Parachains and XCM testnet. Occasionally reset (started over again with a new
genesis block).

{{ polkadot: Polkadot mainnet has been running since May 2020 :polkadot }}{{ kusama: Kusama mainnet has been
running since August 2019 :kusama }} and has [implementations in various programming languages](../learn/learn-implementations.md)
ranging from Rust to JavaScript. The leading implementation is built in Rust and uses the Substrate framework.

Tooling is rapidly evolving to interact with the network; there are many ways to get started!

But before you jump head-first into the code, you should consider the _kind_ of decentralized
application you want to make and understand the different paradigms available to developers who want
to build on {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}.
relates to it, and what each developmental component can do for you within the Polkadot ecosystem.

Before diving into any one of these tracks, it is encouraged to read about
{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} and its networks in order to gain
context about the application you could make.

## Building Parachains

Expand All @@ -129,7 +103,7 @@ protocols. Parachains connect to a relay chain using the
:::info

Throughout this document, you will encounter the term **runtime** or **STF (State Transition
Function)**. Both refer to the same concept, as they define how exactly a particular system, i.e., a
Function)**. Both refer to the same concept, as they define how a particular system, i.e., a
blockchain, should deal with state changes externally and internally. Both of these terms are used
extensively in {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}, and by association,
Substrate contexts.
Expand Down Expand Up @@ -162,7 +136,7 @@ benefits of building a parachain without the cost drawback.
Polkadot is built using the [Substrate](https://substrate.io/) framework.
[Substrate](https://substrate.io/) is a highly configurable and dynamic framework for building
blockchains. At a lower level, Substrate provides a set of tools and libraries ranging from
[block production, finality gadgets, to peer-to-peer networking](https://docs.substrate.io/reference/rust-api/).
[block production, finality gadgets to peer-to-peer networking](https://docs.substrate.io/reference/rust-api/).
Both Polkadot and Kusama, as well as most parachains, are built using Substrate.

In essence, Substrate can break down a blockchain's development process by providing crucial
Expand Down Expand Up @@ -192,7 +166,7 @@ of web3.
:::note

Although most parachains utilize FRAME and Substrate to build runtime/STFs for connecting to the
relay chain, it is not contingent. Building a parachain using other tools is possible, so long as
relay chain, it is not contingent. Building a parachain using other tools is possible, as long as
they follow the [Parachains Protocol](../learn/learn-parachains-protocol.md).

As a general rule of thumb, Substrate provides the means for this to become possible through
Expand All @@ -209,30 +183,30 @@ chain follows the Parachain Protocol.

:::info

_Cumulus clouds are shaped sort of like dots; together, they form a system that is intricate,
beautiful, and functional._
_Cumulus clouds are shaped like dots; together, they form an intricate, beautiful and functional
system._

:::

For most developers, the best place to start is to get familiar with Substrate independently,
followed by FRAME, with Cumulus as the final step to understanding the entire parachain building
process. This way, one can view how various paradigms are applied and make decisions on integrating
or utilizing Substrate for their particular use case.
process. This way, one can view how various paradigms are applied and decide on integrating or
utilizing Substrate for their particular use case.

Please see the [parachain development guide](build-parachains.md) for how to get started on building
a parachain or parathread.

#### Parachains Benefits

Parachains contain their own runtime/STF logic and benefit from the shared security and the
cross-chain messaging provided by the {{ polkadot: Polkadot :polkadot }} relay chain. Parachains
cross-consensus messaging provided by the {{ polkadot: Polkadot :polkadot }} relay chain. Parachains
permit high flexibility and customization but require more effort to create and maintain over time.
A production-grade parachain is typically more involved to create due to the complexity involved in
blockchain networks' technical and economic aspects.

Parachains grant the creators more space to build the monetary system and other chain aspects from
the ground up. They will allow for a more concise and efficient execution of complex logic than a
smart contract platform could offer. Parachains also offer more flexibility in the form of
smart contract platform could offer. Parachains also provide more flexibility in the form of
governance and can perform complete upgrades in a less controversial way than the current process of
hard forks.

Expand All @@ -245,21 +219,21 @@ Some examples of features you can have on a parachain or parathread:
- A governance mechanism that could manage a DAO that is responsible for allocating your on-chain
treasury.

## Building a Pallet
### Building a Pallet

While parachains are highly customizable, they are often complex to develop. If you wish to get
familiar with FRAME and Substrate, a good place to start is by building a pallet in a development
environment. A pallet is a fully customizable module that allows you to implement layer one logic
with relatively minimal development time on a basic level while still allowing the possibility of
building advanced functionality into your custom chain.
with relatively minimal development time on a fundamental level while still allowing the possibility
of building advanced functionality into your custom chain.

To learn how to build a pallet, follow the
[Substrate documentation](https://docs.substrate.io/tutorials/build-application-logic/).

## Developing Smart Contracts

Smart contracts are another option that enables for an often simpler developer experience. Below is
a quick comparison of how building a smart contract compares to building a parachain:
Smart contracts are another option that enables an often simpler developer experience. Below is a
quick comparison of how building a smart contract compares to building a parachain:

| | Parachains | Smart Contracts |
| ----------------------- | ---------- | --------------- |
Expand Down Expand Up @@ -324,29 +298,9 @@ ecosystem contains various SDKs to tap into the relay chain and parachains.

For front-end applications, several options exist for interfacing with Substrate-based chains
(parachains, relay chains, etc.) and smart contracts. These often will interact with the RPC of a
Substrate node:

<!-- prettier-ignore -->
<Tabs groupId="clients" values={[ {label: 'Polkadot.js', value: 'pjs'}, {label: 'Subxt', value: 'subxt'}, {label: 'React Hooks for ink!', value: 'useink'}, {label: 'ink!athon Boilerplate', value: 'inkathon'} ]}>

<TabItem value="pjs"> Promise and RxJS APIs around Polkadot and Substrate based chains via RPC
calls. It is dynamically generated based on what the Substrate runtime provides in terms of
metadata. Full documentation & examples
available&nbsp;<a href="https://polkadot.js.org/docs" target="_blank">here</a>. </TabItem>

<TabItem value="subxt"> Query and submit extrinsics (transactions) to a Substrate node via RPC using
Rust. Also referred to as Rust Parity. Full documentation & examples
available&nbsp;<a href="https://github.com/paritytech/subxt" target="_blank">here</a>. </TabItem>

<TabItem value="useink"> React hooks library for ink! smart contracts that abstract the
functionality of polkadot.js. Full documentation & examples
available&nbsp;<a href="https://use.ink" target="_blank">here</a>. </TabItem>

<TabItem value="inkathon">ink!athon is a starterkit for full-stack dApp development with ink! smart
contracts and a React-based frontend in one place. With convenient helper scripts and a
pre-configured project setup, it lets you scaffold any dApp quickly. Live example & full
documentation available&nbsp;<a href="https://inkathon.xyz" target="_blank">here</a>. </TabItem>
Substrate node.

</Tabs>
[Please visit the full documentation for developing dApps and other general client-side development resources.](build-dapp)

For a full list of tools please take a look here: [Tools, APIs and Languages](build-open-source.md)
For a complete list of tools, please take a look here:
[Tools, APIs, and Languages](build-open-source.md)
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
id: build-substrate
title: Substrate Connect
sidebar_label: Substrate Connect
description: Information about Substrate Connect.
id: build-light-clients
title: Using Light Clients
sidebar_label: Using Light Clients
description: Information about light client options.
keywords: [build, substrate, substrate connect, light client]
slug: ../build-substrate
slug: ../build-light-clients
---

## Blockchain User Interfaces are still Centralized
Expand Down
53 changes: 53 additions & 0 deletions docs/build/build-network-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
id: build-network-overview
title: Networks Overview
sidebar_label: Networks Overview
description: An overview of the different networks on Polkadot
keywords: [data, index, query, explorer, dashboard, dapp, uapp, app, frontend, client]
slug: ../build-network-overview
---

While Polkadot itself is the mainnet, there are several networks that can cater to different
development or application-driven contexts.

## Polkadot Ecosystem Networks

- Mainnet: **Polkadot**
- Canary network: **Kusama**
- [Kusama](https://kusama.network/) is a value-bearing canary network that gets features before
Polkadot does. _Expect Chaos_.
- Official testnets:
- **Westend** - Functionality equal to the current Polkadot mainnet, with possible next-generation
testing of features from time to time that will eventually migrate onto Polkadot. Perma-testnet
(is not reset back to genesis block).
- **Rococo** - Parachains and XCM testnet. Occasionally reset (started over again with a new
genesis block).
- **Contracts** - Wasm-based Smart Contract enabled parachain testnet on Rococo, primarily for
[`ink!`](https://use.ink/) development.

{{ polkadot: Polkadot mainnet has been running since May 2020 :polkadot }}{{ kusama: Kusama mainnet has been
running since August 2019 :kusama }} and has [implementations in various programming languages](../learn/learn-implementations.md)
ranging from Rust to JavaScript. The leading implementation is built in Rust and uses the Substrate framework.

Tooling is rapidly evolving to interact with the network; there are many ways to get started!

But before you jump head-first into the code, you should consider the _kind_ of decentralized
application you want to make and understand the different paradigms available to developers who want
to build on {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}.

## Interfacing - PolkadotJS

PolkadotJS is the most widely used developer tool in the Polkadot ecosystem. It provides a web app
to interact with various parachains, nodes, and their RPCs, as well as a Javascript API for use
within front-end contexts. You can view more on PolkadotJS and its resources
[here](https://polkadot.js.org/).

For other programmatic ways of interacting with these networks (including PolkadotJS), please view
the [Node Interactions page](./build-node-interaction.md).

## Testnet Faucets

Almost all tesnets either have a web-based interface for getting test currency or a Matrix room
which you can post `!drip <ADDRESS>`

[See here for all available faucets and how to obtain testnet tokens.](../learn/learn-DOT.md#obtaining-testnet-tokens)
Loading

0 comments on commit d3aae50

Please sign in to comment.