Manually Compile the Moonbeam Binary¶
Running a full node on a Moonbeam-based network allows you to connect to the network, sync with a bootnode, obtain local access to RPC endpoints, author blocks on the parachain, and more.
This guide is meant for people with experience compiling Substrate based blockchain nodes. A parachain node is similar to a typical Substrate node, but there are some differences. A Substrate parachain node will be a bigger build because it contains code to run the parachain itself, as well as code to sync the relay chain, and facilitate communication between the two. As such, this build is quite large and may take over 30 min and require 32GB of memory.
To get started quickly without the hassle of compiling the binary yourself, you can use The Release Binary.
Compile the Binary¶
Manually compiling the binary can take around 30 minutes and requires 32GB of memory.
The following commands will build the latest release of the Moonbeam parachain.
Clone the Moonbeam repo
git clone https://github.com/moonbeam-foundation/moonbeam cd moonbeam
Check out to the latest release
git checkout tags/$(git describe --tags)
If you already have Rust installed, you can skip the next two steps. Otherwise, install Rust and its prerequisites via Rust's recommended method
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Build the parachain binary
If you are using Ubuntu 20.04 or 22.04, then you will need to install these additional dependencies before building the binary:
apt install clang protobuf-compiler libprotobuf-dev pkg-config libssl-dev -y
cargo build --release
If a cargo not found error shows up in the terminal, manually add Rust to your system path or restart your system:
Now you can use the Moonbeam binary to run a systemd service. To setup the service and run it, please refer to the Run a Node on Moonbeam Using Systemd guide.
| Created: November 17, 2021