Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.
  • Loading branch information
gavofyork committed May 5, 2018
commit 3af9ba7a0736e9886f5ad21d4ba0dc24f29cca6b
70 changes: 45 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,41 @@ Implementation of a https://polkadot.io node in Rust.
## To play

If you'd like to play with Polkadot, you'll need to install a client like this
one. First, get rust if you don't already have it:
one. First, get Rust and the support software if you don't already have it:

curl https://sh.rustup.rs -sSf | sh

You'll need `make` and `cc`; if you don't have them then install them. On Debian
that would be `sudo apt install make clang`.
```
curl https://sh.rustup.rs -sSf | sh
sudo apt install make clang
```

Then, install Polkadot PoC-1:

cargo install --git https://github.com/paritytech/polkadot.git --branch v0.1.0
```
cargo install --git https://github.com/paritytech/polkadot.git --branch v0.1.0
```

You'll now have a `polkadot` binary installed to your `PATH`. You can drop the
`--branch v0.1.0` to get the very latest version of Polkadot, but these
instructions might not work in that case.

### Development

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

polkadot --chain=dev --validator --key Alice
```
polkadot --chain=dev --validator --key Alice
```

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.

### PoC-1 Testnet

You can also connect to the global PoC-1 testnet. To do this, just use:

polkadot --chain=poc-1
```
polkadot --chain=poc-1
```

If you want to do anything on it (not that there's much to do), then you'll need
to get some PoC-1 testnet DOTs. Ask in the Polkadot watercooler.
Expand All @@ -43,11 +49,15 @@ to get some PoC-1 testnet DOTs. Ask in the Polkadot watercooler.
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=dev --validator --key Alice -d /tmp/alice
```
polkadot --chain=dev --validator --key Alice -d /tmp/alice
```

and in the other, run:

polkadot --chain=dev --validator --key Bob -d /tmp/bob --port 30334 --bootnodes 'enode://[email protected]:30333'
```
polkadot --chain=dev --validator --key Bob -d /tmp/bob --port 30334 --bootnodes 'enode://[email protected]:30333'
```

Ensure you replace `ALICE_BOOTNODE_ID_HERE` with the node ID from the output of
the first terminal.
Expand All @@ -57,28 +67,38 @@ the first terminal.
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
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup update stable
cargo install --git https://github.com/alexcrichton/wasm-gc
cargo install --git https://github.com/pepyakin/wasm-export-table.git
sudo apt install make clang
```
curl https://sh.rustup.rs -sSf | sh
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup update stable
cargo install --git https://github.com/alexcrichton/wasm-gc
cargo install --git https://github.com/pepyakin/wasm-export-table.git
sudo apt install make clang
```

Then, grab the Polkadot source code:

git clone https://github.com/paritytech/polkadot.git
cd polkadot
```
git clone https://github.com/paritytech/polkadot.git
cd polkadot
```

Then build the code:

./build.sh # Builds the WebAssembly binaries
cargo build # Builds all native code
```
./build.sh # Builds the WebAssembly binaries
cargo build # Builds all native code
```

You can run the tests if you like:

cargo test --all
```
cargo test --all
```

You can start a development chain with:

cargo run -- --chain=dev --validator --key Alice
```
cargo run -- --chain=dev --validator --key Alice
```