Libvcx is a c-callable library built on top of Libindy that provides a high-level credential exchange protocol. It simplifies creation of agent applications and provides better agent-2-agent interoperability for Hyperledger Indy infrastructure.
Note This library is currently in an experimental state.
- VCX requires access to some Cloud Agent for full work. Here is the simple Agent that can be used.
- VCX requires some payment plugin. Here is the simple plugin that can be used.
It is recommended to install the VCX packages with APT:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial {release channel}"
sudo apt-get update
sudo apt-get install -y libvcx
{release channel} must be replaced with master, rc or stable to define corresponded release channel. Please See the section Release channels for more details.
- Go to https://repo.sovrin.org/windows/libvcx/{release-channel}.
- Download last version of libvcx.
- Unzip archives to the directory where you want to save working library.
- After unzip you will get next structure of files:
Your working directory
include
vcx.h
lib
vcx.dll
nullpay.dll
indy.dll
libeay32md.dll
libsodium.dll
libzmq.dll
ssleay32md.dll
include
contains c-header file which contains all necessary declarations
that may be need for your applications.
lib
contains all necessary binaries which contains libvcx and all it's dependencies.
You must add to PATH environment variable path to lib
. It's necessary for dynamic linkage
your application with libvcx.
{release channel} must be replaced with master, rc or stable to define corresponded release channel.
To build libvcx for OSX and iOS using scripts do the following steps --
- Add the following environment variables to your .bash_profile
export PKG_CONFIG_ALLOW_CROSS=1
export CARGO_INCREMENTAL=1
export RUST_LOG=indy=trace
export RUST_TEST_THREADS=1
for i inls -t /usr/local/Cellar/openssl/
; do export OPENSSL_DIR=/usr/local/Cellar/openssl/$i; break; done
export PYTHONPATH=/Users/[your_username]/[path_to_sdk]/vcx/libvcx/vcx-indy-sdk/wrappers/python:/Users/[your_username]/[path_to_sdk]/vcx/wrappers/python3:${PYTHONPATH}
# it is important that the $HOME/.cargo/bin comes first in the PATH
export PATH="$HOME/.cargo/bin:$PATH"
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/Cellar/zeromq/4.2.5/lib/pkgconfig:/usr/local/Cellar/libsodium/1.0.12/lib/pkgconfig - git clone this repository
- cd sdk/vcx/libvcx/build/macos
- ./mac.01.libindy.setup.sh
- source ./mac.02.libindy.env.sh
- ./mac.03.libindy.build.sh > mac.03.libindy.build.sh 2<&1
- ./mac.04.libvcx.setup.sh
- source ./mac.05.libvcx.env.sh
- ./mac.06.libvcx.build.sh > mac.06.libvcx.build.sh.out 2>&1
- If the script ./mac.06.libvcx.build.sh terminates with the message "signal: 11, SIGSEGV: invalid memory reference" OR "signal: 4, SIGILL: illegal instruction" then that means the 'cargo test' command was unsuccessful OR if you have intermittent behavior (some tests pass on one try then fail on the next) with the 'cargo test' command then execute the script ./mac.build.and.install.rust.tools.sh After the mac.build.and.install.rust.tools.sh finishes (it will take a long long time) then restart your terminal and then re-run all of the scripts starting at step 1) above and they should all be successful. If they are not successful then run the ./mac.build.and.install.rust.tools.sh script one more time (it will be fast this time) and DO NOT restart your terminal but run the ./mac.06.libvcx.build.sh script and it should finish successfully.
- ./mac.07.libvcx.prepare.ios.deps.sh
To build libvcx on your own you can follow these steps --
-
Install rust and rustup (https://www.rust-lang.org/install.html).
-
Install or build libindy (https://repo.evernym.com/libindy/).
- As of now there is no distribution channel for OSX for LibIndy. You have to build it manually.
- Copy generated
libindy.dylib
file to/usr/local/lib
- Or create a symlink in
/usr/local/lib
pointing to newly generatedlibindy.dylib
, this will help in updating the libindy in future.
- Or create a symlink in
-
Clone this repo to your local machine.
-
Run
export OPENSSL_DIR=/usr/local/Cellar/openssl/1.0.2o_1
in terminal.- The version of openssl in /usr/local/Cellar/openssl may change. Set OPENSSL_DIR to the version installed on your Mac. For example, run export OPENSSL_DIR=/usr/local/Cellar/openssl/1.0.2o_1 in terminal if version 1.0.2o_1 is installed.
-
From the local repository run the following commands to verify everything works:
$ cargo build
-
Make sure all tests are passing
$ cargo test
If tests do not pass due to a "signal: 11, SIGSEGV: invalid memory reference" or if you have intermittent behavior (some tests pass on one try then fail on the next) , try replacing therustc
binary installed in step 1 in ${HOME}/.cargo/bin with a version built from the stable branch.``` git clone git@github.com:rust-lang/rust.git -b stable cd rust ./x.py build && ./x.py install ```
This will install rustc, rust-gdb, rust-lldb, and rustdoc executables in /usr/local/lib
Compare the version of ${HOME}/.cargo/bin/rustc with the version in /usr/local/lib ``` ${HOME}/.cargo/bin/rustc --version /usr/local/bin/rustc --version ``` It is likely that the only difference you will see in the version number is a "-dev" appended to the version in /usr/local/bin. Both ${HOME}/.cargo/bin and /usr/local/lib are likely in your PATH. It appears that when ${HOME}/.cargo/bin/cargo is used, the ${HOME}/.cargo/bin/rustc executable is used instead of /usr/local/lib/rustc, even if /usr/local/lib is first in your PATH. To fix this problem, simply delete rustc from ${HOME}/.cargo/bin. Doing so will ensure the versions in /usr/local/bin will be invoked. ``` rm -f ${HOME}/.cargo/bin/rustc rm -f ${HOME}/.cargo/bin/rust-gdb rm -f ${HOME}/.cargo/bin/rust-lldb rm -f ${HOME}/.cargo/bin/rustdoc ``` If this seems too messy to you, it is recommended that ${HOME}/.cargo be removed entirely (as if you never followed install instructions found at https://www.rust-lang.org/install.html) and build/install rust and cargo from source. To build and install cargo from source, follow instructions found at: https://github.com/rust-lang/cargo
- Install rust and rustup (https://www.rust-lang.org/install.html).
- Clone this repo to your local machine.
- Install libindy (https://repo.evernym.com/libindy/).
- As of now there is no distribution channel for Android for LibIndy. You have to build it manually.
- Copy generated
libindy.a
file to whatever location you want - Set env variable
LIBINDY_DIR=<Directory_containing_libindy.a>
. e.gexport LIBINDY_DIR=/usr/local/aarch64-linux-android/libindy
libindy directory holds libindy.a
- Run
install_toolchains.sh
. You need to run this once to setup toolchains for android - Run
android_build.sh aarm64
to build libvcx for aarm64 architecture.(Other architerctures will follow soon) - Tests are not working on Android as of now.
- Install rust and rustup (https://www.rust-lang.org/install.html).
- Install Libindy
- Optionally install Libnullpay to include payment functionality.
- Clone this repo to your local machine.
- From the indy-sdk/vcx/libvcx folder inside this local repository run the following commands to verify everything works:
$ cargo build $ cargo test
- Currently developers are using intellij for IDE development (https://www.jetbrains.com/idea/download/) with the rust plugin (https://plugins.jetbrains.com/plugin/8182-rust).
The following wrappers are tested and complete.
The tutorial which introduces Libvcx and explains how the whole ecosystem works, and how the functions in the SDK can be used to construct rich clients.
For the main workflow example check demo.