Skip to content

Commit dde0913

Browse files
committed
Updated manual installation with -1 step.
1 parent c3f55d2 commit dde0913

File tree

5 files changed

+23
-30
lines changed

5 files changed

+23
-30
lines changed

MANUAL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Lets say that you have a great idea about how to profitably make markets and are
171171

172172
2. Install the new class alongside the provided list of modes in the `QuotingStyleRegistry` in `main.js`.
173173

174-
3. Rebuild with `npm run postinstall` and restart tribeca.
174+
3. Rebuild with `npm install` and restart tribeca.
175175

176176
# How can I test new trading strategies?
177177

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,19 @@ See [dist/Dockerfile](https://github.com/ctubio/tribeca/tree/master/dist#dockerf
2424

2525
1. Ensure your target machine has node v6 or greater (`nodejs -v`) and mongoDB v3 or greater (`mongo --version`).
2626

27-
2. Clone the repository somewhere with `git clone ssh://git@github.com/ctubio/tribeca`.
27+
2. Run `git clone ssh://git@github.com/ctubio/tribeca` in any location that you wish.
2828

29-
3. In the toplevel path of the git cloned repository, `npm install`. This will install all local dependencies in `node_modules` folder and also compile TypeScript in `src` folder to CommonJS in `app` folder.
29+
3. Copy `etc/tribeca.json.dist` to `etc/tribeca.json` and modify the configuration options, see [configuration](https://github.com/ctubio/tribeca/tree/master/etc#configuration-options) section. Point the instance towards the running mongoDB instance (usually just `mongodb://localhost:27017/tribeca`).
3030

31-
4. Copy `etc/tribeca.json.dist` to `etc/tribeca.json`, and modify the config keys, see [configuration](https://github.com/ctubio/tribeca/tree/master/etc#configuration-options) section. Point the instance towards the running mongoDB instance (usually just `mongodb://localhost:27017/tribeca`).
32-
33-
5. In the toplevel path of the git cloned repository, `npm start`, or `service tribeca start` anywhere if the optional init script `dist/tribeca-init.sh` is installed.
31+
4. Run `npm start` in the toplevel path of the git cloned repository. This will install all local dependencies in `node_modules` folder and will compile TypeScript in `src` folder to CommonJS in `app` folder if it was not already done before, then it runs `tribeca.js` in the background using [forever](https://www.npmjs.com/package/forever).
3432

3533
Optional:
3634

37-
1. Install the system daemon script `dist/tribeca-init.sh`, it requires forever (`npm i -g forever`), see [dist](https://github.com/ctubio/tribeca/tree/master/dist) folder.
35+
1. Install the system daemon script `dist/tribeca-init.sh` (to make use of `service tribeca start` from anywhere instead of `cd path/to/tribeca && npm start`) see [dist](https://github.com/ctubio/tribeca/tree/master/dist) folder.
3836

3937
2. Replace the certificate at `etc/sslcert` folder with your own, see [web ui](https://github.com/ctubio/tribeca#web-ui) section. But, the certificate provided is a fully featured default openssl, that you may just need to authorise in your browser.
4038

41-
3. Set environment variable TRIBECA_CONFIG_FILE to full path of `tribeca.json` if you run the app manually from other locations with `nodejs path/to/tribeca.js` or with forever globally installed `forever start path/to/tribeca.js`. The environment variable is not needed if the working directory is the root folder where `tribeca.js` is located.
39+
3. Set environment variable TRIBECA_CONFIG_FILE to full path of `tribeca.json` if you run the app manually from other locations with `nodejs path/to/tribeca.js`. The environment variable is not needed if the working directory is the root folder where `tribeca.js` is located.
4240

4341
### Configuration
4442

@@ -80,15 +78,21 @@ The metrics send are:
8078
* Total amount available in wallet and held in open trades in BTC currency
8179
* Total amount available in wallet and held in open trades in Fiat currency
8280

83-
### TEST UNITS
81+
### Test units and Build notes
8482

8583
Feel free to run `npm test` anytime.
8684

85+
To rebuild the application with your modifications, please run `npm install` or directly `npm run postinstall`.
86+
87+
To piped the output to stdout, execute the application in the foreground with `nodejs tribeca.js`.
88+
89+
To save the output in `log/tribeca.log` file, execute the application in the background with `forever start tribeca.js` or with the alias `npm start`.
90+
8791
### Unreleased Changelog:
8892

8993
Added nodejs6, typescript2 and angular2.
9094

91-
Added npm install scripts instead of grunt tasks.
95+
Added cleanup of global dependencies, source code and installation steps.
9296

9397
### Release 2.0 Changelog:
9498

dist/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ To turn tribeca into a daemon, you may want to run the following command:
99
```
1010
Please make sure to correctly setup the value of `DAEMON_TOPLEVEL_PATH` variable hardcoded into the script.
1111

12-
Also this script depends on forever begin globally installed (`npm i -g forever`).
13-
1412
Log messages will be saved in `log/tribeca.log` (log files in `~/.forever/` will be instead piped to `/dev/null`).
1513

1614
### Dockerfile

dist/tribeca-init.sh

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,24 @@
55
# Required-Stop: $local_fs $syslog $remote_fs
66
# Default-Start: 2 3 4 5
77
# Default-Stop: 0 1 6
8-
# Short-Description: Start tribeca daemons
8+
# Short-Description: Start npm forever tribeca daemon
99
### END INIT INFO
1010

1111
DAEMON_TOPLEVEL_PATH=/home/user/path/to/tribeca
1212

13-
DAEMON=tribeca.js
14-
cd $TRIBECA_SERVICE_PATH
13+
cd $DAEMON_TOPLEVEL_PATH
1514
case "$1" in
1615
start)
17-
forever start -a -l /dev/null $DAEMON
16+
npm start
1817
;;
1918
stop)
20-
forever stop -a -l /dev/null $DAEMON
21-
;;
22-
stopall)
23-
forever stopall
24-
;;
25-
restartall)
26-
forever restartall
19+
npm stop
2720
;;
2821
reload|restart)
29-
forever restart -a -l /dev/null $DAEMON
30-
;;
31-
list)
32-
forever list
22+
npm restart
3323
;;
3424
*)
35-
echo "Usage: /etc/init.d/tribeca {start|stop|restart|reload|stopall|restartall|list}"
25+
echo "Usage: /etc/init.d/tribeca {start|stop|restart|reload}"
3626
exit 1
3727
;;
3828
esac

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@
7676
"compile-static": "cp -R src/static/* app/service/admin/",
7777
"compile-bundle": "browserify app/service/admin/js/admin/client.js -o app/service/admin/js/admin/bundle.min.js",
7878
"restart": "npm stop && npm start",
79-
"start": "forever start -a -l /dev/null tribeca.js",
80-
"stop": "forever stop -a -l /dev/null tribeca.js || :"
79+
"stop": "forever stop -a -l /dev/null tribeca.js || :",
80+
"start": "npm run test-compile && forever start -a -l /dev/null tribeca.js",
81+
"test-compile": "test -d app || npm $(test -d node_modules && echo run post)install"
8182
},
8283
"repository": {
8384
"type": "git",

0 commit comments

Comments
 (0)