Setting up a Coinstac Development Environment
These instructions explain how to get COINSTAC up and running on your machine for development or to run your own COINSTAC system:
Install required software
- NodeJS COINSTAC only supports the latest LTS version of Node, if you require multiple versions of Node for other projects, a version manager is strongly recommended
- See detailed instructions here: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
An MQTT client Any MQTT client will work listening on localhost and the standard mqtt port (1883). We prefer mosquitto. Mosquitto is available on
brew
andapt
.Docker To run computations you'll need Docker. Docker memory requirements differ per computation, but 4gb is recommended as a minimum and 12gb will allow most any computation to run.
Configuring NPM on Windows
If you are developing on a Windows operating system you will need to configure NPM to use Git-Bash
to execute npm scripts.
You can do this with the following command:
npm config set script-shell "C:\\Program Files\\Git\\git-bash.exe"
(or another path if your install location differs)
Download Source Code
Open a shell and navigate to the directory where you want to install COINSTAC. This can be anywhere, but if you're following the development instructions below, having it in your HOME directory is recommended. Then, use git to download the repository:
git clone https://github.com/trendscenter/coinstac.git
This will place COINSTAC into a new folder named “coinstac” and check out the “master” branch.
Install Dependencies
From the coinstac
directory run the following commands:
# needed only for initial top level setup
npm install
# runs npm i in the sub packages, and links the packages together via lerna
npm run build
# sets local services configuration files for the ui
npm run switch:local
Set environment variables
- Find or create the
.*rc
file on your system- Mac uses zshell and the respective file is
.zshrc
. - Windows Git Bash uses
.bashrc
. - The directory of files can usually be found by running
echo ~
in your respective shell.
- Mac uses zshell and the respective file is
- Copy the contents of
config/.env-example.sh
into your.*rc
file. - relaunch your terminal/shell.
echo $env
to see if the environment variables are set.
Prime the database
In the top level coinstac
directory run npm run devdata
to start and prime the database
Run the UI
The user interface is an Electron application. To run it:
- Make sure your mqtt service (mosquitto or otherwise) is running, a daemon is fine
- In the top level directory run
npm run start
to run webpack, and the api services - Either in a new cli window or tmux/screen/etc session make go to the coinstac/packages/coinstac-ui/ directory.
- Run
npm start
to start the UI
Test data for collections mapping can be found in coinstac/algorithm-development/test-data/
Steps to Setup Pipeline
A YouTube video showing the basic steps for creating a Consortia, adding Collection files, and running a Pipeline.