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

Commit 029d553

Browse files
committed
Merge branch 'master' into v0.2
2 parents 7d07614 + aac8c45 commit 029d553

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1223
-876
lines changed

CONTRIBUTING.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## `Polkadot` projects is a **OPENISH Open Source Project**
2+
-----------------------------------------
3+
4+
## What?
5+
6+
Individuals making significant and valuable contributions are given commit-access to a project to contribute as they see fit. A project is more like an open wiki than a standard guarded open source project.
7+
8+
## Rules
9+
10+
There are a few basic ground-rules for contributors (including the maintainer(s) of the project):
11+
12+
1. **No `--force` pushes** or modifying the Git history in any way. If you need to rebase, ensure you do it in your own repo.
13+
1. **Non-master branches**, prefixed with a short name moniker (e.g. `gav-my-feature`) must be used for ongoing work.
14+
1. **All modifications** must be made in a **pull-request** to solicit feedback from other contributors.
15+
1. A pull-request *must not be merged until CI* has finished successfully.
16+
1. Contributors should adhere to the house coding style, as specified on the wiki.
17+
18+
Merging pull requests once CI is successful:
19+
20+
1. A pull request that does not alter any logic (e.g. comments, dependencies, docs) may be tagged `insubstantial` and merged by its author.
21+
1. A pull request with no large change to logic that is an urgent fix may be merged after a non-author contributor has reviewed it well.
22+
1. All other PRs should sit for 48 hours with the `pleasereview` tag in order to garner feedback.
23+
1. No PR should be merged until all reviews' comments are addressed.
24+
25+
Reviewing pull requests:
26+
27+
When reviewing a pull request, the end-goal is to suggest useful changes to the author. Reviews should finish with approval unless there are issues that would result in:
28+
29+
1. Buggy behaviour.
30+
1. Undue maintenance burden.
31+
1. Breaking with house coding style.
32+
1. Pessimisation (i.e. reduction of speed as measured in the projects benchmarks).
33+
1. Feature reduction (i.e. it removes some aspect of functionality that a significant minority of users rely on).
34+
1. Uselessness (i.e. it does not strictly add a feature or fix a known issue).
35+
36+
Reviews may not be used as an effective veto for a PR because:
37+
38+
1. There exists a somewhat cleaner/better/faster way of accomplishing the same feature/fix.
39+
1. It does not fit well with some other contributors' longer-term vision for the project.
40+
41+
## Releases
42+
43+
Declaring formal releases remains the prerogative of the project maintainer(s).
44+
45+
## Changes to this arrangement
46+
47+
This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change.
48+
49+
## Heritage
50+
51+
These contributing guidelines are modified from the "OPEN Open Source Project" guidelines for the Level project: https://github.com/Level/community/blob/master/CONTRIBUTING.md
52+
53+
-----------------------------------------

Cargo.lock

Lines changed: 117 additions & 155 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md renamed to README.adoc

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/cli/src/cli.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,20 @@ subcommands:
178178
long: max-heap-pages
179179
value_name: COUNT
180180
help: The maximum number of 64KB pages to ever allocate for Wasm execution. Don't alter this unless you know what you're doing.
181+
- revert:
182+
about: Revert chain to the previous state
183+
args:
184+
- NUM:
185+
index: 1
186+
help: Number of blocks to revert. Default is 256.
187+
- chain:
188+
long: chain
189+
value_name: CHAIN_SPEC
190+
help: Specify the chain specification.
191+
takes_value: true
192+
- base-path:
193+
long: base-path
194+
short: d
195+
value_name: PATH
196+
help: Specify custom base path.
197+
takes_value: true

0 commit comments

Comments
 (0)