Skip to content

Commit

Permalink
Upgrade infra to new Chlu release (#3)
Browse files Browse the repository at this point in the history
* upgrade infra

* upgrade modules

* configurable Chlu network

* upgrade readme and docs

* update docs and start script

* update deps

* upgrade dependencies
  • Loading branch information
fazo96 authored and kulpreet committed Jul 30, 2018
1 parent 616a840 commit 041d5d2
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 415 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
BLOCKCYPHER_TOKEN=token_here
BLOCKCYPHER_TOKEN=token_here
CHLU_NETWORK=experimental
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This project has a pm2 configuration file that configures and starts [Chlu](https://chlu.io) services.

## Setup
## Full Setup

Copy `.env.example` to `.env` and fill in the required secret keys
- copy `.env.example` to `.env` and fill in the required secret keys
- make sure your `marketplace-config.json` is correct ([Marketplace Docs](https://github.com/ChluNetwork/chlu-marketplace-js))
- make sure all projects are running on the same Chlu Network
- set up your local Wallet and login as a user with some test bitcoins. [Follow instructions on Wallet docs](https://github.com/ChluNetwork/chlu-wallet#test--demo)
- make sure you have `pm2` installed
- start the infrastructure with `bash start.sh`
- start your [Wallet](https://github.com/ChluNetwork/chlu-wallet)
- you have a full Chlu environment set up now. Use `pm2` commands with `ecosystem.config.js` to manage the services
13 changes: 3 additions & 10 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function projectPath(s) {

env(path.join(__dirname, '.env'))

const home = process.env.HOME
const blockcypherToken = process.env.BLOCKCYPHER_TOKEN
const network = process.env.CHLU_NETWORK || 'experimental'

module.exports = {
/**
Expand All @@ -30,7 +30,7 @@ module.exports = {
script: projectPath('chlu-ipfs-support/bin/chlu-service-node.js'),
watch: false,
// This is running on the master branch and does not require additional CLI params
args: 'start --network staging' + (blockcypherToken ? ` --btc ${blockcypherToken}` : ''),
args: `start --network ${network} ` + (blockcypherToken ? ` --btc ${blockcypherToken}` : ''),
max_memory_restart: '250M'
},
{
Expand All @@ -40,18 +40,11 @@ module.exports = {
args: '--port=4003',
max_memory_restart: '250M'
},
{
name: 'chlu-reputation-service-node',
script: projectPath('chlu-reputation-service-node/index.js'),
watch: false,
args: 'start --port 3001',
max_memory_restart: '250M'
},
{
name: 'chlu-did-service',
script: projectPath('chlu-did-service/index.js'),
watch: false,
args: '',
args: `start --network ${network}`,
max_memory_restart: '250M'
}
],
Expand Down
4 changes: 2 additions & 2 deletions marketplace-config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"port": 5000,
"marketplaceLocation": "https://demomarket.chlu.io",
"marketplaceLocation": "http://localhost:5000",
"chluIpfs": {
"network": "staging"
"network": "experimental"
},
"db": {
"password": "chlurocks"
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"license": "MIT",
"private": true,
"dependencies": {
"chlu-did-service": "ChluNetwork/chlu-did-service",
"chlu-ipfs-support": "ChluNetwork/chlu-ipfs-support",
"chlu-marketplace-js": "ChluNetwork/chlu-marketplace-js",
"chlu-reputation-service-node": "ChluNetwork/chlu-service-node",
"chlu-did-service": "ChluNetwork/chlu-did-service#upgrade-chlu",
"chlu-ipfs-support": "ChluNetwork/chlu-ipfs-support#protobuf-upgrade",
"chlu-marketplace-js": "ChluNetwork/chlu-marketplace-js#upgrade-chlu",
"libp2p-websocket-star-rendezvous": "^0.2.3",
"node-env-file": "^0.1.8"
}
Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

yarn
yarn --frozen-lockfile
pm2 start ./ecosystem.config.js
Loading

0 comments on commit 041d5d2

Please sign in to comment.