This document describes how to build the client utilities - tools that can be used to interact with contracts. These currently include a tool to create a contract (CreateCLI), update a contract (UpdateCLI), and run an auction (AuctionTestCLI).
The client utilities depend on the common python libraries/imports, which depend on the PDO common C++ library. Build these components first using the build instructions here and here.
It is highly recommended that you build a Python virtual environment where you can install the common Python modules. The rest of these instructions assume that you have set up a virtual environment for Python3 and have activated it.
The environment variable CONTRACTHOME
should be set to the directory where
you expect to configure and run the client utilities. Generally the variable is
set to the path to your virtual environment root plus opt/pdo
.
For example:
prompt> export CONTRACTHOME=$VIRTUAL_ENV/opt/pdo
For production deployment, CONTRACTHOME
should be set to /opt/pdo
.
You may have to install some additional python packages with pip before this will run, including:
prompt> pip install colorlog
prompt> pip install requests
prompt> pip install toml
prompt> pip install twisted
Make sure the environment variables are defined (see the top level REQUIREMENTS document), then run:
prompt> make build_all && make install
The client utilities modules must be built next:
prompt> python setup.up build_ext
Next, build the installable egg file:
prompt> python setup.py bdist_egg
If you want to remove files created during the build process, just use
make clean
.
Assuming that you have activated a virtual environment, the modules can
be installed with easy_install
.
prompt> easy_install dist/pdo_client-0.0.1.dev1-py3.6-linux-x86_64.egg
Note that the name of the egg file will depend on the version of Python you are using.
See the main USAGE document about how to use the client to interact with Private Data Objects contracts.