Skip to content

Commit

Permalink
Refactor Infrastructure (#4)
Browse files Browse the repository at this point in the history
* use new modules for infrastructure

* move collector integration tests here

* use external APIs instad of internals when possible

* add new test stubs

* implement first API integration test

* new test: storing and reading review record with API infra

* update yarn lock

* make the tests pass

* test vendor signup to marketplace

* use a real marketplace in integration tests

* upgrade marketplace, pass logger correctly to it
  • Loading branch information
fazo96 authored and kulpreet committed Aug 3, 2018
1 parent 041d5d2 commit 96e225a
Show file tree
Hide file tree
Showing 8 changed files with 1,281 additions and 102 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js

node_js:
- "8"
34 changes: 25 additions & 9 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,42 @@ module.exports = {
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps: [
// Low-level services necessary for Chlu ecosystem
{
name: 'chlu-marketplace',
script: projectPath('chlu-marketplace-js/src/bin/index.js'),
name: 'rendezvous',
script: projectPath('libp2p-websocket-star-rendezvous/src/bin.js'),
watch: false,
args: 'serve -c marketplace-config.json',
args: '--port=4003',
max_memory_restart: '250M'
},
{
name: 'chlu-service-node',
script: projectPath('chlu-ipfs-support/bin/chlu-service-node.js'),
name: 'chlu-collector',
script: projectPath('chlu-collector/src/bin.js'),
watch: false,
// This is running on the master branch and does not require additional CLI params
args: `start --network ${network} ` + (blockcypherToken ? ` --btc ${blockcypherToken}` : ''),
max_memory_restart: '250M'
},
// Mid-level services (API Gateways)
{
name: 'rendezvous',
script: projectPath('libp2p-websocket-star-rendezvous/src/bin.js'),
name: 'chlu-api-query',
script: projectPath('chlu-api-query/src/bin.js'),
watch: false,
args: '--port=4003',
args: `start --network ${network} ` + (blockcypherToken ? ` --btc ${blockcypherToken}` : ''),
max_memory_restart: '250M'
},
{
name: 'chlu-api-publish',
script: projectPath('chlu-api-publish/src/bin.js'),
watch: false,
args: `start --network ${network} ` + (blockcypherToken ? ` --btc ${blockcypherToken}` : ''),
max_memory_restart: '250M'
},
// High-level services built on Chlu libraries
{
name: 'chlu-marketplace',
script: projectPath('chlu-marketplace-js/src/bin/index.js'),
watch: false,
args: 'serve -c marketplace-config.json',
max_memory_restart: '250M'
},
{
Expand Down
56 changes: 54 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,63 @@
"version": "1.0.0",
"license": "MIT",
"private": true,
"scripts": {
"test": "mocha --opts tests/mocha.opts",
"start": "bash ./start.sh"
},
"dependencies": {
"chlu-did-service": "ChluNetwork/chlu-did-service#upgrade-chlu",
"chlu-ipfs-support": "ChluNetwork/chlu-ipfs-support#protobuf-upgrade",
"chlu-api-publish": "ChluNetwork/chlu-api-publish#implementation",
"chlu-api-query": "ChluNetwork/chlu-api-query#implementation",
"chlu-collector": "ChluNetwork/chlu-collector#implementation",
"chlu-did-service": "ChluNetwork/chlu-did-service#upgrade-chlu2",
"chlu-marketplace-js": "ChluNetwork/chlu-marketplace-js#upgrade-chlu",
"libp2p-websocket-star-rendezvous": "^0.2.3",
"node-env-file": "^0.1.8"
},
"devDependencies": {
"chai": "^4.1.2",
"chlu-api-client": "ChluNetwork/chlu-api-client-js#implementation",
"eslint": "^4.12.0",
"lodash": "^4.17.10",
"mocha": "^5.2.0",
"rimraf": "^2.6.2",
"sinon": "^6.1.4"
},
"eslintConfig": {
"root": true,
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 8
},
"env": {
"es6": true,
"browser": true,
"node": true,
"jest": true
},
"rules": {
"indent": [
"error",
4
],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"no-console": 0,
"no-debugger": 1,
"no-var": 1,
"no-trailing-spaces": 0,
"eol-last": 0,
"no-underscore-dangle": 0,
"no-alert": 0,
"no-lone-blocks": 0
},
"globals": {}
}
}
Loading

0 comments on commit 96e225a

Please sign in to comment.