Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.

Commit d4ce92a

Browse files
chevdorgavofyork
authored andcommitted
WIP: Asciidoc (paritytech#407)
* Rename readme * Add some Asciidoc demo * Remove extra lines
1 parent 088c5e5 commit d4ce92a

File tree

16 files changed

+175
-63
lines changed

16 files changed

+175
-63
lines changed
Lines changed: 30 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,106 @@
1-
# Polkadot
1+
= Polkadot
2+
:Author: Polkadot developers
3+
:Revision: 0.2.0
4+
:toc:
5+
:sectnums:
26

37
Implementation of a https://polkadot.network node in Rust.
48

5-
## To play
9+
== To play
610

711
If you'd like to play with Polkadot, you'll need to install a client like this
812
one. First, get Rust (1.26.1 or later) and the support software if you don't already have it:
913

10-
```
14+
[source, shell]
15+
----
1116
curl https://sh.rustup.rs -sSf | sh
1217
sudo apt install make clang pkg-config libssl-dev
13-
```
18+
----
1419

1520
Then, install Polkadot PoC-2:
1621

17-
```
22+
[source, shell]
1823
cargo install --git https://github.com/paritytech/polkadot.git --branch v0.2 polkadot
19-
```
2024

2125
You'll now have a `polkadot` binary installed to your `PATH`. You can drop the
2226
`--branch v0.2` or run `cargo install --git https://github.com/paritytech/polkadot.git polkadot`
2327
to get the very latest version of Polkadot, but these instructions might not work in that case.
2428

25-
### Krumme Lanke Testnet
29+
=== Krumme Lanke Testnet
2630

2731
You will connect to the global Krumme Lanke testnet by default. To do this, just use:
2832

29-
```
33+
[source, shell]
3034
polkadot
31-
```
3235

3336
If you want to do anything on it (not that there's much to do), then you'll need
3437
to get some Krumme Lanke DOTs. Ask in the Polkadot watercooler.
3538

36-
### Development
39+
=== Development
3740

3841
You can run a simple single-node development "network" on your machine by
3942
running in a terminal:
4043

41-
```
44+
[source, shell]
4245
polkadot --dev
43-
```
4446

4547
You can muck around by cloning and building the http://github.com/paritytech/polka-ui and http://github.com/paritytech/polkadot-ui or just heading to https://polkadot.js.org/apps.
4648

47-
## Local Two-node Testnet
49+
== Local Two-node Testnet
4850

4951
If you want to see the multi-node consensus algorithm in action locally, then
5052
you can create a local testnet. You'll need two terminals open. In one, run:
5153

52-
```
54+
[source, shell]
5355
polkadot --chain=local --validator --key Alice -d /tmp/alice
54-
```
5556

5657
and in the other, run:
5758

58-
```
59+
[source, shell]
5960
polkadot --chain=local --validator --key Bob -d /tmp/bob --port 30334 --bootnodes '/ip4/127.0.0.1/tcp/30333/p2p/ALICE_BOOTNODE_ID_HERE'
60-
```
6161

6262
Ensure you replace `ALICE_BOOTNODE_ID_HERE` with the node ID from the output of
6363
the first terminal.
6464

65-
## Hacking on Polkadot
65+
== Hacking on Polkadot
6666

6767
If you'd actually like hack on Polkadot, you can just grab the source code and
6868
build it. Ensure you have Rust and the support software installed:
6969

70-
```
70+
[source, shell]
71+
----
7172
curl https://sh.rustup.rs -sSf | sh
7273
rustup update nightly
7374
rustup target add wasm32-unknown-unknown --toolchain nightly
7475
rustup update stable
7576
cargo install --git https://github.com/alexcrichton/wasm-gc
7677
sudo apt install cmake pkg-config libssl-dev
77-
```
78+
----
7879

7980
Then, grab the Polkadot source code:
8081

81-
```
82+
[source, shell]
83+
----
8284
git clone https://github.com/paritytech/polkadot.git
8385
cd polkadot
84-
```
86+
----
8587

8688
Then build the code:
8789

88-
```
90+
[source, shell]
91+
----
8992
./build.sh # Builds the WebAssembly binaries
9093
cargo build # Builds all native code
91-
```
94+
----
9295

9396
You can run the tests if you like:
9497

95-
```
98+
[source, shell]
9699
cargo test --all
97-
```
98100

99101
You can start a development chain with:
100102

101-
```
103+
[source, shell]
102104
cargo run -- --dev
103-
```
104-
105-
## Shell completion
106-
107-
The Polkadot cli command supports shell auto-completion. For this to work, you will need to run the completion script matching you build and system.
108-
109-
Assuming you built a release version using `cargo build --release` and use `bash` run the following:
110-
```
111-
source target/release/completion-scripts/polkadot.bash
112-
```
113-
114-
You can find completion scripts for:
115-
- bash
116-
- fish
117-
- zsh
118-
- elvish
119-
- powershell
120-
121-
To make this change persistent, you can proceed as follow:
122-
### First install
123-
```
124-
COMPL_DIR=$HOME/.completion
125-
mkdir -p $COMPL_DIR
126-
cp -f target/release/completion-scripts/polkadot.bash $COMPL_DIR/
127-
echo "source $COMPL_DIR/polkadot.bash" >> $HOME/.bash_profile
128-
source $HOME/.bash_profile
129-
```
130-
131-
### Update
132-
When you build a new version of Polkadot, the following will ensure you auto-completion script matches the current binary:
133-
```
134-
COMPL_DIR=$HOME/.completion
135-
mkdir -p $COMPL_DIR
136-
cp -f target/release/completion-scripts/polkadot.bash $COMPL_DIR/
137-
source $HOME/.bash_profile
138-
```
139105

106+
include::doc/packages.adoc[]

doc/packages.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
== Cargo Packages
3+
4+
:leveloffset: +2
5+
6+
include::../polkadot/api/README.adoc[]
7+
8+
include::../polkadot/cli/README.adoc[]
9+
10+
include::../polkadot/collator/README.adoc[]
11+
12+
include::../polkadot/consensus/README.adoc[]
13+
14+
include::../polkadot/executor/README.adoc[]
15+
16+
include::../polkadot/network/README.adoc[]
17+
18+
include::../polkadot/parachain/README.adoc[]
19+
20+
include::../polkadot/primitives/README.adoc[]
21+
22+
include::../polkadot/runtime/README.adoc[]
23+
24+
include::../polkadot/service/README.adoc[]
25+
26+
include::../polkadot/src/README.adoc[]
27+
28+
include::../polkadot/statement-table/README.adoc[]
29+
30+
include::../polkadot/transaction-pool/README.adoc[]
31+
32+
:leveloffset: -2
33+

polkadot/api/README.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
= Polkadot API
3+
4+
placeholder
5+
//TODO Write content :)

polkadot/cli/README.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
= Polkadot CLI
3+
4+
== Summary
5+
6+
[source, toml]
7+
----
8+
include::Cargo.toml[lines=2..5]
9+
----
10+
11+
include::doc/shell-completion.adoc[]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
== Shell completion
3+
4+
The Polkadot cli command supports shell auto-completion. For this to work, you will need to run the completion script matching you build and system.
5+
6+
Assuming you built a release version using `cargo build --release` and use `bash` run the following:
7+
8+
[source, shell]
9+
source target/release/completion-scripts/polkadot.bash
10+
11+
You can find completion scripts for:
12+
- bash
13+
- fish
14+
- zsh
15+
- elvish
16+
- powershell
17+
18+
To make this change persistent, you can proceed as follow:
19+
20+
.First install
21+
22+
[source, shell]
23+
----
24+
COMPL_DIR=$HOME/.completion
25+
mkdir -p $COMPL_DIR
26+
cp -f target/release/completion-scripts/polkadot.bash $COMPL_DIR/
27+
echo "source $COMPL_DIR/polkadot.bash" >> $HOME/.bash_profile
28+
source $HOME/.bash_profile
29+
----
30+
31+
.Update
32+
33+
When you build a new version of Polkadot, the following will ensure you auto-completion script matches the current binary:
34+
35+
[source, shell]
36+
----
37+
COMPL_DIR=$HOME/.completion
38+
mkdir -p $COMPL_DIR
39+
cp -f target/release/completion-scripts/polkadot.bash $COMPL_DIR/
40+
source $HOME/.bash_profile
41+
----

polkadot/collator/README.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
= Polkadot Collator
3+
4+
placeholder
5+
//TODO Write content :)

polkadot/consensus/README.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
= Polkadot Consensus
3+
4+
placeholder
5+
//TODO Write content :)

polkadot/executor/README.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
= Polkadot Executor
3+
4+
placeholder
5+
//TODO Write content :)

polkadot/network/README.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
= Polkadot Network
3+
4+
placeholder
5+
//TODO Write content :)

polkadot/parachain/README.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
= Polkadot Parachain
3+
4+
placeholder
5+
//TODO Write content :)

0 commit comments

Comments
 (0)