Dash-Industry-Forum/Test-Assets-Dataset-Public

Name: Test-Assets-Dataset-Public

Owner: Dash Industry Forum

Description: null

Created: 2017-10-19 09:26:51.0

Updated: 2017-10-19 11:54:26.0

Pushed: 2017-11-28 16:16:21.0

Homepage: null

Size: 125

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Test-Assets-Dataset

Introduction

The DASH-IF Testvector database is a tool to allow a dynamic management of the testvectors provided by the DASH Industry Forum. This includes:

A live demo of the tool can be found here. This repository provides the server-side functionality of the tool. It is supposed to run alongside the Test-Assets-UI.

Architecture

Installation

The backend system consists of two parts

  1. MongoDB Database
  2. REST API Server
Setting up MongoDB

MongoDB >= 3.2.x is required.

Follow instruction on how to Install MongoDB Community Edition on Ubuntu.

We recommend free and open source native and cross-platform MongoDB manager

Setting up REST API Server

Our current system is installed on Ubuntu Server 14.04 LTS (HVM)

  1. Setup NodeJS v4.x
  2. Download REST API Source code.
  3. Install dependency.
  4. Configuring Database access.
  5. Launch REST API Server. (TBD)
Setup NodeJS v4.x

Follow instruction on how to install NodeJS v4.x

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -  
sudo apt-get install -y nodejs  

Then we set up a package root in homedir to hold the NodeJS “global” packages:

Configure homedir for NodeJS “global” pacakges
$ NPM_PACKAGES="$HOME/.npm-packages"
$ mkdir -p "$NPM_PACKAGES"

Set NPM to use this directory for its global package installs:

$ echo "prefix = $NPM_PACKAGES" >> ~/.npmrc

Configure your PATH and MANPATH to see commands in your $NPM_PACKAGES prefix by adding the following to your .zshrc/.bashrc:

# NPM packages in homedir
NPM_PACKAGES="$HOME/.npm-packages"

# Tell our environment about user-installed node tools
PATH="$NPM_PACKAGES/bin:$PATH"

# Unset manpath so we can inherit from /etc/manpath via the `manpath` command
unset MANPATH  # delete if you already modified MANPATH elsewhere in your configuration
MANPATH="$NPM_PACKAGES/share/man:$(manpath)"

# Tell Node about these packages
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
Download REST API Source code

You can add your server SSH Key to git for authentication by following adding a new SSH key to your GitHub account instruction.

Choose your own method how to obtain source code. In our example we cloning using HTTPs method

$ git clone https://github.com/Dash-Industry-Forum/Test-Assets-Dataset-Public.git
$ cd Test-Assets-Dataset
$ npm install

You could also download ZIP Archive https://github.com/Dash-Industry-Forum/Test-Assets-Dataset/archive/master.zip

$ unzip master.zip
$ cd Test-Assets-Dataset-master
$ npm install
Configuring Database access

The config directory contains config files for different NODE_ENV settings. By default the values from the default.json are used. In order to setup the database parameters change the values in dbConfig. Please follow the instructions on the MongoDB documentation to create the respective users for your database. Also keep in mind to start the MongoDB with authorization turned on: mongod --auth

C++ bson extension

Find in npm module mongodb ..node_modules\mongodb\node_modules\bson\ext\index.js

and change path to js version in catch block

bson = require('../build/Release/bson');

to

bson = require('../browser_build/bson');
Launch REST API Server.

Install the dependencies

npm install

If this is a new setup you need to add a superuser.

cd datasets
node create_user.js

Afterwards you can run the API Server by typing:

npm start

In order to change the port adjust the webConfig.port parameter in your config file. Now you can login with the superuser and add additional users if necessary.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.