Skip to content

CKCLI Get Started

Karthik Kumar Viswanathan edited this page Apr 6, 2021 · 2 revisions

Clone the Chainkit CLI Repo

 git clone https://github.com/chainkit/ckcli.git
 cd ckcli

Check Python 3 and Pip 3

 which python3
 which pip3

Install relevant dependencies

pip3 install -r requirements.txt --user --no-cache-dir

Sign up for a Chainkit Account

Open https://chainkit.com and sign up. If you have trouble doing that, reach out to support@chainkit.com

Get Coffee or something

Now, to use the CLI without much effort, either you set the CKUSER and CKPASS variables; Do not set them as plaintext, use the user's Keychain to do so. Better, set the CKTOKEN variable. Either way, it is recommended you use a Keychain.

bash
export CKUSER=testcliuser
export CKPASS='ChangeMe'

Set PATH and set if CLI works

export PATH=$(pwd):$PATH

We usually use https://api.chainkit.com as the default endpoint. But Chainkit On-Prem allows you to specify a different one, such as: export CKEP=https://your-chainkit.your-domain.com/

First, to register with the CLI, we use a Hash

echo -n 'test' | openssl sha256
echo -n 'test' | openssl sha256 | awk '{print $2}'
export HASH=$(echo -n 'test' | openssl sha256 | awk '{print $2}')
echo $HASH
ckcli register -h "$HASH" -d "Hash generated at $(date)"

To verify if this works, use:

export ASSETID=6223799325706621234
export NHASH=$(echo -n 'test' | openssl sha256 | awk '{print $2}')
ckcli verify -h "$NHASH" -i "$ASSETID"
Clone this wiki locally