This documentation is DEPRECATED and IS NOT MAINTAINED. It will be removed in the future.
We strongly encourage all Windows developers to migrate to the newer, simpler and easier to test Windows + Docker instructions.
If your computer is running Windows Server 2016 or Windows 10 Pro (version 1809+), we recommend you conduct Microengine development inside of a Windows Container
The recommendations presented here are hard-won. We strongly recommend that you test using the exact parameters presented here. Using any other configuration will make it difficult for us to provide you with support.
Windows-Based participant development presents non-trivial system requirements for your development host:
- Windows 10 Pro
- VT-x supported and enabled in BIOS
- 16GB+ of RAM
- 4+ CPU cores
- 100GB+ disk space
We'll be using VirtualBox. VirtualBox must have sole ownership of your hypervisor. This mean you cannot run:
- Windows Credential Guard
- Windows Device Guard
- VMWare Workstation / Player
- any other product that uses hypervisor extensions
- Download and Install VirtualBox.
- Download Windows 10 Pro ISO. Download options appear to vary based on your locale and browser's User Agent. We recommend visiting this URL on a non-Windows computer in order to access direct ISO download links.
These instructions are tested against:
- VirtualBox 6.0.6
- Windows 10 1809 (17763.437)
Using older versions may work, but have not been tested and will not be supported.
Use VirtualBox to create a Windows virtual machine (VM) using the following parameters:
- Type: Microsoft Windows
- Version: Windows 10 (64-bit)
- RAM: 4GB+
- CPU: 2+ cores
- video memory: 128MB
- disk space: 50GB+
Use the default setting for all other options. In particular, do NOT enable 3D acceleration.
Use the ISO you downloaded to install Windows in the VM.
Guest Additions are necessary for Shared Clipboard / Copy & Paste features between Guest and Host.
We'll need to use Administrator privilege to make several changes to default Windows settings. We'll need an "elevated" / "privileged" PowerShell console:
- search "PowerShell" in the desktop search bar
- right click on "Windows PowerShell"
- select "Run as administrator".
Run the following in this privileged PowerShell console.
Permit script execution (necessary for installing Chocolatey & using virtualenvs):
Set-ExecutionPolicy Bypass -Scope LocalMachine -Force
Force PowerShell to use TLSv2 (required of some dependencies):
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Chocolatey is a package manager for Windows. We'll use it to help with installing some prerequisites.
Run the following in a privileged PowerShell console.
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Use Chocolatey to install prerequisites (do these one at a time):
choco install -y python --version 3.6.5 choco install -y git choco install -y visualcpp-build-tools --version 14.0.25420.1
We strongly recommend disabling all anti-malware products in your development environment - including the built-in Windows Defender. Below, we describe disabling Windows Defender. Disabling third party solutions is left as an exercise for the reader.
PolySwarm participants should expect to come into contact with malware. Existing anti-malware engines, including the built-in Windows Defender, can easily get in our way, quarantining or deleting files during development.
You can disable Windows Defender by installing a verified configuration package from chocolatey (make sure to do so in a privileged shell):
choco install disabledefender-winconfig
Afterwards, reboot Windows.
If you need to re-enable realtime protection at any point in the future, you can uninstall the package:
choco uninstall disabledefender-winconfig
If you plan to use this Windows installation for other purposes, we recommend that you create a PolySwarm virtualenv so as to keep the system-wide Python packages clean:
cd ~ python -m venv polyswarmvenv ./polyswarmvenv/Scripts/Activate.ps1
If you're using a virtualenv (see above), ensure that you activate it before installing
polyswarm-client requires installing two packages under Windows:
pip install -v -U git+https://github.com/polyswarm/ethash.git#egg=pyethash pip install polyswarm-client
You should now have a working development environment!
To verify, simply try importing
$ python Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import polyswarmclient >>>
You should be able to import
polyswarmclient without issue.
Now that we have a working development environment, we'll use
participant-template to bootstrap our project.