Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Polkadot-Sdk developer_hub #2102

Merged
merged 80 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
a451f7e
add developer-hub and all things related
kianenigma Oct 31, 2023
68a053b
fix some things
kianenigma Oct 31, 2023
f7460d8
small fixes
kianenigma Oct 31, 2023
b785e5c
Create docs.yml
kianenigma Oct 31, 2023
00a0fec
Update docs.yml
kianenigma Oct 31, 2023
50c78b4
fix some warnings
kianenigma Oct 31, 2023
89e00e9
Merge branch 'kiz-developer-hub' of github.com:kianenigma/polkadot-sd…
kianenigma Oct 31, 2023
c91250b
fix some warnings
kianenigma Oct 31, 2023
6d57d2e
fix warns
kianenigma Oct 31, 2023
76f2277
update
kianenigma Nov 1, 2023
08802f8
fix
kianenigma Nov 2, 2023
2ec4541
publish note
kianenigma Nov 2, 2023
a826834
fix
kianenigma Nov 2, 2023
8e2f6b8
Master.into()
kianenigma Nov 2, 2023
df2d645
Merge branch 'master' of github.com:paritytech/polkadot-sdk into kiz-…
liamaharon Nov 3, 2023
58d60cb
fix build
liamaharon Nov 3, 2023
c8f7f1e
default page developer hub
liamaharon Nov 3, 2023
198a3e6
Master.into()
kianenigma Nov 4, 2023
bcdc9d5
add lot of ref docs
kianenigma Nov 4, 2023
4664874
Merge branch 'kiz-developer-hub' of github.com:paritytech/polkadot-sd…
kianenigma Nov 4, 2023
d542ff1
Update substrate/frame/support/procedural/src/pallet/parse/call.rs
kianenigma Nov 4, 2023
2f76ba1
Update developer-hub/src/lib.rs
kianenigma Nov 4, 2023
00ec677
Update developer-hub/src/lib.rs
kianenigma Nov 4, 2023
9b1db8c
Update docs/mermaid/polkadot_sdk.mmd
kianenigma Nov 4, 2023
7dba4f8
Update developer-hub/src/polkadot_sdk/mod.rs
kianenigma Nov 4, 2023
3519a03
Update developer-hub/src/reference_docs/wasm_meta_protocol.rs
kianenigma Nov 4, 2023
0d72dd7
Apply suggestions from code review
kianenigma Nov 4, 2023
9942120
Apply suggestions from code review
kianenigma Nov 4, 2023
60a37a1
Upstream.into()
kianenigma Nov 4, 2023
1896ac7
reword templates page.
kianenigma Nov 4, 2023
30d6ac2
repot homepage
kianenigma Nov 4, 2023
a56d3b1
rework substrate dev section
kianenigma Nov 4, 2023
641ff3a
fix cumulus links
kianenigma Nov 4, 2023
3baa30c
Apply extrinsic-encoding ref doc suggestions
jsdw Nov 7, 2023
9c2b3ea
Apply singed-extensions ref doc suggestion
jsdw Nov 7, 2023
62b69fc
add about build
kianenigma Nov 9, 2023
4c8939b
most of the stuff done in polkadot_sdk mod
kianenigma Nov 9, 2023
7b225e1
Apply suggestions from code review
kianenigma Nov 9, 2023
0f55b9a
Update developer-hub/src/polkadot_sdk/cumulus.rs
kianenigma Nov 9, 2023
d08ab24
Update developer-hub/src/polkadot_sdk/cumulus.rs
kianenigma Nov 9, 2023
b9ee9c1
ready to merge
kianenigma Nov 9, 2023
a873808
merge about half a million comments and conflicts
kianenigma Nov 9, 2023
2d5814b
Master.into()
kianenigma Nov 9, 2023
94eeed6
deprecate tutorial
kianenigma Nov 9, 2023
745c7fd
refactor tutorial to guides
juangirini Nov 14, 2023
d305146
fix fmt
juangirini Nov 14, 2023
1d1e4a0
Merge branch 'master' into kiz-developer-hub
juangirini Nov 14, 2023
74eb750
resolve import conflict
juangirini Nov 14, 2023
36baa71
fix ci
juangirini Nov 14, 2023
8defde9
fix ui tests
juangirini Nov 14, 2023
7c839fe
fix ui test
juangirini Nov 14, 2023
196d1d7
remove unused imports
juangirini Nov 15, 2023
f3b1b5b
Merge branch 'master' into kiz-developer-hub
juangirini Nov 15, 2023
832c8e0
fix experimental aura
juangirini Nov 16, 2023
679d60b
remove experimental from zepter
juangirini Nov 16, 2023
8788c27
Merge branch 'master' into kiz-developer-hub
juangirini Nov 16, 2023
2231d51
fix docify dependency
juangirini Nov 16, 2023
8ce5fcc
wip
juangirini Nov 17, 2023
bb14a83
fix experimental aura
juangirini Nov 17, 2023
188e308
fix experimental globally
juangirini Nov 17, 2023
0738681
fix experimental aura again
juangirini Nov 17, 2023
d622d84
fix aura cargo file
juangirini Nov 17, 2023
85d4e63
fix clippy
juangirini Nov 20, 2023
d13a924
make all tests compile
juangirini Nov 21, 2023
b19ffc4
fix experimental aura in cargo
juangirini Nov 21, 2023
a14ac7c
fix ci
juangirini Nov 22, 2023
7db6f4d
undo tmp change
juangirini Nov 22, 2023
d09bfd4
Merge branch 'master' into kiz-developer-hub
juangirini Nov 22, 2023
cd4cddd
undo deposit_event_indexed change
juangirini Nov 23, 2023
cff2de6
fix tests with block numbers
juangirini Nov 23, 2023
4d7020c
fix typos
juangirini Nov 23, 2023
1955b38
fix test skipping genesis
juangirini Nov 24, 2023
44ebcf2
add some review suggestions
juangirini Nov 24, 2023
d5bcd10
remove docs workflow
juangirini Nov 27, 2023
6a8aea3
Merge branch 'master' into kiz-developer-hub
juangirini Nov 28, 2023
0a8ce8d
remove substrate from workspace
juangirini Nov 28, 2023
cefc9d4
apply review suggestions
juangirini Nov 28, 2023
f65ece4
some minor improvements
juangirini Nov 29, 2023
1166806
Merge branch 'master' into kiz-developer-hub
juangirini Nov 29, 2023
9e08068
Merge branch 'master' into kiz-developer-hub
juangirini Nov 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ artifacts
bin/node-template/Cargo.lock
nohup.out
polkadot_argument_parsing
polkadot.*
polkadot
liamaharon marked this conversation as resolved.
Show resolved Hide resolved
pwasm-alloc/Cargo.lock
pwasm-libc/Cargo.lock
release-artifacts
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ build-rustdoc:
find "$path" -name '*.html' | xargs -I {} -P "$(nproc)" bash -c 'process_file "$@"' _ {}
}
inject_simple_analytics "./crate-docs"
- echo "<meta http-equiv=refresh content=0;url=polkadot_service/index.html>" > ./crate-docs/index.html
- echo "<meta http-equiv=refresh content=0;url=developer_hub/index.html>" > ./crate-docs/index.html

build-implementers-guide:
stage: build
Expand Down
76 changes: 51 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license = "GPL-3.0-only"
resolver = "2"

members = [
"developer-hub",
"bridges/bin/runtime-common",
"bridges/modules/grandpa",
"bridges/modules/messages",
Expand Down Expand Up @@ -482,8 +483,7 @@ default-members = [ "polkadot", "substrate/bin/node/cli" ]
panic = "unwind"
opt-level = 3

# make sure dev builds with backtrace do
# not slow us down
# make sure dev builds with backtrace do not slow us down
[profile.dev.package.backtrace]
inherits = "release"

Expand Down
3 changes: 1 addition & 2 deletions cumulus/parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,7 @@ impl pallet_parachain_template::Config for Runtime {

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime
{
pub struct Runtime {
// System support stuff.
System: frame_system = 0,
ParachainSystem: cumulus_pallet_parachain_system = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub(crate) mod import_kusama_fellowship {
#[cfg(test)]
pub mod tests {
use super::import_kusama_fellowship::FellowshipAddresses;
use crate::{FellowshipCollectiveInstance as Fellowship, Runtime, System};
use crate::{FellowshipCollectiveInstance as Fellowship, Runtime};
liamaharon marked this conversation as resolved.
Show resolved Hide resolved
use frame_support::traits::OnRuntimeUpgrade;
use pallet_ranked_collective::Rank;
use parachains_common::AccountId;
Expand Down Expand Up @@ -238,7 +238,6 @@ pub mod tests {

let t = frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
let mut ext = sp_io::TestExternalities::new(t);
ext.execute_with(|| System::set_block_number(1));
ext.execute_with(|| {
assert_eq!(MemberCount::<Runtime, Fellowship>::get(0), 0);
Migration::<Runtime, Fellowship>::on_runtime_upgrade();
Expand Down
66 changes: 66 additions & 0 deletions developer-hub/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[package]
name = "developer-hub"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no consensus yet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liamaharon I've created a separate PR to address that so we don't add more noise to this one
#2565

description = "The one stop shop for developers of the polakdot-sdk"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "paritytech.github.io"
repository.workspace = true
authors.workspace = true
edition.workspace = true
# This crate is not publish-able to crates.io for now because of docify.
publish = false
version = "0.0.1"

[dependencies]
# Needed for all FRAME-based code
parity-scale-codec = { version = "3.0.0", default-features = false }
scale-info = { version = "2.6.0", default-features = false }
frame = { path = "../substrate/frame", features = ["runtime", "experimental"] }
pallet-examples = { path = "../substrate/frame/examples" }
pallet-default-config-example = { path = "../substrate/frame/examples/default-config" }

# How we build docs in rust-docs
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", branch = "main" }
docify = "0.2.6"

# Polkadot SDK deps, typically all should only be scope such that we can link to their doc item.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Polkadot SDK deps, typically all should only be scope such that we can link to their doc item.
# Polkadot SDK deps, typically all should only be in scope such that we can link to their doc item.

node-cli = { package = "staging-node-cli", path = "../substrate/bin/node/cli" }
kitchensink-runtime = { path = "../substrate/bin/node/runtime" }
chain-spec-builder = { package = "staging-chain-spec-builder", path = "../substrate/bin/utils/chain-spec-builder" }
subkey = { path = "../substrate/bin/utils/subkey" }

# Substrate
sc-network = { path = "../substrate/client/network" }
sc-rpc-api = { path = "../substrate/client/rpc-api" }
sc-rpc = { path = "../substrate/client/rpc" }
sc-client-db = { path = "../substrate/client/db" }
sc-cli = { path = "../substrate/client/cli" }
sc-consensus-aura = { path = "../substrate/client/consensus/aura" }
sc-consensus-babe = { path = "../substrate/client/consensus/babe" }
sc-consensus-grandpa = { path = "../substrate/client/consensus/grandpa" }
sc-consensus-beefy = { path = "../substrate/client/consensus/beefy" }
sc-consensus-manual-seal = { path = "../substrate/client/consensus/manual-seal" }
sc-consensus-pow = { path = "../substrate/client/consensus/pow" }
substrate-wasm-builder = { path = "../substrate/utils/wasm-builder" }

# Cumulus
cumulus-pallet-aura-ext = { path = "../cumulus/pallets/aura-ext" }
cumulus-pallet-parachain-system = { path = "../cumulus/pallets/parachain-system", features = [
"parameterized-consensus-hook",
] }
parachain-info = { package = "staging-parachain-info", path = "../cumulus/parachains/pallets/parachain-info" }
pallet-aura = { path = "../substrate/frame/aura", default-features = false }
pallet-timestamp = { path = "../substrate/frame/timestamp" }

# Primitives
sp-io = { path = "../substrate/primitives/io" }
sp-api = { path = "../substrate/primitives/api" }
sp-core = { path = "../substrate/primitives/core" }
sp-keyring = { path = "../substrate/primitives/keyring" }
sp-runtime = { path = "../substrate/primitives/runtime" }

[dev-dependencies]
parity-scale-codec = "3.6.5"
scale-info = "2.9.0"

[features]
experimental = [ "pallet-aura/experimental" ]
54 changes: 54 additions & 0 deletions developer-hub/headers/toc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<script>
window.addEventListener("DOMContentLoaded", (event) => {
// if the crate is one that starts with `developer_hub`
let crate_name = document.querySelector("#main-content > div > h1 > a:nth-child(1)");
if (!crate_name.textContent.startsWith("developer_hub")) {
console.log("skipping -- not `developer_hub`");
return;
}

let sidebar = document.querySelector(".sidebar");
let headers = document.querySelectorAll("#main-content h2, #main-content h3, #main-content h4");
console.log(`detected developer_hub: headers: ${headers.length}`);
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

let toc = document.createElement("div");
toc.classList.add("table-of-contents");
toc.appendChild(document.createElement("h2").appendChild(document.createTextNode("Table of Contents")).parentNode);

// the first two headers are always junk
headers.forEach(header => {
let link = document.createElement("a");
link.href = "#" + header.id;
link.textContent = header.textContent;
link.className = header.tagName.toLowerCase();
toc.appendChild(link);
});

sidebar.insertBefore(toc, sidebar.firstChild);
console.log("injecting ToC");
});
</script>
<style>
.table-of-contents {
margin-bottom: 1em;
padding: 0.5em;
}

.table-of-contents a {
display: block;
margin: 0.2em 0;
}

.table-of-contents .h2 {
font-weight: bold;
margin-left: 0;
}

.table-of-contents .h3 {
margin-left: 1em;
}

.table-of-contents .h4 {
margin-left: 2em;
}
</style>
1 change: 1 addition & 0 deletions developer-hub/src/guides/changing_consensus.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

liamaharon marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions developer-hub/src/guides/cumulus_enabled_parachain.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe link to the Parachains implementer guide somewhere here? https://paritytech.github.io/polkadot-sdk/book/index.html

25 changes: 25 additions & 0 deletions developer-hub/src/guides/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//! # Polkadot Developer Hub Guides
//!
//! This crate contains a collection of guides that are foundational to the developers of
//! Polkadot SDK. They common user-journeys that are traversed in the Polkadot ecosystem.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! Polkadot SDK. They common user-journeys that are traversed in the Polkadot ecosystem.
//! Polkadot SDK. They are common user-journeys that are traversed in the Polkadot ecosystem.

?


/// Write your first simple pallet, learning the most most basic features of FRAME along the way.
pub mod your_first_pallet;

/// Writing your first real [runtime](`crate::reference_docs::wasm_meta_protocol`), and successfully
/// compiling it to [WASM](crate::polkadot_sdk::substrate#wasm-build).
pub mod your_first_runtime;

/// Running the given runtime with a node. No specific consensus mechanism is used at this stage.
pub mod your_first_node;

/// How to change the consensus engine of both the node and the runtime.
pub mod changing_consensus;

/// How to enhance a given runtime and node to be cumulus-enabled, run it as a parachain and connect
/// it to a relay-chain.
pub mod cumulus_enabled_parachain;

/// How to make a given runtime XCM-enabled, capable of sending messages (`Transact`) between itself
/// and the relay chain to which it is connected.
pub mod xcm_enabled_parachain;
1 change: 1 addition & 0 deletions developer-hub/src/guides/xcm_enabled_parachain.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions developer-hub/src/guides/your_first_node.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading
Loading