Last modified: Fri Aug 16 2019 11:27:04 GMT+0000 (Coordinated Universal Time)
How to develop on Microsoft Windows?
Our primary development platform is Linux. If you'd like to develop, or test out our tools on Windows, this guide should help you. This guide will also help you to get truffle up and running.
To get both of those running, just install Node from the official page.
During the installation, be sure that
npm is installed as well.
You can verify successful installation by running
node --version and
npm --version in
powershell. It should return a version number.
After that, you are able to run your own instances of our tooling installed
in the global
npm's namespace, such as:
$ npm install -g @windingtree/wt-hotel-explorer superstatic $ $env:WT_READ_API='https://demo-api.windingtree.com'; $env:WT_SEARCH_API='https://demo-search-api.windingtree.com'; wt-hotel-explorer
After these, you should be able to visit a
http://localhost:8080 which is
a default location of the web server running the Hotel Explorer instance.
$ docker pull windingtree/wt-read-api $ docker run -p 3000:3000 -e ETH_NETWORK_PROVIDER=... -e WT_CONFIG=playground windingtree/wt-read-api
While this will work if you want to play around with our tools, it's not enough to make and test any changes.
First off, you need to have a working
git. Be sure
Git Bash along with it, it will make the things much easier for
Some of our dependencies require compilation during the installation phase. For
that, we need the
windows-build-tools package for Node.js. Follow the instructions in
node-gyp, basically run
npm install --global --production windows-build-tools in a
with Administrative privileges.
The biggest difference between development on Linux and Windows is the handling
of environment variables which we heavily rely on. It is possible to make everything
cross platform, but we will stick with
Git Bash from now on, which mimicks the
environment variable handling of a Linux system.
However, there is one more command we need to run before the things start to work.
This tells npm to run all scripts in a
bash environment which properly interprets
the environment variables. Run this in the
Git Bash instance.
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
We will test things out on our Read API.
# Clone the repository $ git clone https://github.com/windingtree/wt-read-api.git # Jump into the directory $ cd wt-read-api # Install dependencies $ npm install # Prepare the local instance $ npm run resolve-swagger-references # Run a test suite $ npm test
If none of these commands spits out any errors, you were successful! Everything should
work just fine from now on. You can start with running the Read API in an isolated
dev mode. First, we need to start a local Ethereum network with
npm run dev-net.
In a different instance of
Git Bash, start the API:
$ npm run dev
If you visit the
http://localhost:3000, you should see the API running.
Note: There might currently be some issues with ending the processes. If you are not
able to start the API again, try looking for and killing a dangling
node processes in your
Now, when you make changes to the source code, the
npm test script should pick it up
The only culprit you can encounter
with truffle is the need to rename the
truffle-config.js on Windows.