Makefile Guide

February 11, 2026 ยท View on GitHub

This document explains the targets available in the Makefile for the Fabric Token SDK. The Makefile allows you to automate common tasks such as installing tools, running tests, and managing Docker images.

Setup & Installation

These targets help you set up your development environment.

TargetDescription
make install-toolsInstalls necessary Go tools (linters, generators, etc.) defined in tools/tools.go. It also installs golangci-lint.
make download-fabricDownloads Hyperledger Fabric binaries. You can specify FABRIC_VERSION and FABRIC_CA_VERSION env vars to control the versions.
make install-softhsmInstalls SoftHSM for testing hardware security module integration.

Testing

These targets run various test suites.

Unit Tests

TargetDescription
make unit-testsRuns standard unit tests for the SDK, excluding integration and regression tests.
make unit-tests-raceRuns unit tests with the Go race detector enabled.
make unit-tests-regressionRuns regression tests.

Integration Tests

The SDK has several integration test targets. Some common ones include:

TargetDescription
make integration-tests-nft-dlogRuns NFT integration tests with Idemix driver.
make integration-tests-nft-fabtokenRuns NFT integration tests with FabToken driver.
make integration-tests-dvp-fabtokenRuns Delivery vs Payment (DvP) integration tests with FabToken.
make integration-tests-dvp-dlogRuns DvP integration tests with Idemix.

(See the Makefile for the full list of integration test targets).

Docker Images

These targets build or pull Docker images required for testing and development.

TargetDescription
make docker-imagesPulls all necessary images (Fabric, monitoring, testing).
make fabric-docker-imagesPulls Hyperledger Fabric images.
make testing-docker-imagesPulls images like Postgres and Vault for testing.
make monitoring-docker-imagesPulls monitoring tools like Prometheus, Grafana, Jaeger, and Explorer.

Maintenance

These targets help keep your project clean and tidy.

TargetDescription
make tidyRuns go mod tidy in all modules to ensure dependencies are clean.
make cleancleans up Docker artifacts (containers, volumes, networks) and removes generated test output directories. Use with caution as it removes Docker volumes.
make clean-all-containersRemoves all running and stopped Docker containers.
make clean-fabric-peer-imagesRemoves Docker images related to Fabric peers.
make lintRuns golangci-lint to check code quality.
make lint-auto-fixRuns golangci-lint and automatically fixes issues where possible.

Tools Generation

TargetDescription
make tokengenInstalls the tokengen tool.
make traceinspectorInstalls the traceinspector tool.
make memcheckInstalls the memcheck tool.