The TROPIC Verification Library (TVL) is a Python package used for evaluating TROPIC01 chip and offers a model with the chip behaviour.
For more information about TROPIC01 chip check out developers resources in TROPIC01 repository.
There are releases for every version of TVL, containing the Python wheel file. Download one of the releases (the latest one is recommended) and follow the steps below.
The TVL wheel file is also generated on every push to the master branch and uploaded as an artifact. This wheel version is usually used by developers and does not always guarantee full functionality - for guaranteed stability, use the releases versions instead.
Unreleased versions are available here. To download it, click on the latest workflow run then scroll down to the section
Artifacts
and download thets-tvl-package
artifact.
The TVL has been developed using Python 3.8. Other versions of Python might support the TVL but this has not been checked in TropicSquare.
First, check whether python3.8
is present on your machine:
python3.8 --version
If this command ends without an error, it means that python3.8
is installed
and you can proceed to the installation of the Python virtual environment.
Otherwise, install python3.8
as follows if you have a Debian-like OS (Ubuntu for example):
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update
sudo apt install python3.8 python3.8-venv -y
If your OS is different, you may need to run other commands to install Python 3.8 on your machine. Follow your machine's OS recommendations for doing so.
To use the TVL, install it in a Python virtual environment beforehand.
mkdir myproject
cd myproject
python3.8 -m venv myvenv
source myvenv/bin/activate
The virtual environment will deactivate if you type the comand
deactivate
or if you close your shell. If you want to activate the virtual environment again, callsource myvenv/bin/activate
.
The installation of the TVL is done like so:
pip install <path to the TVL wheel file>
Example:
pip install tvl-1.0-py3-none-any.whl
Along with the TVL comes a command-line tool that exposes a Tropic01Model
behind a TCP/IP server or a serial port.
Once the TVL is installed and the virtual environment activated (see above),
the model_server
is available in the terminal:
model_server tcp
For more information about the model_server
tool, type:
model_server tcp --help
See available examples for the functionality demonstration. They can be executed as:
./example_01_get_info_request.py
It is possible (and recommended) to provide a yaml
configuration file to the model_server
to configure the Tropic01Model
.
This file is parsed by model_server
using
pydantic.
Available configuration variables for the Model can be seen here. Keys and certificates can be passed as strings in base64 encoding or as files in PEM or DER format.
An example configuration can be found here. Configurations are passed to the model_server
as:
model_server tcp --configuration=config.yml
where config.yml
is the path to the configuration file.
A detailed documentation about TVL can be found here.
See the LICENSE.md file in the root of this repository or consult license information at Tropic Square website.