Skip to content

Commit

Permalink
Merge branch 'main' into patch-9
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi authored Aug 28, 2024
2 parents 21f093b + bb65e87 commit 429689b
Show file tree
Hide file tree
Showing 51 changed files with 413 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .netlify/_redirects
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Redirects from what the browser requests to what we serve

/rustdocs https://paritytech.github.io/substrate/master/sc_service/ 301!
/rustdocs https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/index.html 301!

/how-to-guides /reference/ 301!

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ Default localhost port configuration:
```env
GATSBY_WEBSITE_URL=http://localhost:8100
GATSBY_DOCS_URL=http://localhost:8200
GATSBY_MARKETPLACE_URL=http://localhost:8300
GATSBY_CAREERS_URL=https://careers.substrate.io
```

**Start development server**
Expand Down
10 changes: 1 addition & 9 deletions config/menus.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { MARKETPLACE_URL, WEBSITE_URL, CAREERS_URL } = require('./webConsts.js');
const { WEBSITE_URL } = require('./webConsts.js');

/* the main menu, ids of items must match
the submenu's key of this js object */
Expand Down Expand Up @@ -58,10 +58,6 @@ const developers = [
url: 'https://paritytech.github.io/substrate/master/sc_service/',
id: 'developers.rustdocs',
},
{
url: MARKETPLACE_URL,
id: 'developers.marketplace',
},
{
url: WEBSITE_URL + '/developers/smart-contracts/',
id: 'developers.smart-contracts',
Expand Down Expand Up @@ -128,10 +124,6 @@ const opportunities = [
url: WEBSITE_URL + '/ecosystem/opportunities/grants',
id: 'ecosystem.opportunities.grants',
},
{
url: CAREERS_URL,
id: 'ecosystem.opportunities.careers',
},
];

const resources = [
Expand Down
4 changes: 1 addition & 3 deletions config/siteMetadata.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const menus = require('./menus.js');
const { WEBSITE_URL, DOCS_URL, MARKETPLACE_URL, CAREERS_URL } = require('./webConsts.js');
const { WEBSITE_URL, DOCS_URL } = require('./webConsts.js');

module.exports = {
menus,
Expand All @@ -10,8 +10,6 @@ module.exports = {
siteUrl: DOCS_URL,
websiteUrl: WEBSITE_URL,
docsUrl: DOCS_URL,
marketplaceUrl: MARKETPLACE_URL,
careersUrl: CAREERS_URL,
author: 'Parity WebDev/W3F WebOps',
pressEmail: '[email protected]',
email: '[email protected]',
Expand Down
4 changes: 0 additions & 4 deletions config/webConsts.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const WEBSITE_URL = process.env.GATSBY_WEBSITE_URL;
const DOCS_URL = process.env.GATSBY_DOCS_URL;
const MARKETPLACE_URL = process.env.GATSBY_MARKETPLACE_URL;
const CAREERS_URL = process.env.GATSBY_CAREERS_URL;

module.exports = {
WEBSITE_URL,
DOCS_URL,
MARKETPLACE_URL,
CAREERS_URL,
};
9 changes: 7 additions & 2 deletions content/config/nav.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
menu:
- polkadot-sdk
- quick-start
- learn
- install
Expand All @@ -10,6 +11,10 @@ menu:
- reference
- community

polkadot-sdk:
title: Substrate to Polkadot SDK
url: /polkadot-sdk/

quick-start:
title: Quick start
url: /quick-start/
Expand Down Expand Up @@ -84,7 +89,7 @@ install:
url: /install/developer-tools/
- title: Troubleshoot Rust issues
url: /install/troubleshoot-rust-issues/

#design:
# title: Design
# url: /design/
Expand Down Expand Up @@ -156,7 +161,7 @@ test:
url: /test/simulate-parachains/
- title: Check runtime
url: /test/check-runtime/

deploy:
title: Deploy
url: /deploy/
Expand Down
2 changes: 0 additions & 2 deletions content/locales/en/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"developers.home": "Home",
"developers.docs": "Docs",
"developers.rustdocs": "Rust Docs",
"developers.marketplace": "Marketplace",
"developers.smart-contracts": "Smart Contracts",
"developers.substrate-connect": "Substrate Connect",
"developers.rococo-network": "Rococo Network",
Expand All @@ -31,7 +30,6 @@

"ecosystem.opportunities.hackathons": "Hackathons",
"ecosystem.opportunities.grants": "Grants",
"ecosystem.opportunities.careers": "Careers",

"ecosystem.resources.seminar": "Substrate Seminar",
"ecosystem.resources.past-seminars": "Past Seminars",
Expand Down
21 changes: 13 additions & 8 deletions content/md/en/docs/build/genesis-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords:
---

<div class="warning">
<strong>⚠️ WARNING:</strong> This page contains outdated information. Please refer to the <a href="https://paritytech.github.io/polkadot-sdk/master/frame_support/pallet_macros/attr.genesis_build.html">Rust docs</a> for the most up-to-date documentation on this topic.
Please refer to the <a href="https://paritytech.github.io/polkadot-sdk/master/frame_support/pallet_macros/attr.genesis_build.html">Rust docs</a> for the most up-to-date documentation on this topic.
</div>


Expand All @@ -19,7 +19,7 @@ As you learned in [Chain specification](/build/chain-spec/), the chain specifica
However, the chain specification doesn't create the storage items that get initialized when you start a node.
Instead, the storage items are defined in the pallets included in the runtime as described in [Runtime storage](/build/runtime-storage/).

After you create storage items for the runtime, you can choose whether they should be set to some initial value as part of the genesis configuration and included in the genesis block.
After you create storage items for the runtime, you can choose whether they should be set to some initial value as part of the genesis configuration and included in the genesis block.
To specify the storage items that you want to set an initial state for, Substrate provides two specialized FRAME attribute macros.

The macros you can use to initialize storage items as part of the genesis configuration for a chain are:
Expand Down Expand Up @@ -120,12 +120,17 @@ All of the `GenesisConfig` types for the pallets that included in the constructi
The aggregated `RuntimeGenesisConfig` implements the [`BuildStorage`](https://paritytech.github.io/substrate/master/sp_runtime/trait.BuildStorage.html) trait to build all of the initial storage items for the runtime.
For example, the node template runtime builds storage items for the following pallets that have a `RuntimeGenesisConfig` specified by default:

- [System pallet](#system-pallet)
- [Aura pallet](#aura-pallet)
- [Grandpa pallet](#grandpa-pallet)
- [Balances pallet](#balances-pallet)
- [TransactionPayment pallet](#transactionpayment-pallet)
- [Sudo pallet](#sudo-pallet)
- [Configure a simple storage value](#configure-a-simple-storage-value)
- [Configure macros in the pallet](#configure-macros-in-the-pallet)
- [Configure the chain specification](#configure-the-chain-specification)
- [Adding genesis configuration to the runtime](#adding-genesis-configuration-to-the-runtime)
- [System pallet](#system-pallet)
- [Aura pallet](#aura-pallet)
- [Grandpa pallet](#grandpa-pallet)
- [Balances pallet](#balances-pallet)
- [TransactionPayment pallet](#transactionpayment-pallet)
- [Sudo pallet](#sudo-pallet)
- [Initialize storage items within a pallet](#initialize-storage-items-within-a-pallet)

### System pallet

Expand Down
4 changes: 4 additions & 0 deletions content/md/en/docs/build/origins.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ keywords:
- origins
---

<div class="warning">
Please refer to the <a href="https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/frame_origin/index.html">Rust docs</a> for the most up-to-date documentation on this topic.
</div>

The runtime origin is used by dispatchable functions to check where a call has come from.

## Raw origins
Expand Down
4 changes: 4 additions & 0 deletions content/md/en/docs/build/pallet-coupling.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ keywords:
- pallet design
---

<div class="warning">
Please refer to the <a href="https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/frame_pallet_coupling/index.html">Rust Docs</a> for the most up-to-date documentation on this topic.
</div>

The term **coupling** is often used to describe the degree to which two software modules depend on each other.
For example, in object-oriented programming tight coupling and loose coupling are used to describe the relationship between objects classes:

Expand Down
2 changes: 1 addition & 1 deletion content/md/en/docs/build/randomness.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Substrate includes two examples of how to implement the `Randomness` trait in pa
You should only use this pallet in applications with low security requirements or when testing randomness-consuming applications.
You shouldn't use this pallet in a production environment.

= The [BABE pallet](https://paritytech.github.io/substrate/master/pallet_babe/index.html) provides randomness by using verifiable random functions.
- The [BABE pallet](https://paritytech.github.io/substrate/master/pallet_babe/index.html) provides randomness by using verifiable random functions.

This pallet provides production-grade randomness, and is used in Polkadot.
If you select this pallet as the source of randomness your blockchain must use the blind assignment of blockchain extension ([BABE](/reference/glossary/#blind-assignment-of-blockchain-extension-babe)) slot-based consensus for producing blocks.
Expand Down
4 changes: 4 additions & 0 deletions content/md/en/docs/build/remote-procedure-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ keywords:
- frontend
---

<div class="warning">
Please refer to the <a href="https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/custom_runtime_api_rpc/index.html">Rust docs</a> for the most up-to-date documentation on this topic.
</div>

Remote procedure calls, or RPC methods, are a way for an external program—for example, a browser or front-end application—to communicate with a Substrate node.
In general, these methods enable an RPC client to connect to an RPC server endpoint to request some type of service.
For example, you might use an RPC method to read a stored value, submit a transaction, or request information about the chain a node is connected to.
Expand Down
2 changes: 1 addition & 1 deletion content/md/en/docs/build/tx-weights-fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ use frame_support:: {
Pays::Yes,
},
weights::Weight,
};

#[pallet::weight(FunctionOf(
|args: (&Vec<User>,)| args.0.len().saturating_mul(10_000),
)
]

fn handle_users(origin, calls: Vec<User>) {
// Do something per user
}
Expand Down
4 changes: 2 additions & 2 deletions content/md/en/docs/deploy/keys-and-network-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Session keys are private online keys that are used by validators to sign consens
Session keys must be available online to enable the validator to perform certain network operations.

These keys aren't used to control funds and they should only be used for their intended purpose.
They can be changed regularly
They can be changed regularly.
To create session keys, a validator node operator must use a controller account to generate a certificate signed with the session's public key.
The certificate attests that the key acts on behalf of the validator's staking account and nominators.
After creating the session key, the validator node operator informs the chain that this key represents the controller key by
publishing the session certificate in a transaction on the chain.
In most cases, node operators use the [Session](https://paritytech.github.io/substrate/master/pallet_session/index.html)) pallet to manage their session keys.
In most cases, node operators use the [Session](https://paritytech.github.io/substrate/master/pallet_session/index.html) pallet to manage their session keys.

The [`SessionKeys`](https://paritytech.github.io/substrate/master/sp_session/index.html)
trait is a generic, indexable type and you can declare any number of session keys in the runtime.
Expand Down
18 changes: 9 additions & 9 deletions content/md/en/docs/examples/quickstart/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,36 @@
}
</style>
</head>

<body>
<main role="main" class="container">
<h1 style="font-family: sans-serif; font-weight: 500;">Display an account balance</h1>
<p style="font-family: sans-serif;">Enter a development account address, then click <b>Get Balance</b>.</p>

<input type="text" size="58" id="account_address"/>
<input type="button" onclick="GetBalance()" value="Get Balance">
<p class="output">Balance: <span id="polkadot-balance">Not Connected</span></p>
</main>

<script src="https://unpkg.com/@polkadot/util/bundle-polkadot-util.js"></script>
<script src="https://unpkg.com/@polkadot/util-crypto/bundle-polkadot-util-crypto.js"></script>
<script src="https://unpkg.com/@polkadot/types/bundle-polkadot-types.js"></script>
<script src="https://unpkg.com/@polkadot/api/bundle-polkadot-api.js"></script>

<script>
async function GetBalance() {
const ADDR = '5Gb6Zfe8K8NSKrkFLCgqs8LUdk7wKweXM5pN296jVqDpdziR';

const { WsProvider, ApiPromise } = polkadotApi;
const wsProvider = new WsProvider('ws://127.0.0.1:9944');
const polkadot = await ApiPromise.create({ provider: wsProvider });

let polkadotBalance = document.getElementById("polkadot-balance");
const x = document.getElementById("account_address").value;
const { data: balance } = await polkadot.query.system.account(x);

polkadotBalance.innerText = balance.free;
}
}
</script>
</body>
</html>
</html>
8 changes: 4 additions & 4 deletions content/md/en/docs/install/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Set up a local development environment for Substrate on macOS.
keywords:
---

You can install Rust and set up a Substrate development environment on Apple macOS computers with either Intel or an Apple M1 processors.
You can install Rust and set up a Substrate development environment on Apple macOS computers with either Intel or Apple Silicon (M-series) processors.

## Before you begin

Expand All @@ -13,7 +13,7 @@ Before you install Rust and set up your development environment on macOS, verify
- Operating system version is 10.7 Lion, or later.
- Processor speed of at least 2Ghz, 3Ghz recommended.
- Memory of at least 8 GB RAM, 16 GB recommended.
- Storage of at 10 GB available space.
- Storage of 10 GB available.
- Broadband Internet connection.

### Support for Apple Silicon
Expand Down Expand Up @@ -144,7 +144,7 @@ To install `openssl` and the Rust toolchain on macOS:
Now that you have Rust installed and the Rust toolchains configured for Substrate development, you are ready to finish setting up your development environment by cloning the Substrate **node template** files and compiling a Substrate node.

The node template provides a working environment that includes all of the most common features you need to build a blockchain without any extraneous modules or tools.
To ensure that the node template offers a relatively stable working environment for you to experiment with, the recommended best practice is to clone Substrate node template from the Substrate Developer Hub repository, rather than from the core Substrate repository.
To ensure that the node template offers a relatively stable working environment for you to experiment with, the recommended best practice is to clone the Substrate node template from the Substrate Developer Hub repository, rather than from the core Substrate repository.

To compile the Substrate node template:

Expand Down Expand Up @@ -178,7 +178,7 @@ To compile the Substrate node template:

Because of the number of packages required, compiling the node can take several minutes.

After the build completes successfully, your local computer is ready for Substrate development activity.
After the build is completed successfully, your local computer is ready for Substrate development activity.

## Where to go next

Expand Down
12 changes: 6 additions & 6 deletions content/md/en/docs/install/troubleshoot-rust-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ WASM_BUILD_TOOLCHAIN=nightly-<yyyy-MM-dd> cargo build --release
```

This command builds the _runtime_ using the specified nightly toolchain.
The rest of project is compiled using the _default_ toolchain, that is, the latest version of the `stable` toolchain that you have installed.
The rest of the project is compiled using the _default_ toolchain, that is, the latest version of the `stable` toolchain that you have installed.

### Downgrade the nightly toolchain

If your computer is configured to use the latest Rust `nightly` toolchain and you want to downgrade to a specific nightly version,you must first uninstall the latest `nightly` toolchain.
If your computer is configured to use the latest Rust `nightly` toolchain and you want to downgrade to a specific nightly version, you must first uninstall the latest `nightly` toolchain.
For example, you can remove the latest `nightly` toolchain, then use a specific version of the `nightly` toolchain by running commands similar to the following:

```sh
Expand All @@ -129,17 +129,17 @@ rustup target add wasm32-unknown-unknown --toolchain nightly-<yyyy-MM-dd>

## Ensure PATH is set correctly

If after installing Rust the commands don't seem to work, showing errors such as `command not found: rustup`, make sure it your PATH is configured correctly.
If after installing Rust the commands don't seem to work, showing errors such as `command not found: rustup`, make sure that your PATH is configured correctly.

Currently, the `rustup` installer installs by default to the bash profile (on mac). If you are using another shell, make sure to add this line to your profile (e.g. `.zshrc`):
Currently, the `rustup` installer installs by default to the bash profile (on Mac). If you are using another shell, make sure to add this line to your profile (e.g. `.zshrc`):

```bash
source "$HOME/.cargo/env"
```

## Installing cmake or protobuf for M1 macOS users
## Installing cmake or protobuf for Apple Silicon (M-series) macOS users

Currently, there are issues compiling the Substrate node when using the packages that are pre-installed on macOS computers with the M1 chip.
Currently, there are issues when compiling the Substrate node while using the packages that are pre-installed on macOS computers with the M-series chip.

```sh
error: failed to run custom build command for prost-build v0.10.4
Expand Down
4 changes: 2 additions & 2 deletions content/md/en/docs/learn/accounts-addresses-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The secret seed phrase is important because it can be used to recover access to

For most networks, the **public key** associated with an account is how that account is identified on the network and some form of it is used as the destination address for transactions.
However, Substrate-based chains use the underlying public key to derive one or more **public addresses**.
Instead of using the public key directly, Substrate allows you generate multiple addresses and address formats for an account.
Instead of using the public key directly, Substrate allows you to generate multiple addresses and address formats for an account.

## Address encoding and chain-specific addresses

Expand Down Expand Up @@ -74,7 +74,7 @@ For more information about working with generic types, see [Rust for Substrate](

## Specialized accounts

As a flexible and module framework for blockchain development, Substrate itself doesn't require you define or use any specific type of accounts.
As a flexible and module framework for blockchain development, Substrate itself doesn't require you to define or use any specific type of accounts.
However, different chains can implement different rules for how accounts and the keys that control them are used.
For example, you might implement specialized accounts if your application requires:

Expand Down
4 changes: 4 additions & 0 deletions content/md/en/docs/learn/offchain-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: Highlights how you can integrate data from offchain sources into th
keywords:
---

<div class="warning">
Please refer to the <a href="https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/frame_offchain_workers/index.html">Rust Docs</a> for the most up-to-date documentation on this topic.
</div>

There are many use cases where you might want to query data from an offchain source or process data without using on-chain resources before updating the on-chain state.
The conventional way of incorporating offchain data involves connecting to [oracles](/reference/glossary#oracle) to supply the data from some traditional source.
Although using oracles is one approach to working with offchain data sources, there are limitations to the security, scalability, and infrastructure efficiency that oracles can provide.
Expand Down
1 change: 0 additions & 1 deletion content/md/en/docs/learn/runtime-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ pub mod pallet {
// Declare the pallet type
// This is a placeholder to implement traits and methods.
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

// Add the runtime configuration trait
Expand Down
Loading

0 comments on commit 429689b

Please sign in to comment.