forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from PureStake/crystalin-documentation
Adds README draft
- Loading branch information
Showing
2 changed files
with
25 additions
and
39 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 |
---|---|---|
@@ -1,65 +1,51 @@ | ||
|
||
# Moonbeam | ||
# ![moonbeam](media/moonbeam-cover.jpg) | ||
|
||
## Build | ||
Run an Ethereum compatible blockchain based on Substrate. | ||
|
||
Install Rust: | ||
*See [moonbeam.network](https://moonbeam.network) for the moonbeam blockchain description.* | ||
*See [www.substrate.io](https://www.substrate.io/) for substrate information.* | ||
|
||
```bash | ||
curl https://sh.rustup.rs -sSf | sh | ||
``` | ||
## Install (linux) | ||
|
||
Initialize your Wasm Build environment: | ||
### Moonbeam | ||
|
||
```bash | ||
./scripts/init.sh | ||
git clone https://github.com/PureStake/moonbeam | ||
cd moonbeam | ||
``` | ||
|
||
Build Wasm and native code: | ||
### Dependencies | ||
|
||
Install Rust: | ||
```bash | ||
cd node | ||
cargo build --release | ||
curl https://sh.rustup.rs -sSf | sh | ||
``` | ||
## Dev dependencies | ||
|
||
Install subkey: | ||
Initialize your Wasm Build environment (*required for compiling Rust to Wasm*): | ||
```bash | ||
cargo install --force subkey --git https://github.com/paritytech/substrate | ||
./scripts/init.sh | ||
``` | ||
|
||
## Build | ||
|
||
Build Wasm and native code: | ||
```bash | ||
cargo build --release | ||
``` | ||
(Building for the first time will take a long time, to install and compile all the libraries) | ||
|
||
## Run | ||
|
||
### Single node dev | ||
|
||
TODO | ||
|
||
### Multi-node local testnet | ||
|
||
This will create 3 validator accounts - `//Armstrong`, `//Aldrin` and `//Collins` - on genesis. To be able to finalize blocks, Grandpa requires more than 2/3 of the validators to cast finality votes over a produced block, so we need to run all 3 nodes. | ||
|
||
```bash | ||
cd scripts/staging | ||
./build-spec.sh | ||
target/release/node-moonbeam --dev | ||
``` | ||
Two files - `spec.json` and `rawspec.json` - are created. | ||
|
||
Next, execute `./run-node-armstrong.sh`, `./run-node-aldrin.sh` and `./run-node-collins.sh` in separate terminals. | ||
|
||
> At this moment the chain *should* work as expected. However you will notice that blocks are not being produced. | ||
> | ||
> We are injecting `SessionKeys` on the `pallet_session` GenesisConfig. Theory says that should set the session keys on boot and start validating right away. Further investigation needs to be done to determine why it does not work and how to fix it. Proceed with the next steps to inject the keys manually. | ||
Next, with all nodes running, manually inject the Public keys to the keystore using the `./set-keys.sh` helper script. Be aware that this assumes you are on a Unix machine. `subkey`, `curl`, `grep` and `cut` commands must be available in your environment to execute it. | ||
|
||
> Confirmed by Joshy, **is not possible** to make effective the underlying `author_insertKey` rpc we just made without restarting the nodes. So we need to: | ||
Restart all nodes. | ||
|
||
They are now producing blocks and finalizing them. | ||
|
||
Telemetry is enabled and can be seen here: | ||
[https://telemetry.polkadot.io/#/Development](https://telemetry.polkadot.io/#/Development) | ||
## Contribute | ||
|
||
### Code style | ||
|
||
Moonbeam is following the [substrate code style](https://openethereum.github.io/wiki/Substrate-Style-Guide) | ||
We provide a [.editorconfig](.editorconfig) (*compatible with VSCode using RLS*) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.