-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): Adds mkdocs for project documentation (#332)
* feat: added docs * wip: pint documentation * Update index.md * Update index.md * docs: update docs * docs: add resources readme * fix: typos * docs: add note about parachain * docs: add standalone chain docs * docs: update run commands * docs: add note * feat(docs): adds docker option in getting-started * feat(docs): adds test chapter in installation * feat(docs): adds summary of e2e testing * feat(docs): note git submodule in e2e tests * feat(docs): fix typo in the submmary of e2e tests Co-authored-by: Redwan <[email protected]> Co-authored-by: Matthias Seitz <[email protected]> Co-authored-by: clearloop <[email protected]>
- Loading branch information
1 parent
252f339
commit 37515fd
Showing
19 changed files
with
763 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Publish docs via GitHub Pages | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Deploy docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v2 | ||
|
||
- name: Deploy docs | ||
uses: mhausenblas/mkdocs-deploy-gh-pages@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CONFIG_FILE: ./mkdocs.yml | ||
EXTRA_PACKAGES: build-base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
layout: default | ||
permalink: /404.html | ||
--- | ||
|
||
<style type="text/css" media="screen"> | ||
.container { | ||
margin: 10px auto; | ||
max-width: 600px; | ||
text-align: center; | ||
} | ||
h1 { | ||
margin: 30px 0; | ||
font-size: 4em; | ||
line-height: 1; | ||
letter-spacing: -1px; | ||
} | ||
</style> | ||
|
||
<div class="container"> | ||
<h1>404</h1> | ||
|
||
<p><strong>Page not found :(</strong></p> | ||
<p>The requested page could not be found.</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
body { | ||
color: #BBB !important; | ||
font-family: "ubuntu", sans-serif; | ||
line-height: 1.75 !important; | ||
} | ||
|
||
header, footer { | ||
border: 0 !important; | ||
padding: 2% 0 !important; | ||
} | ||
|
||
h1, h2, h3, h4, h5 { | ||
color: #CCC; | ||
font-weight: 500; | ||
padding-top: 2%; | ||
} | ||
|
||
h1.title { | ||
font-size: 110%; | ||
} | ||
|
||
b, strong { | ||
color: #CCC; | ||
} | ||
|
||
a { | ||
color: #e6087b !important; | ||
} | ||
|
||
a:hover { | ||
color: #EEE !important; | ||
text-decoration: none; | ||
transition: 0.1s; | ||
} | ||
|
||
ul, li { | ||
padding: 0.5% 0; | ||
} | ||
|
||
code { | ||
padding: 4px; | ||
} | ||
|
||
pre { | ||
font-size: 17px; | ||
padding: 10px 16px; | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
--- | ||
layout: default | ||
title: Installation | ||
permalink: /getting-started/installation | ||
--- | ||
|
||
# Get Started | ||
|
||
## Prerequisites | ||
|
||
This project currently builds against Rust nightly-2021-01-26. Assuming you have rustup already insatlled set up your local environment: | ||
|
||
```shell | ||
rustup install nightly-2021-01-26 | ||
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-01-26 | ||
rustup override set nightly-2021-01-26 | ||
``` | ||
|
||
## Build | ||
|
||
Once the development environment is set up, build the node template. This command will build the | ||
[Wasm](https://substrate.dev/docs/en/knowledgebase/advanced/executor#wasm-execution) and | ||
[native](https://substrate.dev/docs/en/knowledgebase/advanced/executor#native-execution) code: | ||
|
||
```bash | ||
cargo build --release | ||
``` | ||
|
||
Note: If the build fails with `(signal: 9, SIGKILL: kill)` it has probably run out of memory. Try freeing some memory or build on another machine. | ||
|
||
## Run | ||
|
||
### Development Chain | ||
|
||
You can start a standalone development chain with: | ||
|
||
```bash | ||
cargo run -- --dev --instant-sealing | ||
``` | ||
|
||
Or if already built: | ||
|
||
```bash | ||
./target/release/pint --dev --instant-sealing | ||
``` | ||
|
||
For [docker](https://github.com/ChainSafe/PINT/blob/main/docker/release.Dockerfile): | ||
|
||
``` | ||
docker run chainsafe/pint --dev --instant-sealing | ||
``` | ||
|
||
This will use the [`node/src/chain_spec/dev.rs`](../../node/src/chain_spec/dev.rs) chain spec. | ||
|
||
### Local Testnet | ||
|
||
Polkadot (release-v0.9.x branch) | ||
|
||
``` | ||
cargo build --release | ||
./target/release/polkadot build-spec --chain rococo-local --raw --disable-default-bootnode > rococo_local.json | ||
./target/release/polkadot --chain ./rococo_local.json -d cumulus_relay0 --validator --alice --port 9844 | ||
./target/release/polkadot --chain ./rococo_local.json -d cumulus_relay1 --validator --bob --port 9955 | ||
``` | ||
|
||
##### PINT Parachain: | ||
|
||
``` | ||
# this command assumes the chain spec is in a directory named polkadot that is a sibling of the pint directory | ||
./target/release/pint --collator --alice --chain pint-dev --ws-port 9945 --parachain-id 200 --rpc-cors all -- --execution wasm --chain ../polkadot/rococo_local.json --ws-port 9977 --rpc-cors all | ||
``` | ||
|
||
### Registering on Local Relay Chain | ||
|
||
In order to produce blocks you will need to register the parachain as detailed in the [Substrate Cumulus Workshop](https://substrate.dev/cumulus-workshop/#/en/3-parachains/2-register) by going to | ||
|
||
Developer -> sudo -> paraSudoWrapper -> sudoScheduleParaInitialize(id, genesis) | ||
|
||
Ensure you set the `ParaId` to `200` and the `parachain: Bool` to `Yes`. | ||
|
||
``` | ||
cargo build --release | ||
# Build the Chain spec | ||
./target/release/pint build-spec --chain=pint-dev --disable-default-bootnode > ./pint-local-plain.json | ||
# Build the raw file | ||
./target/release/pint build-spec --chain=./pint-local-plain.json --raw --disable-default-bootnode > ./pint-local.json | ||
# export genesis state and wasm | ||
./target/release/pint export-genesis-state --chain=pint-dev --parachain-id 200 > para-200-genesis | ||
./target/release/pint export-genesis-wasm --chain=pint-dev > ./para-200.wasm | ||
``` | ||
|
||
|
||
### Start a Parachain Node (Collator) | ||
|
||
From the parachain template working directory: | ||
|
||
```bash | ||
# This assumes a ParaId of 200. Change as needed. | ||
./target/release/pint \ | ||
-d /tmp/parachain/alice \ | ||
--collator \ | ||
--alice \ | ||
--force-authoring \ | ||
--ws-port 9945 \ | ||
--parachain-id 200 \ | ||
-- \ | ||
--execution wasm \ | ||
--chain pint_local.json | ||
``` | ||
|
||
|
||
|
||
* [polkadot-launch](https://github.com/paritytech/polkadot-launch) can be run by dropping the proper polkadot binary in the `./bin` folder and | ||
* Run globally | ||
* `polkadot-launch config.json` | ||
* Run locally, navigate into polkadot-launch, | ||
* ``` yarn ``` | ||
* ``` yarn start ``` | ||
|
||
|
||
## Test | ||
|
||
### Testing PINT with cargo | ||
|
||
``` | ||
cargo test --all-features | ||
``` | ||
|
||
Will run the tests of PINT with cargo. | ||
|
||
### Testing PINT with polkadot.js | ||
|
||
``` | ||
# the e2e tests require `polkadot-launch` as a git submodule | ||
git submodule update --recursive | ||
# install dependencies and run e2e tests | ||
cd js && yarn && yarn e2e | ||
``` | ||
|
||
Will bootstrap `PINT` with `polkadot-launch` and run all calls of PINT with `polkadot.js` | ||
to test both `PINT` can connect to `rococo` and PINT calls are workable with `polkadot.js`. | ||
|
||
|
||
## Learn More | ||
|
||
- More detailed instructions to use Cumulus parachains are found in the | ||
[Cumulus Workshop](https://substrate.dev/cumulus-workshop/#/en/3-parachains/2-register). | ||
- Refer to the upstream [Substrate Node Template](https://github.com/substrate-developer-hub/substrate-node-template) | ||
to learn more about the structure of this project, the capabilities it encapsulates and the way in | ||
which those capabilities are implemented. | ||
- Learn more about how a parachain block is added to a finalized chain [here](https://polkadot.network/the-path-of-a-parachain-block/). |
Oops, something went wrong.