Skip to content

Commit 87d654b

Browse files
authored
Merge branch 'main' into develop
2 parents fb537b5 + 84cfc8b commit 87d654b

File tree

12 files changed

+85
-96
lines changed

12 files changed

+85
-96
lines changed

.github/ISSUE_TEMPLATE/broken-link.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Broken link
22
description: Report a broken link to help us fix them.
33
title: "[Broken Link]: "
4-
labels: ["fixlink"]
4+
labels: ["broken link"]
55
body:
66
- type: markdown
77
attributes:

.netlify/_redirects_production

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ https://substrate-docs.netlify.app/* https://docs.substrate.io/:splat 301!
7373
/docs/en/knowledgebase/learn-substrate/* /v3/concepts/:splat 301!
7474
/docs/en/knowledgebase/runtime /v3/concepts/runtime 301!
7575
/docs/en/knowledgebase/runtime/ /v3/concepts/runtime 301!
76+
/docs/en/knowledgebase/runtime/pallets /v3/runtime/frame#pallets 301!
77+
/docs/en/knowledgebase/runtime/origin /v3/runtime/origins 301!
7678

7779
### Knowledge Base: Runtime Development
7880
/docs/en/knowledgebase/runtime/fees /v3/runtime/weights-and-fees 301!
@@ -95,6 +97,10 @@ https://substrate-docs.netlify.app/* https://docs.substrate.io/:splat 301!
9597
/docs/en/knowledgebase/advanced/no-hash-collections/ /v3/advanced/hash-collections 301!
9698
/docs/en/knowledgebase/advanced/* /v3/advanced/:splat 301!
9799

100+
## Awesome Substrate Redirect
101+
/awesome-substrate https://substrate.io/ecosystem/resources/awesome-substrate/
102+
/awesome-substrate/ https://substrate.io/ecosystem/resources/awesome-substrate/
103+
98104
## Production: rustdocs
99105
/rustdocs/* https://paritytech.github.io/substrate/:splat 200
100106

gatsby-node.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const redirects = [
1212
{ fromPath: '/v3/integration/', toPath: '/v3/integration/polkadot-js/' },
1313
{ fromPath: '/v3/advanced/', toPath: '/v3/advanced/account-info/' },
1414
{ fromPath: '/tutorials/v3/kitties/', toPath: `/tutorials/v3/kitties/pt1/` },
15+
{
16+
fromPath: '/tutorials/v3/cumulus/',
17+
toPath: `/tutorials/v3/cumulus/start-relay/`,
18+
},
1519
{
1620
fromPath: '/how-to-guides/basics/',
1721
toPath: `/how-to-guides/v3/basics/pallet-integration/`,

v3/docs/03-runtime/c-metadata/index.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ keywords:
99

1010
Blockchains that are built on Substrate expose metadata in order to make it easier to interact with
1111
them. This metadata is separated by the different [pallets](/v3/runtime/frame#pallets) that inform your blockchain.
12-
For each module, the metadata provides information about the [storage items](../storage),
13-
[extrinsic calls](../../concepts/extrinsics), [events](../events-and-errors), constants, and errors that are
12+
For each module, the metadata provides information about the [storage items](/v3/runtime/storage),
13+
[extrinsic calls](/v3/concepts/extrinsics), [events](/v3/runtime/events-and-errors), constants, and errors that are
1414
exposed by that module. Substrate automatically generates this metadata for you and makes it
1515
available through RPC calls.
1616

1717
Since the runtime of a Substrate blockchain is an evolving part of the blockchain's state,
1818
blockchain metadata is stored on a per-block basis. Be aware that querying the metadata for an older
1919
block (with an archive node, for example) could result in acquiring out-of-date metadata that is not
2020
compatible with a blockchain's current state. As described in the
21-
[Upgrades documentation](../upgrades), developers building on top of Substrate chains can
21+
[Upgrades documentation](/v3/runtime/upgrades), developers building on top of Substrate chains can
2222
expect that the metadata for a chain should _only_ change when the chain's
2323
[runtime `spec_version`](/rustdocs/latest/sp_version/struct.RuntimeVersion.html#structfield.spec_version)
2424
changes.
@@ -264,7 +264,7 @@ about the module's storage:
264264
```
265265

266266
Every storage item that is defined in a pallet will have a corresponding metadata entry.
267-
Metadata entries like these are generated from [macros](../macros) using associated types from the [`frame-system`](/rustdocs/latest/frame_system/pallet/trait.Config.html) crate. For example:
267+
Metadata entries like these are generated from [macros](/v3/runtime/macros) using associated types from the [`frame-system`](/rustdocs/latest/frame_system/pallet/trait.Config.html) crate. For example:
268268

269269
```rust
270270
#[pallet::config]
@@ -450,11 +450,11 @@ the [`InvalidSpecName` error](/rustdocs/latest/frame_system/pallet/enum.Error.ht
450450

451451
### Learn more
452452

453-
- [Storage](../storage)
453+
- [Storage](/v3/runtime/storage)
454454
- [SCALE](/v3/advanced/scale-codec)
455-
- [Macros](../macros)
456-
- [Events](../events-and-errors)
457-
- [Extrinsics](../../concepts/extrinsics)
455+
- [Macros](/v3/runtime/macros)
456+
- [Events](/v3/runtime/events-and-errors)
457+
- [Extrinsics](/v3/concepts/extrinsics)
458458

459459
### References
460460

v3/docs/03-runtime/h-weights-and-fees/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ You can also use the Transaction Payment pallet to:
5959

6060
* Manage the withdrawal, refund, and deposit of transaction fees using `Config::OnChargeTransaction`.
6161

62-
You can learn more about these configuration traits in the [Transaction Payment](https://substrate.dev/rustdocs/latest/pallet_transaction_payment/index.html) documentation.
62+
You can learn more about these configuration traits in the [Transaction Payment](/rustdocs/latest/pallet_transaction_payment/index.html) documentation.
6363

6464
You should note that transaction fees are withdrawn before the transaction is executed.
6565
After the transaction is executed, the transaction weight can be adjusted to reflect the actual resources the transaction used.
@@ -102,10 +102,10 @@ However, this scenario would be a rare occurrence because the transaction queue
102102

103103
The inclusion fee formula always results in the same fee for the same input.
104104
However, weight can be dynamic and—based on how
105-
[`WeightToFee`](https://substrate.dev/rustdocs/latest/pallet_transaction_payment/pallet/trait.Config.html#associatedtype.WeightToFee)
105+
[`WeightToFee`](/rustdocs/latest/pallet_transaction_payment/pallet/trait.Config.html#associatedtype.WeightToFee)
106106
is defined—the final fee can include some degree of variability.
107107

108-
To account for this variability, the Transaction Payment pallet provides the [`FeeMultiplierUpdate`](https://substrate.dev/rustdocs/latest/pallet_transaction_payment/pallet/trait.Config.html#associatedtype.FeeMultiplierUpdate) configurable parameter.
108+
To account for this variability, the Transaction Payment pallet provides the [`FeeMultiplierUpdate`](/rustdocs/latest/pallet_transaction_payment/pallet/trait.Config.html#associatedtype.FeeMultiplierUpdate) configurable parameter.
109109

110110
The default update function is inspired by the Polkadot network and implements a targeted adjustment in which a target saturation level of block weight is defined.
111111
If the previous block is more saturated, then the fees are slightly increased.

v3/docs/03-runtime/i-benchmarking/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ large overhead such a process would introduce. Instead, Substrate expects benchm
2222
approximate maximum for the worst case scenario of executing an extrinsic. Users are charged assuming
2323
this worst case scenario path was taken, and if the extrinsic turns out needing less resources, some of
2424
the estimated weight and fees can be returned. This is further explained in the
25-
[Transaction Weights and Fees](../weights-and-fees) chapter.
25+
[Transaction Weights and Fees](/v3/runtime/weights-and-fees) chapter.
2626

2727
## Why benchmark a pallet
2828

v3/docs/05-integrate/c-substrate-connect/index.mdx

Lines changed: 38 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,77 +7,66 @@ category: tools
77
keywords: client, wasm, rpc, node
88
---
99

10-
Rather than a single tool, [Substrate Connect](https://paritytech.github.io/substrate-connect/) is
11-
more of a tool-kit, or bundle of tools, that enable developers to build application specific light
12-
clients for Substrate based chains. It provides a more secure alternative than connecting to
13-
a JSON-RPC node to interact with the chain.
10+
[Substrate Connect](https://paritytech.github.io/substrate-connect/) is
11+
a JavaScript library and browser extension that builds on the [Polkadot JS
12+
API](/v3/integration/polkadot-js#polkadot-js-api) to enable developers to build application
13+
specific light clients for Substrate chains. By using light clients available to all
14+
Substrate built blockchains, application developers no longer need to rely on single RPC
15+
nodes to allow end-users to interact with their applications. This introduces
16+
a new paradigm for decentralization: instead of specifying a centralized RPC node, developers
17+
just need to specify the blockchain's [chain specification](/v3/runtime/chain-specs) for
18+
their application to synchronize with the chain.
1419

15-
Substrate Connect builds on the Polkadot JS API so building an app has the same experience as with
16-
using a traditional RPC server node. Its components are also part of the Substrate building
17-
framework and available for every Substrate based project.
1820

1921
## What it enables
2022

21-
Substrate Connect provides the necessary infrastructure to run a Substrate light client in any
22-
Javascript or Node environment, from in-browser applications and extensions, to Electron apps,
23+
Substrate Connect provides application developers ways to run a Substrate light client in any
24+
NodeJS environment, from in-browser applications and extensions, to Electron apps,
2325
IOT devices, and mobile phones.
2426

25-
Substrate Connect enables Substrate runtime engineers to:
27+
For in-browser end-users, Substrate Connect is a browser extension designed to facilitate
28+
using applications with multiple blockchains, where all light clients can run in a single tab.
2629

27-
- Generate a light client of their chain in a single command.
28-
- Create an interface to run light nodes of different chains.
29-
- Create an interface to add runtimes and genesis configurations of their own chains.
30+
This implies two key features:
3031

31-
For in-browser use, Substrate Connect provides a Browser Extension built upon the
32-
`@substrate/extension` node module. It is designed to give end-users the ability to contain all
33-
running light clients in one browser tab.
32+
1. **Ready-to-use light clients for Substrate chains.** Light clients are
33+
part of the Substrate framework and with that, available for every Substrate based blockchain. This
34+
means that all you need in order to connect a Substrate chain to your application is provide the
35+
[chain specification](/v3/runtime/chain-specs) of the chain you want to connect to.
3436

35-
The extension runs a single light client, [Smoldot](https://github.com/paritytech/smoldot) that
36-
manages connecting to different blockchains. Whenever a user opens an app in a new browser tab it
37-
asks the extension to connect to whatever blockchains the app is interested in. The light client is
38-
smart enough to share resources so that it only connects to a network once even if there are
39-
multiple apps talking to it.
37+
2. **Bundling light-clients of multiple chains.** With the browser extension, end-users are able to
38+
interact with applications connected to multiple blockchains or connect their own blockchains to
39+
applications that support it.
4040

4141
## Motivation
4242

43-
1. Interacting with a Substrate chain via an RPC server requires a layer of 3rd party trust which
43+
Interacting with a Substrate chain via an RPC server requires a layer of third party trust which
4444
can be avoided. Substrate Connect uses a Wasm light client which connects to a Substrate chain
4545
without any unecessary intermediary.
4646

47-
2. Due to browser limitations on websockets from HTTPS pages, establishing a good number of peers
48-
is difficult as many nodes need to be available with TLS (Transport Layer Security). Substrate
49-
Connect provides a browser extension to overcome this limitation and to keep the chains synced in
47+
In addition, due to browser limitations on websockets from HTTPS pages, establishing a good number of peers
48+
is difficult as nodes are reachable only if they provide a TLS (Transport Layer Security) certificate.
49+
Substrate Connect provides a browser extension to overcome this limitation and to keep the chains synced in
5050
the background, making applications on a Substrate chain faster.
5151

5252
## How it works
5353

54-
### Modules
55-
56-
Substrate Connect currently has
57-
[4 different modules](https://paritytech.github.io/substrate-connect/api/modules.html):
58-
59-
- `@substrate/connect`: provides a `Detector` class to detect whether a user has the Substrate
60-
Connect browser extension installed. If it isn't installed, it falls back to instantiating a WASM
61-
light client directly in the page.
62-
63-
- `@substrate/connect-extension-protocol`: handles receiving and listening for messages from the
64-
browser extension and provider.
65-
66-
- `@substrate/extension`: manages an app's connection to multiple blockchains, creating an instance
67-
of Smoldot and connecting the app to it.
54+
The extension runs a single light client, [Smoldot](https://github.com/paritytech/smoldot) that
55+
manages connecting to different blockchains. Whenever a user opens an app in a new browser tab it
56+
asks the extension to connect to whatever blockchains the app is interested in. The light client is
57+
smart enough to share resources so that it only connects to a network once even if there are
58+
multiple apps talking to it.
6859

69-
- `@substrate/smoldot-test-utils`: utility functions for testing purposes.
60+
The [`@substrate/connect`](https://www.npmjs.com/package/@substrate/connect) library has the following
61+
capabilities:
7062

71-
The combination of these modules result in:
63+
- It detects whether a user has the Substrate Connect browser extension installed. If it
64+
isn't installed, it falls back to instantiating a light client directly in the page.
7265

73-
1. **Ready-to-use Substrate Wasm Light-Clients to be executed in the browser.** They are part of
74-
the Substrate framework and with that, available for every Substrate based project. If developers
75-
want to generate a light client of their chain, all it takes is just one command to compile a
76-
library that contains everything that's needed to run a light client in the browser.
66+
- It handles receiving and listening for messages from the browser extension and provider.
7767

78-
2. **A node module that bundles the light-clients of different chains.** It provides an interface
79-
that allows developers to run light nodes of different chains and to add runtimes and genesis
80-
configurations of their own chain.
68+
- It manages an app's connection to multiple blockchains, creating an instance of Smoldot
69+
and connecting the app to it.
8170

8271
### Usage
8372

@@ -87,15 +76,7 @@ extension. Only if the extension is not installed will it start a light client i
8776

8877
### Ways to use it
8978

90-
When building an app with Substrate Connect, it will detect whether the user has the extension and
91-
use it, or create the WASM light client in-page for them. If developers want to generate a light
92-
client of their chain, all it takes is just one command to compile a library that contains
93-
everything needed to run a light client in the browser.
94-
95-
Refer to these guides to get started with Substrate Connect:
96-
97-
- [Installation](https://github.com/paritytech/substrate-connect#getting-started)
98-
- [Launching the browser extension](https://github.com/paritytech/substrate-connect/tree/master/projects/extension)
79+
Learn how to integrate Substrate Connect in your applications [here](https://paritytech.github.io/substrate-connect/).
9980

10081
## Next steps
10182

v3/how-to-guides/01-basics/g-weights/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ difficulty: 1
1515
"This guide shows a basic procedure for configuring weights. There are more
1616
advanced methods that suit different use cases. For simple functions with fixed amounts
1717
of storage reads, this method works well. For any other use cases, see the section
18-
[on weights](../../weights/calculate-fees).
18+
[on weights](/how-to-guides/v3/weights/calculate-fees).
1919
"
2020
/>
2121

v3/how-to-guides/02-pallet-design/a-add-contracts-pallet/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ difficulty: 1
4747

4848
### 1. Import the dependencies
4949

50-
Refer to [this guide](../../basics/pallet-integration) to properly include Contracts in your runtime.
50+
Refer to [this guide](/how-to-guides/v3/basics/pallet-integration) to properly include Contracts in your runtime.
5151

5252
This includes **updating `runtime/Cargo.toml` and `runtime/Cargo.toml`** with:
5353

v3/how-to-guides/04-testing/a-basic-pallet-testing/index.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Setting up Tests for Your Pallet
33
slug: /how-to-guides/v3/testing/basics
44
keywords: basics, testing, runtime
5-
version: 3.0
5+
version: 3.0
66
section: how to guides
77
category: testing
88
difficulty: 1
@@ -16,16 +16,16 @@ difficulty: 1
1616
},
1717
{
1818
title: 'Use Cases',
19-
description:
20-
`Writing and running unit tests for a pallet.`,
19+
description: `Writing and running unit tests for a pallet.`,
2120
},
2221
{
2322
title: 'Overview',
24-
description:
25-
`This guide steps through how to use \`mock.rs\` and \`test.rs\` as a basis for testing your pallet. We'll be
26-
using the node template for the scaffolding of the \`mock.rs\` file and an arbitrary pallet — called \`pallet-testing\`
27-
— to give this guide some context. This pallet will contain a single function called \`add_value\`, that takes an origin and
28-
a \`u32\` and returns \`Ok(())\` if the value is less than or equal to a constant called \`MaxValue\` that we specify in the mock runtime.`,
23+
description: `This guide steps through how to use \`mock.rs\` and \`test.rs\` as a basis for
24+
testing your pallet. We'll be using the node template for the scaffolding of the \`mock.rs\`
25+
file and an arbitrary pallet — called \`pallet-testing\` — to give this guide some
26+
context. This pallet will contain a single function called \`add_value\`, that takes an origin
27+
and a \`u32\` and returns \`Ok(())\` if the value is less than or equal to a constant called
28+
\`MaxValue\` that we specify in the mock runtime.`,
2929
},
3030
]}
3131
/>
@@ -36,7 +36,7 @@ difficulty: 1
3636

3737
Inside `pallet-testing/src`, the first thing we need to do is create two empty files: `mock.rs` and `tests.rs`.
3838

39-
Paste in the contents from [`template/src/mock.rs`][template-node-mock-rs]. We'll use this as boilerpate
39+
Paste in the contents from [`template/src/mock.rs`][template-node-mock-rs]. We'll use this as boilerplate
4040
which we'll customize for our `pallet-testing` pallet.
4141

4242
### 2. Create a mock runtime to test your pallet
@@ -153,8 +153,8 @@ cargo test
153153

154154
#### How-to guides
155155

156-
- [Testing a transfer function](../transfer-function)
157-
- [Migration tests](../../storage-migrations/tests)
156+
- [Testing a transfer function](/how-to-guides/v3/testing/transfer-function)
157+
- [Migration tests](/how-to-guides/v3/storage-migrations/tests)
158158

159159
#### Docs
160160

0 commit comments

Comments
 (0)