Building the Ergo Node from Source
Build the Ergo node from source code for development, specific versions, or custom modifications. While pre-compiled JARs are recommended for most users, building from source gives you full control.
When to Build from Source
While downloading pre-compiled JARs is recommended for most users, you might need to build from source if you need a specific version, want to contribute to development, or prefer compiling software yourself.
Java Development Kit (JDK)
JDK 9 or higher is required. OpenJDK is recommended for compatibility.
Check RequirementsBuild Steps
Follow these steps to build the Ergo node from source code.
1. Clone Repository
Clone the Ergo repository to your local machine:
git clone https://github.com/ergoplatform/ergo.git
2. Navigate to Directory
Change into the cloned repository directory:
cd ergo
3. Checkout Specific Version (Optional)
Choose the version you want to build:
# Example for a specific release git checkout v5.0.10 # Example for a Release Candidate git checkout v6.0.0-RC2
Important:
Some development versions, especially Release Candidates, may depend on unreleased SNAPSHOT versions of libraries. If the build fails due to missing SNAPSHOT dependencies, you must build and publish these dependencies locally first.
4. Handle SNAPSHOT Dependencies (If Needed)
If you encounter SNAPSHOT dependency errors:
See the dedicated guide for handling SNAPSHOT dependencies when building from source.
5. Compile the JAR
Build the node using SBT assembly:
sbt assembly
The resulting JAR file will be located in the target/scala-*/ directory.
6. Locate the JAR
Find the generated JAR file:
target/scala-2.13/ergo-*.jar
Move this JAR file to your desired node installation folder.
Tips and Best Practices
Use Tags
Checkout specific release tags for stable versions rather than using master branch.
SNAPSHOT Dependencies
Be prepared to handle SNAPSHOT dependencies for development versions.
Build Time
First build may take 10-30 minutes depending on your system and network.
Verify JAR
Ensure the generated JAR file is complete and not corrupted.