* Squashed commit of the following: commit e97a17157ae0887320994661e2f816275fc75b76 Author: Ashley <ashley.ruglys@gmail.com> Date: Tue Dec 10 15:06:28 2019 +0100 Rewrite some functions as async commit 970e485179f1e087cf0a51c6a4e71f923e87df45 Merge: f98966acdf3ea965Author: Ashley <ashley.ruglys@gmail.com> Date: Tue Dec 10 11:19:37 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-futures-update commit f98966ac188067158071d1e3e243c34ea5738f56 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 23:40:20 2019 +0100 Add async blocks back in commit 7fa88af0271db659de9274c94cb8e7eead0e4289 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 23:17:02 2019 +0100 Revert "Asyncify network functions" This reverts commit f20ae6548dc482cb1e75bc80641cfe55c6131a53. commit 82413550cdac40bd14a09f62df12de49dd7e55af Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 19:09:55 2019 +0100 Fix validation test again commit 47e002b08369c9c775b92aea9b6f6ed81b30241b Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 19:07:43 2019 +0100 Switch favicon commit 0c5c1409078fc57120a39e40ec5cb1763d67d593 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 18:54:10 2019 +0100 Fix validation test commit 8bb6a0189fe824da09054cbf5b06f11a0f87072d Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 18:53:54 2019 +0100 Nits commit 33410f3a4910d3e688956cecfcca02cc2dfa6a7a Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 18:43:09 2019 +0100 Fix av store test commit f0c517eb240c42848cdb3305e0b554ef407bdfaa Merge: 938f411a 60e72111 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 18:21:39 2019 +0100 Merge branch 'ashley-futures-updates' into ashley-futures-update commit 60e72111651f2b366592c1e56756c6bf5d8ce2f1 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 18:19:40 2019 +0100 Clean up browser validation worker error commit f20ae6548dc482cb1e75bc80641cfe55c6131a53 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 18:16:40 2019 +0100 Asyncify network functions commit b22758d0a3852d701923bd238484e1c9eabec5e2 Merge: 2e8b05edef562cd7Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 17:47:26 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-futures-updates commit 2e8b05edf1a1fadd6943f967c27b6d34675ba06a Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 17:45:52 2019 +0100 Box pin changes commit 08bfdf7f2d27721abffee49221213304ebc4fd47 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 17:15:38 2019 +0100 Update network/src/lib.rs Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com> commit d8be456c508d5e5a03178db45d9f272b302a8a65 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 17:15:32 2019 +0100 Update network/src/lib.rs Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com> commit ec7367276fdd374b19f41555fd5985454c559600 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 17:14:36 2019 +0100 Update availability-store/src/worker.rs Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com> commit 938f411a9365e9c5fb16bfedb62aacac4403d063 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 17:05:05 2019 +0100 Revert "Revert removal of tokio_executor that causes tokio version mismatch panic" This reverts commit cfeb50c01d8df5e209483406a711e64761b44ae9. commit f92f58044b4fe04bde73a60820d154080dd64b16 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 15:47:35 2019 +0100 Fix adder test parachain commit cfeb50c01d8df5e209483406a711e64761b44ae9 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 15:31:36 2019 +0100 Revert removal of tokio_executor that causes tokio version mismatch panic commit 5bcb83a122b9a30f240a238ca670c6b658f4ddf1 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 15:17:55 2019 +0100 Fix typo commit fc02b1dc16e277649677396833a8d70e8588a56c Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 15:02:50 2019 +0100 Fix collator commit 6c4ff5b3bf1084a618ffec2d864090c9c8077f0f Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 14:35:37 2019 +0100 Small changes commit e1338cb4450df5377d8c911da56445914d667472 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 14:24:42 2019 +0100 Fix network tests commit 4e458f7a91c1ed5c986795f40ed55e596d176c4b Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 12:25:26 2019 +0100 Remove futures01 from availability-store commit 5729f6cd6b53f061ff155320c815509feb02309e Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 12:22:33 2019 +0100 Fix validation tests commit a820612565b42780f8b6c09c9c1c30f06a9985ba Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 12:01:48 2019 +0100 Fix availability store tests commit 112344faeee5f8f03b3b87c6baf7036a7fcbe415 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 11:36:03 2019 +0100 Update tokio version commit d2de6d8b3f0c3682679fe437d5459ac50a3c3895 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 11:33:25 2019 +0100 Revert cli tokio version to avoid libp2p panic commit 0c5f24e0c1131ac58a947448456e7fb62c869702 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 9 11:27:13 2019 +0100 Switch to polkadot-master commit 2e2311e33a4af87c2c545094ea8cb595cd6cfe2d Author: Ashley <ashley.ruglys@gmail.com> Date: Fri Dec 6 15:07:21 2019 +0100 Re-add release flag commit 6adc1b6114e154a590acf82acfaf0c1265409518 Merge: 9767f832533c80adAuthor: Ashley <ashley.ruglys@gmail.com> Date: Fri Dec 6 13:36:35 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm commit 9767f8325c33211065ef6830becdac0e3cf852de Merge: c528dc6d0bf7d294Author: Ashley <ashley.ruglys@gmail.com> Date: Wed Dec 4 17:11:39 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm commit c528dc6df8fc31cdcbc10889636355241398debd Author: Ashley <ashley.ruglys@gmail.com> Date: Wed Dec 4 17:07:00 2019 +0100 Fix wasm build commit da233a122c678dc7767dac7cc6e2564575b15cc8 Author: Ashley <ashley.ruglys@gmail.com> Date: Wed Dec 4 16:25:49 2019 +0100 tidy commit 832f8054df78afbcef1903e0f9e7e246b348c10d Merge: 4e1da888121c917dAuthor: Ashley <ashley.ruglys@gmail.com> Date: Wed Dec 4 15:56:56 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm commit 4e1da8888dd2160064dd453782fb05513c65ade4 Author: Ashley <ashley.ruglys@gmail.com> Date: Tue Dec 3 16:47:02 2019 +0100 Temp switch back to substrate/master commit af88a87338688797bbc52315fdd0fc22cf23c6cf Merge: a03a980c7832ad93Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 2 19:33:14 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm commit a03a980ce417ec7b446bfcbe7a66ec0ed6458135 Merge: 31a88a930c1ef335Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 2 13:52:37 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm commit 31a88a930ffdf5da72b3e587ec8c0e6b00922e3e Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 2 13:52:35 2019 +0100 Tidy commit 5b33b7a7af08d7a3aa3853b8e4995484fb640d52 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 2 11:55:51 2019 +0100 Add browser-demo commit 868f6e51dfdc0a64252acd9adabe7b9ba436b1f4 Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 2 10:51:57 2019 +0100 Add initial browser file commit e5e399c20f1dc4e1023ee57773dcdd9ab2a0a14b Author: Ashley <ashley.ruglys@gmail.com> Date: Mon Dec 2 10:45:02 2019 +0100 Add browser-demo commit 408288b05292d952944a6b8e1f2bcf9cf259a040 Author: Ashley <ashley.ruglys@gmail.com> Date: Sun Dec 1 19:28:33 2019 +0100 Get polkadot to compile via wasm! commit 04ffe72e868be57841d31f01eec1b90423a595d6 Author: Ashley <ashley.ruglys@gmail.com> Date: Sun Dec 1 19:28:16 2019 +0100 Migrate service commit 119f0829a53b825a3ebc9efdefa76ae7eabb04aa Merge: 93fb642837fec553Author: Ashley <ashley.ruglys@gmail.com> Date: Sun Dec 1 17:43:49 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm commit 93fb6428501bac612a1675cf3b6e3d26f5bbc7c2 Author: Ashley <ashley.ruglys@gmail.com> Date: Sun Dec 1 12:21:25 2019 +0100 Switch branch commit 0c4fe8331bdc9665ac2427eb8c795112ac728d70 Author: Ashley <ashley.ruglys@gmail.com> Date: Sat Nov 30 11:45:59 2019 +0100 Tidy up validation commit 73563253d95962657108820ae130a8d3f3093ee8 Author: Ashley <ashley.ruglys@gmail.com> Date: Sat Nov 30 11:39:09 2019 +0100 Tidy up network commit 1c9cf0427c0e2d15c4b6d52b91d67d4a3963e30d Author: Ashley <ashley.ruglys@gmail.com> Date: Sat Nov 30 01:16:35 2019 +0100 Final changes to validation commit 322cca5224fdca0a29d88ff91700ef704a9d0c2a Author: Ashley <ashley.ruglys@gmail.com> Date: Sat Nov 30 00:31:55 2019 +0100 Migrate network to std futures commit 96f1a99491f5ae2957effa58cc1e385014575a32 Author: Ashley <ashley.ruglys@gmail.com> Date: Fri Nov 29 23:31:04 2019 +0100 Migrate validation to std futures commit aaf5e55fffd1367c05687eb34f4365a24e3a34c0 Author: Ashley <ashley.ruglys@gmail.com> Date: Fri Nov 29 17:10:11 2019 +0100 Switch to Spawn trait commit 2ab282f57e8b9a55cf8d285b283cf009216511d2 Merge: cceb6b72ed7ee572Author: Ashley <ashley.ruglys@gmail.com> Date: Fri Nov 29 16:31:24 2019 +0100 Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm commit cceb6b72f5677a1c43d2cd61bd525539054f0c01 Author: Ashley <ashley.ruglys@gmail.com> Date: Fri Nov 29 15:47:14 2019 +0100 Make validation work on wasm! commit b45a95cf7d829a916bf2ad6936d1e7f4b6f3ef77 Merge:4ec635eedb7eaa6b Author: Ashley <ashley.ruglys@gmail.com> Date: Fri Nov 29 13:57:23 2019 +0100 Merge remote-tracking branch 'tomaka/wasm-start' into HEAD commit db7eaa6bd5d3bbcea829570fb47ab4d06f3558ce Merge: 6f97dbb7f826ce53Author: Pierre Krieger <pierre.krieger1708@gmail.com> Date: Thu Nov 28 13:58:15 2019 +0100 Merge branch 'master' into wasm-start commit 6f97dbb786750d854cf8f7a56c6a336ea5979228 Author: Pierre Krieger <pierre.krieger1708@gmail.com> Date: Thu Nov 28 12:47:45 2019 +0100 Use --manifest-path instead commit 20104e98ff1713b6c81b0251b43d060d4e672d55 Author: Pierre Krieger <pierre.krieger1708@gmail.com> Date: Thu Nov 28 10:44:51 2019 +0100 Make availability-store compile for WASM * Fix build * Fix futures blocking panic in validators (again) * Deindent
author, revision
| author | revision |
|---|---|
| Polkadot developers | 0.3.1 |
Polkadot
Implementation of a https://polkadot.network node in Rust.
NOTE
In 2017 we split our implementation of "Polkadot" from its platform-level component "Substrate". When we split them, we split the Polkadot code off into another repo (this repo), leaving the Substrate repo to be what used to be Polkadot, along with its branches and releases.
We are actively building both Substrate and Polkadot, but things will be a little odd for a while. If you see "substrate" and are wondering why you need it for Polkadot, now you know.
To connect on the "Kusama" canary network, you will want the v0.7 code, which is in this Polkadot repo. To play on the ("Alexander") testnet, you'll want the PoC-4 code instead. Note that PoC-3 uses the Alexander testnet, but will not be able to sync to the latest block.
-
Kusama CC-3 is in this [Polkadot] repo
masterbranch. -
Kusama CC-2 is in this Polkadot repo branch
v0.6. -
Kusama CC-1 is in this Polkadot repo branch
v0.5. -
Polkadot PoC-4 "Alexander" is in this Polkadot repo branch
v0.4. -
Polkadot PoC-3 "Alexander" is in this Polkadot repo branch
v0.3. -
Polkadot PoC-2 "Krumme Lanke" is in the Substrate repo branch
v0.2.
To play
Install Rust
If you'd like to play with Polkadot, you'll need to install a client like this one. First, get Rust (1.39.0 or later) and the support software if you don't already have it:
curl https://sh.rustup.rs -sSf | sh
You may need to add Cargo's bin directoy to your PATH environment variable. Restarting your computer will do this for you automatically. Once done, finish installing the support software:
sudo apt install make clang pkg-config libssl-dev
If you already have Rust installed, make sure you're using the latest version by running:
rustup update
Install "Kusama CC-3" Canary Network
Build Kusama by cloning this repository and running the following commands from the root directory of the repo:
git checkout master
./scripts/init.sh
cargo build --release
Connect to the global Kusama canary network by default by running:
./target/release/polkadot --name "hello world!"
You can see your node on telemetry.
Install PoC-4 on "Alexander" Testnet
Build Polkadot PoC-4 by cloning this repository and running the following commands from the root directory of the repo:
git checkout v0.4
./scripts/init.sh
./scripts/build.sh
cargo build --release
If you were previously running PoC-3 on this testnet, you may need to purge your chain data first:
./target/release/polkadot purge-chain
Finally, connect to the global "Alexander" testnet by default by running:
./target/release/polkadot
Install PoC-2 "Krumme Lanke" Testnet
Install Polkadot PoC-2 and have a polkadot binary installed to your PATH with:
cargo install --git https://github.com/paritytech/substrate.git --branch v0.2 polkadot
Connect to the global "Krumme Lanke" testnet by default by running:
polkadot
Install a custom Testnet version
You can run the following to get the very latest version of Polkadot, but these instructions will not work in that case.
cargo install --git https://github.com/paritytech/polkadot.git polkadot
If you want a specific version of Polkadot, say 0.2.5, you may run
cargo install --git https://github.com/paritytech/substrate.git --tag v0.2.5 polkadot
Obtaining DOTs
If you want to do anything on it (not that there's much to do), then you'll need to get an account and some Alexander or Krumme Lanke DOTs. Ask in the Polkadot watercooler ( https://riot.im/app/#/room/#polkadot-watercooler:matrix.org ) or get some from the Polkadot Testnet Faucet ( https://faucet.polkadot.network/ ).
Development
You can run a simple single-node development "network" on your machine by running in a terminal:
polkadot --dev
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 and choose "Alexander (hosted by Parity)" from the Settings menu.
Building
Hacking on Polkadot
If you'd actually like hack on Polkadot, you can just grab the source code and build it. Ensure you have Rust and the support software installed:
curl https://sh.rustup.rs -sSf | sh
You may need to add Cargo's bin directoy to your PATH environment variable. Restarting your computer will do this for you automatically. Once done, finish installing the support software:
sudo apt install cmake pkg-config libssl-dev git clang
Then, grab the Polkadot source code:
git clone https://github.com/paritytech/polkadot.git
cd polkadot
Then build the code:
./scripts/init.sh # Install WebAssembly. Update Rust
cargo build # Builds all native code
You can run the tests if you like:
cargo test --all
You can start a development chain with:
cargo run -- --dev
Detailed logs may be shown by running the node with the following environment variables set:
RUST_LOG=debug RUST_BACKTRACE=1 cargo run —- --dev
Local Two-node Testnet
If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet. You'll need two terminals open. In one, run:
polkadot --chain=local --validator --key Alice -d /tmp/alice
And in the other, run:
polkadot --chain=local --validator --key Bob -d /tmp/bob --port 30334 --bootnodes '/ip4/127.0.0.1/tcp/30333/p2p/ALICE_BOOTNODE_ID_HERE'
Ensure you replace ALICE_BOOTNODE_ID_HERE with the node ID from the output of the first terminal.