editEdit on GitHub

Installation Guide

Exonum core and most other Exonum repositories use the Rust programming language and the corresponding toolchain. This document details how to setup development environment for contributing to these projects, testing them, and developing using Exonum.

Note

As of version 0.1, you need to compile the core locally for every application that depends on it. Cargo (the Rust package manager) takes care of most things, but you still need to have dependencies installed locally as described below for the core to compile.

In future releases, Exonum will become more modular and will work as a standalone application. See the roadmap for more details.

Dependencies

Exonum depends on the following third-party system libraries:

LevelDB and RocksDB are used as alternative storage engines, with LevelDB used by default. You need to install only the storage engine(s) you are intending to use.

You can find instructions how to install them on the various environments below.

MacOS

Install the necessary libraries using Homebrew:

brew install libsodium leveldb rocksdb pkg-config

Linux

For distributives with deb-based package managers (such as Debian or Ubuntu), use

apt-get install build-essential libsodium-dev \
    libleveldb-dev librocksdb-dev pkg-config

Package names and installation methods may differ in other Linux distributives; use package manager tools to locate and install dependencies.

Depending on the version of your distributive, libsodium and RocksDB may not be present in the default package lists. In this case you may need to install these packages from third-party PPAs, or build them from sources.

Windows

Workability is not guaranteed yet.

Rust Toolchain

Exonum repositories use the stable Rust toolchain that can be installed by using the rustup program:

curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable

The toolchain includes the Rust compiler (rustc) and several utilities, of which the most important one is Cargo, the Rust package manager.

Compiling Exonum

You can verify that you installed dependencies and the Rust toolchain correctly by cloning the exonum repository and running its built-in unit test suite:

git clone https://github.com/exonum/exonum.git
cd exonum
cargo test --manifest-path exonum/Cargo.toml

You may also run the extended test suite located in the sandbox directory:

cargo test --manifest-path sandbox/Cargo.toml

Exonum supports RocksDB as an alternative data storage since version 0.2.0. To enable RocksDB support you need to pass additional parameter to Cargo:

cargo test --manifest-path exonum/Cargo.toml --features rocksdb

and for extended test suite:

cargo test --manifest-path sandbox/Cargo.toml --features rocksdb

If you want to use Exonum framework with RocksDB support as a dependency in your project, you should add the following line into Cargo.toml:

exonum = { version = "0.2.0", features = ["rocksdb"] }

Non-Rust Components

Light Client Library

The light client library uses a fairly standard JavaScript development toolchain: Node and npm, together with Mocha + Chai for testing (and Karma for browser testing), istanbul for measuring test coverage, and Babel for transpiling to ES5. Workability of the development environment is tested on Node 4+.

Note

The light client library itself can run both on Node and in browsers.

Developing with Exonum

The cryptocurrency tutorial provides a step-by-step guide on how to develop applications on top of the Exonum framework.