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

Building

Matthias Benkort edited this page Apr 14, 2020 · 8 revisions

Pre-Requisite

cardano-db-sync

If you intend to run cardano-submit-api or cardano-explorer-api, you'll need to connect to either a running a cardano-node or a postgresql database filled with data from cardano-db-sync.

Instructions on how to build cardano-node and cardano-db-sync can be found here.

Alternatively, docker images are also provided for these components and available on DockerHub:

$ docker pull inputoutput/cardano-node:latest
$ docker pull inputoutput/cardano-db-sync:latest

See also docker-compose.yaml for an example setup wiring these components together.

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