|
1 |
| -#  |
| 1 | +#  |
2 | 2 |
|
3 | 3 | 
|
4 | 4 |
|
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) |
7 | 6 |
|
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._ |
10 | 10 |
|
11 |
| -## Install (linux) |
| 11 | +## Run an alphanet node with Docker |
12 | 12 |
|
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`. |
16 | 14 |
|
17 | 15 | ```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 |
20 | 18 | ```
|
21 | 19 |
|
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 |
29 | 21 |
|
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. |
32 | 25 |
|
33 | 26 | ```bash
|
34 |
| -./scripts/init.sh |
| 27 | +# Run a dev service node. |
| 28 | +docker run --network="host" purestake/moonbeam:v0.6.1 --dev |
35 | 29 | ```
|
36 | 30 |
|
37 |
| -## Build the Moonbeam Node |
| 31 | +### Sealing options |
38 | 32 |
|
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. |
40 | 34 |
|
41 | 35 | ```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 |
53 | 38 |
|
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 |
64 | 41 | ```
|
65 | 42 |
|
66 | 43 | ### Dev Addresses
|
@@ -103,17 +80,45 @@ the canonical mnemonic: "bottom drive obey lake curtain smoke basket hold race l
|
103 | 80 | - Address:0x7BF369283338E12C90514468aa3868A551AB2929
|
104 | 81 | - PrivKey:0x96b8a38e12e1a31dee1eab2fffdf9d9990045f5b37e44d8cc27766ef294acf18
|
105 | 82 |
|
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. |
107 | 106 |
|
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 | +``` |
110 | 111 |
|
111 | 112 | ```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 |
114 | 116 |
|
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 |
117 | 122 | ```
|
118 | 123 |
|
119 | 124 | ## Chain IDs
|
@@ -177,6 +182,9 @@ This github repository is also linked to Gitlab CI
|
177 | 182 |
|
178 | 183 | ## Contribute
|
179 | 184 |
|
| 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 | + |
180 | 188 | ### Code style
|
181 | 189 |
|
182 | 190 | Moonbeam is following the
|
|
0 commit comments