Pre-requisites.

Rust

First you install rust. It's a one liner. For latest instructions see https://www.rust-lang.org/tools/install

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Rust also interfaces with gcc etc for building. So install some dev essentials.

# Debian / Ubuntu and derivatives
sudo apt install build-essential
# Fedora / RHEL and derivatives
sudo dnf group install "C Development Tools and Libraries"
# Arch and derivatives
sudo pacman -S base-devel

Get Source code

Clone the aries-vcx repository.

git clone https://github.com/hyperledger/aries-vcx.git
cd aries-vcx/aries_vcx

Build

And then build

cargo build

This should build the library!

Note You may hit a few snags in the above. Keep calm. The rust compiler will try to be helpful, and tell you what's missing, or what you can do to resolve issues. Follow them or seek help online. I needed to install some additional packages. And rerun cargo build.

sudo apt install pkg-config libssl-dev libzmq3-dev

Testing

Before developing, let's see if everything works first. Things we add might break stuff, so it's good to get a lay of the land by testing prior state.

Unit testing

We'll start with unit testing. We can apparently run unit tests by passing some additional options[1]

cargo test --lib --bins

Removing the options will run all tests, including integration tests.
[1]: Source @ Stack Overflow

Notice the singular --lib and plural --bins ? In Rust one crate (a la package) can define only one library, but any number supporting executable binaries.

Integration tests

To run all tests

cargo test

This should run all tests, including integration tests. But integration tests in aries-vcx are set to not run by default using #ignored mark.

To explicitly run these ignored tests.

cargo test integrartion_tests -- --ignored

Published

Category

Development

Tags

Contact