Introduce Polkadot-Sdk developer_hub (#2102)

This PR introduces the new crate `developer_hub` into the polkadot-sdk
repo. The vision for the developer-hub crate is detailed in [this
document](https://docs.google.com/document/d/1XLLkFNE8v8HLvZpI2rzsa8N2IN1FcKntc8q-Sc4xBAk/edit?usp=sharing).

<img width="1128" alt="Screenshot 2023-11-02 at 10 45 48"
src="https://github.com/paritytech/polkadot-sdk/assets/5588131/1e12b60f-fef5-42c4-8503-a3ba234077c3">


Other than adding the new crate, it also does the following: 

* Remove the `substrate` crate, as there is now a unique umbrella crate
for multiple things in `developer_hub::polkadot_sdk`.
* (backport candidate) A minor change to `frame-support` macros that
allows `T::RuntimeOrigin` to also be acceptable as the origin type.
* (backport candidate) A minor change to `frame-system` that allows us
to deposit events at genesis because now the real genesis config is
generated via wasm, and we can safely assume `cfg!(feature = "std")`
means only testing. related to #62.
* (backport candidate) Introduces a small `read_events_for_pallet` to
`frame_system` for easier event reading in tests.
* From https://github.com/paritytech/polkadot-sdk-docs/issues/31, it
takes action on improving the `pallet::call` docs.
* From https://github.com/paritytech/polkadot-sdk-docs/issues/31, it
takes action on improving the `UncheckedExtrinsic` docs.

## Way Forward

First, a version of this is deployed temporarily
[here](https://blog.kianenigma.nl/polkadot-sdk/developer_hub/index.html).
I will keep it up to date on a daily basis.

### This Pull Request

I see two ways forward: 

1. We acknowledge that everything in `developer-hub` is going to be WIP,
and merge this asap. We should not yet use links to this crate anywhere.
2. We make this be the feature branch, make PRs against this, and either
gradually backport it, or only merge to master once it is done.

I am personally in favor of option 1. If we stick to option 2, we need a
better way to deploy a staging version of this to gh-pages.

### Issue Tracking

The main issues related to the future of `developer_hub` are: 

- https://github.com/paritytech/polkadot-sdk-docs/issues/31
- https://github.com/paritytech/polkadot-sdk-docs/issues/4
- https://github.com/paritytech/polkadot-sdk-docs/issues/26 
- https://github.com/paritytech/polkadot-sdk-docs/issues/32
- https://github.com/paritytech/polkadot-sdk-docs/issues/36


### After This Pull Request

- [ ] create a redirect for
https://paritytech.github.io/polkadot-sdk/master/substrate/
- [x] analytics 
- [ ] link checker
- [ ] the matter of publishing, and how all of these relative links for
when we do, that is still an open question. There is section on this in
the landing page.
- [ ] updated https://paritytech.github.io/

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Juan Girini <juangirini@gmail.com>
Co-authored-by: bader y <ibnbassem@gmail.com>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
This commit is contained in:
Kian Paimani
2023-11-30 14:15:46 +03:00
committed by GitHub
parent 180a6ad9b0
commit eaf1bc5633
96 changed files with 3409 additions and 470 deletions
+14
View File
@@ -0,0 +1,14 @@
flowchart
parity[paritytech.github.io] --> devhub[developer_hub]
devhub --> polkadot_sdk
devhub --> reference_docs
devhub --> tutorial
polkadot_sdk --> substrate
polkadot_sdk --> frame
polkadot_sdk --> cumulus
polkadot_sdk --> polkadot
polkadot_sdk --> xcm
+5
View File
@@ -0,0 +1,5 @@
flowchart TD
E(Extrinsic) ---> I(Inherent);
E --> T(Transaction)
T --> ST("Signed (aka. Transaction)")
T --> UT(Unsigned)
+11
View File
@@ -0,0 +1,11 @@
flowchart LR
subgraph Parachain[A Polkadot Parachain]
ParachainNode[Parachain Node]
ParachainRuntime[Parachain Runtime]
end
FRAME -.-> ParachainRuntime
Substrate[Substrate Node Libraries] -.-> ParachainNoe
CumulusC[Cumulus Node Libraries] -.-> ParachainNode
CumulusR[Cumulus Runtime Libraries] -.-> ParachainRuntime
+10
View File
@@ -0,0 +1,10 @@
flowchart LR
subgraph Polkadot[The Polkadot Relay Chain]
PolkadotNode[Polkadot Node]
PolkadotRuntime[Polkadot Runtime]
end
FRAME -.-> PolkadotRuntime
Substrate[Substrate Node Libraries] -.-> PolkadotNode
+8
View File
@@ -0,0 +1,8 @@
flowchart LR
subgraph SubstrateChain[A Substrate-based blockchain]
Node
Runtime
end
FRAME -.-> Runtime
Substrate[Substrate Node Libraries] -.-> Node
+16
View File
@@ -0,0 +1,16 @@
flowchart TB
subgraph Node[Node's View Of The State 🙈]
direction LR
0x1234 --> 0x2345
0x3456 --> 0x4567
0x5678 --> 0x6789
:code --> code[wasm code]
end
subgraph Runtime[Runtime's View Of The State 🙉]
direction LR
ab[alice's balance] --> abv[known value]
bb[bob's balance] --> bbv[known value]
cb[charlie's balance] --> cbv[known value]
c2[:code] --> c22[wasm code]
end
+21
View File
@@ -0,0 +1,21 @@
flowchart LR
%%{init: {'flowchart' : {'curve' : 'linear'}}}%%
subgraph BData[Blockchain Database]
direction LR
BN[Block N] -.-> BN1[Block N+1]
end
subgraph SData[State Database]
direction LR
SN[State N] -.-> SN1[State N+1] -.-> SN2[State N+2]
end
BN --> STFN[STF]
SN --> STFN[STF]
STFN[STF] --> SN1
BN1 --> STFN1[STF]
SN1 --> STFN1[STF]
STFN1[STF] --> SN2
+4
View File
@@ -0,0 +1,4 @@
flowchart LR
B[Block] --> STF
S[State] --> STF
STF --> NS[New State]
+5 -3
View File
@@ -1,10 +1,12 @@
graph TB
subgraph Substrate
direction LR
subgraph Client
subgraph Node
end
subgraph Runtime
end
Client --runtime-api--> Runtime
Runtime --host-functions--> Client
Node --runtime-api--> Runtime
Runtime --host-functions--> Node
end
+2
View File
@@ -0,0 +1,2 @@
flowchart LR
T[Using a Template] --> P[Writing Your Own FRAME-Based Pallet] --> C[Custom Node]
+1 -1
View File
@@ -1,7 +1,7 @@
graph TB
subgraph Substrate
direction LR
subgraph Client
subgraph Node
end
subgraph Runtime
end
+3 -3
View File
@@ -1,7 +1,7 @@
graph TB
subgraph Substrate
direction LR
subgraph Client
subgraph Node
Database
Networking
Consensus
@@ -15,6 +15,6 @@ subgraph Substrate
Identity
end
end
Client --runtime-api--> Runtime
Runtime --host-functions--> Client
Node --runtime-api--> Runtime
Runtime --host-functions--> Node
end