Handling SNAPSHOT Dependencies

Learn how to handle SNAPSHOT dependencies when building the Ergo node from source, especially for development branches and Release Candidates.

What are SNAPSHOT Dependencies?

SNAPSHOT versions represent unstable, work-in-progress builds of libraries that are not yet officially released. When building Ergo node from source, you may encounter these dependencies that need to be built locally.

The Problem

• SNAPSHOT versions are not published to public repositories

• Standard build process fails with unresolved dependencies

• Error messages indicate artifacts not found

Example Error
sbt.ResolveException: unresolved dependency: 
org.ergoplatform#sigmastate-interpreter_2.12;
6.0.0-RC2-SNAPSHOT: not found

The Solution

• Build SNAPSHOT dependencies locally

• Use sbt publishLocal

• Publish to local Ivy repository

Local Repository
~/.ivy2/local  # Linux/macOS
%USERPROFILE%.ivy2local  # Windows

How to Handle SNAPSHOT Dependencies

Follow these steps to build and publish SNAPSHOT dependencies locally before building the Ergo node.

1. Identify Required SNAPSHOT

Check the build.sbt file for SNAPSHOT versions:

build.sbt
val sigmastateVersion = "6.0.0-RC2-SNAPSHOT"

2. Clone Dependency Repository

Clone the required library repository:

Clone Command
git clone https://github.com/ergoplatform/sigmastate-interpreter.git

3. Checkout Correct Commit

Navigate and checkout the specific commit:

Checkout Commands
cd sigmastate-interpreter
git checkout <commit_hash_specified_in_release_notes>

4. Publish Locally

Build and publish the SNAPSHOT locally:

Publish Command
sbt publishLocal

5. Build Ergo Node

Return to Ergo directory and build:

Build Commands
cd ../ergo
sbt assembly

Tips and Best Practices

Multiple Dependencies

If multiple SNAPSHOT libraries are required, repeat steps 2-4 for each dependency before building Ergo.

Commit Hashes

Always use the exact commit hash specified in release notes for compatibility.

Local Repository

Published SNAPSHOTs are stored in your local Ivy repository for future builds.

Build Order

Build dependencies in the correct order if they depend on each other.