Skip to content

Commit 5f7e770

Browse files
authored
Overhaul README (paritytech#289)
1 parent e6f98b5 commit 5f7e770

File tree

1 file changed

+59
-51
lines changed

1 file changed

+59
-51
lines changed

README.md

+59-51
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,43 @@
1-
# ![moonbeam](media/moonbeam-cover.jpg)
1+
# ![Moonbeam](media/moonbeam-cover.jpg)
22

33
![Tests](https://github.com/PureStake/moonbeam/workflows/Release/badge.svg)
44

5-
Run an Ethereum compatible ~~parachain~~ (and blockchain for now, until parachains are more stable)
6-
based on Substrate.
5+
An Ethereum compatible ~~[Parachain](https://polkadot.network/technology/)~~ built with [Substrate](https://substrate.dev)
76

8-
_See [moonbeam.network](https://moonbeam.network) for the moonbeam blockchain description._
9-
_See [www.substrate.io](https://www.substrate.io/) for substrate information._
7+
_Discover the Moonbeam project at [moonbeam.network](https://moonbeam.network)._
8+
_Learn to [use the Moonbeam network](https://docs.moonbeam.network/) with our technical docs._
9+
_Reference our [crate-level docs (rustdocs)](https://purestake.github.io) to contribute._
1010

11-
## Install (linux)
11+
## Run an alphanet node with Docker
1212

13-
### Get the code
14-
15-
Get the tutorial specific tag of the PureStake/Moonbeam repo:
13+
Docker images are published for every tagged release. Learn more with `moonbeam --help`.
1614

1715
```bash
18-
git clone -b tutorial-v3 https://github.com/PureStake/moonbeam
19-
cd moonbeam
16+
# Join the public testnet
17+
docker run --network="host" purestake/moonbeam:v0.6.1 --chain alphanet
2018
```
2119

22-
### Setting up enviroment
23-
24-
Install Substrate pre-requisites (including Rust):
25-
26-
```bash
27-
curl https://getsubstrate.io -sSf | bash -s -- --fast
28-
```
20+
## Run a local development node with Docker
2921

30-
Run the initialization script, which checks the correct rust nightly version and adds the
31-
`wasm32-unknown-unknown` target to that specific version:
22+
Developers who are building dApps to run on moonbeam, may want a lightweight node to work with
23+
locally. You can quickly spin up a single node with no relay chain backing it using the development
24+
service.
3225

3326
```bash
34-
./scripts/init.sh
27+
# Run a dev service node.
28+
docker run --network="host" purestake/moonbeam:v0.6.1 --dev
3529
```
3630

37-
## Build the Moonbeam Node
31+
### Sealing options
3832

39-
Build the corresponding binary file:
33+
The command above will start the node in instant seal mode. It creates a block when a transaction arrives, similar to Ganache's auto-mine. You can also choose to author blocks at a regular interval, or control authoring manually through the RPC.
4034

4135
```bash
42-
cargo build --release
43-
```
44-
45-
The first build takes a long time, as it compiles all the necessary libraries.
46-
47-
> If a _cargo not found_ error appears in the terminal, manually add Rust to your system path (or
48-
> restart your system):
49-
>
50-
> ```bash
51-
> source $HOME/.cargo/env
52-
> ```
36+
# Author a block every 6 seconds.
37+
docker run --network="host" purestake/moonbeam:v0.6.1 --dev --sealing 3000
5338

54-
## Run a Development Node
55-
56-
Moonbeam is designed to be a parachain on the Polkadot network. For testing your
57-
contracts locally, spinning up a full relay-para network is a lot of overhead.
58-
59-
A simpler solution is to run the `--dev` node, a simple node that is not backed
60-
by any relay chain, but still runs the Moonbeam runtime logic.
61-
62-
```bash
63-
./target/release/moonbase-standalone --dev
39+
# Manually control the block authorship and finality
40+
docker run --network="host" purestake/moonbeam:v0.6.1 --dev --sealing manual
6441
```
6542

6643
### Dev Addresses
@@ -103,17 +80,45 @@ the canonical mnemonic: "bottom drive obey lake curtain smoke basket hold race l
10380
- Address:0x7BF369283338E12C90514468aa3868A551AB2929
10481
- PrivKey:0x96b8a38e12e1a31dee1eab2fffdf9d9990045f5b37e44d8cc27766ef294acf18
10582

106-
### Docker image
83+
## Build the Moonbeam Node
84+
85+
To build Moonbeam, you will need a proper Substrate development environment. If you've never worked
86+
with a Substrate-based blockchain before, you should probably try the [Setting Up a Moonbeam Node]
87+
(https://docs.moonbeam.network/getting-started/local-node/setting-up-a-node/) docs first. If you
88+
need a refresher setting up your Substrate environment, see [Substrate's Getting Started Guide]
89+
(https://substrate.dev/docs/en/knowledgebase/getting-started/).
90+
91+
```bash
92+
# Fetch the code
93+
git clone https://github.com/PureStake/moonbeam
94+
cd moonbeam
95+
96+
# Optional: Ensure you have the exact nightly toolchain used by Moonbeam's CI
97+
./scripts/init.sh
98+
99+
# Build the node (The first build will be long (~30min))
100+
cargo build --release
101+
```
102+
103+
## Run tests
104+
105+
Moonbeam has Rust unit tests as well as typescript integration tests.
107106

108-
An alternative to building locally is to use docker to run a pre-build binary.
109-
The only requirement is to have Docker installed.
107+
```bash
108+
# Run the Rust unit tests
109+
cargo test
110+
```
110111

111112
```bash
112-
# Pull the docker image
113-
docker pull purestake/moonbase-parachain-testnet:latest
113+
# Install dependencies for integration tests
114+
cd moonbeam-types-bundle
115+
npm i
114116

115-
# Start a dev node
116-
docker run --rm --network host purestake/moonbase /moonbase/moonbase-standalone --dev
117+
cd ../tests
118+
npm i
119+
120+
# Run integration tests
121+
npm test
117122
```
118123

119124
## Chain IDs
@@ -177,6 +182,9 @@ This github repository is also linked to Gitlab CI
177182

178183
## Contribute
179184

185+
Moonbeam is open source under the terms of the GPL3. We welcome contributions. You can explore our
186+
crate-level documentation at https://purestake.github.io/moonbeam
187+
180188
### Code style
181189

182190
Moonbeam is following the

0 commit comments

Comments
 (0)