Running Code

System Requirements

  1. Ubuntu version 20 or higher WSL (Windows Subsystem for Linux) is also supported. Other similar Linux distros should also work.

circle-info

For WSL installation guide, read herearrow-up-right.

  1. Some APT package dependencies Run the following to install the required packages:

sudo apt install build-essential
sudo apt install pkg-config
sudo apt install libssl-dev
  1. Rust compiler toolchain Follow this 2-step instruction to install the Rust toolchain.

# 1: install cargo toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# 2: source the cargo env for the first time
source "$HOME/.cargo/env"

Installing the SDK and Run zkpass-demo

Follow these steps to install the zkPass SDK and to run the demo application.

circle-info

For the purposes of this guide, the zkpass-sdk repository is cloned under the home directory of the current user, retaining its default name. This places the root directory for the zkpass-sdk repository at ~/zkpass-sdk. As a result, the directory for the Rust/Linux binding of the SDK is set at ~/zkpass-sdk/rust.

Should you choose to clone the zkpass-sdk repository into a different location, ensure that you adjust any referenced paths in the instructions to match your chosen directory structure.

  1. Clone the zkpass-sdk repo

  1. Enter zkpass-sdk/rust Directory

  1. Set up environment variables (Use zkpass-demo/.env.example as starting point)

  1. From the zkpass-sdk/rust directory, execute test.sh script to build the SDK and run the demo application:

The correct output of zkpass-demo should look like the following:

Troubleshooting

Fetch Timeout

This demo will download a binary file. If the download process times out, try the following solutions:

  1. Ensure you have a stable internet connection when running the script.

  2. Turn off any active VPNs and try again.

Missing/Corrupt .so Files

The error message "cannot open shared object file: No such file or directory" indicates an issue. This may occur due to missing or corrupted .so. Here are some possible solutions:

  1. Ensure you have a stable internet connection when running the script.

  2. Turn off any active VPNs and try again.

  3. Manually download the .so file:

    1. Download libdvr_client.soarrow-up-right file from the website.

    2. Move these files to zkpass-sdk/rust/lib folder.

    3. Comment out download-so.sh in test.shscript.

    4. Run the test.sh script again; the error should be resolved.

Last updated