Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Building

oneEdoubleD edited this page Mar 19, 2020 · 8 revisions

Nix build (recommended)

Use the Nix build if:

  1. You don't have Haskell development tools installed, but you do have Nix
  2. You would like to cross-compile a build for Windows, or run the tests under
  3. You would like to quickly grab a build of another branch from the Hydra cache, without needing to build it yourself.

💡 Follow the instructions in iohk-nix/docs/nix.md to install Nix and set up the IOHK binary cache.

To build the cardano-explorer-api for your current platform, use:

nix-build -A scripts.<network>.explorer-api

To build the cardano-submit-api for your current platform, use:

nix-build -A scripts.<network>.submit-api

Where <network> can be staging | testnet | mainnet

If you have no local changes in your git repo, then this will download the build from the Hydra cache rather than building locally.

Stack Build

⚠️ Make sure you have the following system dependencies installed and available:

  • libsystemd-dev
  • libz-dev
  • libpq-dev
  • libssl-dev

Using Haskell Stack to build the project:

stack build

Alternatively, you can build only a subset of the available executables. In particular:

stack build cardano-explorer-api
stack build cardano-submit-api

for building the explorer API and the transaction submission API respectively.

Cabal Build

⚠️ Make sure you have the following system dependencies installed and available:

  • libsystemd-dev
  • libz-dev
  • libpq-dev
  • libssl-dev

Using Cabal to build the project:

cabal build
Clone this wiki locally