PolySwarmPolySwarmPolySwarmPolySwarm
Go to PolySwarm
Home

Setup Development Environment

In this documentation, the term "Engine" is a general term that includes both "Microengine" and "Arbiter", since their implementation details are nearly identical. We will point out any implementation details that differ between the two.

All instructions and examples assume that you are using a recent version of Linux and are building an Engine using Python with our reference implementation and associated artifact object library.

Our Python reference Engine implementation and Artifact object library should work in any current x86_64 Operating System. In general, you can build your Engines using any Operating System, language, and technology, as long as you implement the required Protocols.

Install Git

We'll need to grab a few source code repositories and it'll be easiest to use Git. Please install Git for your development platform.

Install Python 3 & Pip

PolySwarm development requires Python 3.7.0 or above. Please install Python and PIP for your development platform.

Set up a Virtual Environment

We recommend that you create a virtual environment to keep the system-wide Python packages clean. Once you create your virtual environment, you'll need to activate it and upgrade to a recent pip version.

$ python3 -m venv psvenv
$ source psvenv/bin/activate
(psvenv) $ pip install -U pip

Install Docker and Docker-Compose

We've Docker-ized as many things as possible to make it easy to dive right in.

You need to install Docker as well as Docker Compose. If you do not have a recent Docker setup, please install Docker now. After installing Docker, you can make docker run as a non-root user. You'll need to reboot in order for those change to take effect. Advanced Linux users can install and run Docker in Rootless mode.

Once installed, verify that the installation works by running the docker command:

(psvenv) $ docker ps

Should output:

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Next, install docker-compose.

Once it is installed, verify the installation works by running:

(psvenv) $ docker-compose -v

Should output at least: docker-compose version 1.21.1, build 5a3f1a3


Next Steps

Now we have a working development environment, so let's create an Engine template.

2021 © PolySwarm Pte. Ltd.