Setup Indy SDK build environment for Ubuntu based distro (Ubuntu 16.04)¶
Install Rust and rustup (https://www.rust-lang.org/install.html).
Install required native libraries and utilities:
apt-get update && \ apt-get install -y \ build-essential \ pkg-config \ cmake \ libssl-dev \ libsqlite3-dev \ libzmq3-dev \ libncursesw5-dev
libindyrequires the modern1.0.14version oflibsodiumbut Ubuntu 16.04 does not support installation it’s fromaptrepository. Because of this, it requires to build and installlibsodiumfrom source:
cd /tmp && \
curl https://download.libsodium.org/libsodium/releases/old/unsupported/libsodium-1.0.14.tar.gz | tar -xz && \
cd /tmp/libsodium-1.0.14 && \
./configure --disable-shared && \
make && \
make install && \
rm -rf /tmp/libsodium-1.0.14
Build
libindygit clone https://github.com/hyperledger/indy-sdk.git cd ./indy-sdk/libindy cargo build cd ..
Note: libindy debian package, installed from the apt repository, is statically linked with libsodium.
For manually building this can be achieved by passing --features sodium_static into cargo build command.
- Run integration tests: Start local nodes pool with Docker
If you use this method then you have to specify the TEST_POOL_IP as specified below when running the tests.
It can be useful if we want to launch integration tests inside another container attached to
the same docker network.
Run tests
cd libindy RUST_TEST_THREADS=1 cargo test
It is possible to change ip of test pool by providing of TEST_POOL_IP environment variable:
RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test
Build
indy-cli(Optional)indy-cliis dependent onlibindyand should be built after it.cd cli/ RUSTFLAGS=" -L ../libindy/target/debug" cargo build
If you have followed the instructions to build libindy above, the default build type will be
debugMake sure to add the libindy to the path. Replace
/path/towith the actual path to the libindy directory. Using bash:echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libindy/target/{BUILD TYPE}" >> ~/.bashrc sudo ldconfig source ~/.bashrc
To run indy-cli, navigate to
cli/target/debugand run./indy-cli
See libindy/ci/ubuntu.dockerfile for example of Ubuntu based environment creation in Docker.