Browse Source

add test-config & add log silent mode

develop
Mike van Rossum 5 years ago
parent
commit
c5161fee0a
3 changed files with 142 additions and 4 deletions
  1. +10
    -1
      core/log.js
  2. +2
    -3
      test/_prepare.js
  3. +130
    -0
      test/test-config.json

+ 10
- 1
core/log.js View File

@ -10,7 +10,9 @@ var moment = require('moment');
var fmt = require('util').format;
var _ = require('lodash');
var util = require('./util');
var debug = util.getConfig().debug;
var config = util.getConfig();
var debug = config.debug;
var silent = config.silent;
var sendIPC = function() {
var IPCEE = require('relieve').IPCEE
@ -68,4 +70,11 @@ if(debug)
else
Log.prototype.debug = _.noop;
if(silent) {
Log.prototype.debug = _.noop;
Log.prototype.info = _.noop;
Log.prototype.warn = _.noop;
Log.prototype.error = _.noop;
}
module.exports = new Log;

+ 2
- 3
test/_prepare.js View File

@ -1,6 +1,5 @@
// overwrite config with sample-config
// overwrite config with test-config
var utils = require(__dirname + '/../core/util');
var testConfig = require(__dirname + '/../sample-config.js');
testConfig.debug = false;
var testConfig = require(__dirname + '/test-config.json');
utils.setConfig(testConfig);

+ 130
- 0
test/test-config.json View File

@ -0,0 +1,130 @@
{
"silent": true,
"watch": {
"exchange": "Bitstamp",
"currency": "USD",
"asset": "BTC"
},
"tradingAdvisor": {
"enabled": false
},
"trader": {
"enabled": false
},
"adviceLogger": {
"enabled": false
},
"profitSimulator": {
"enabled": false,
"reportInCurrency": true,
"simulationBalance": {
"asset": 1,
"currency": 100
},
"fee": 0.25,
"slippage": 0.05
},
"pushover": {
"enabled": false,
"sendPushoverOnStart": false,
"muteSoft": true,
"tag": "[GEKKO]",
"key": "",
"user": ""
},
"mailer": {
"enabled": false,
"sendMailOnStart": true,
"email": "",
"muteSoft": true,
"password": "",
"tag": "[GEKKO] ",
"server": "smtp.gmail.com",
"smtpauth": true,
"user": "",
"from": "",
"to": "",
"ssl": true,
"port": ""
},
"pushbullet": {
"enabled": false,
"sendMessageOnStart": true,
"key": "xxx",
"email": "jon_snow@westeros.org",
"tag": "[GEKKO]"
},
"ircbot": {
"enabled": false,
"emitUpdats": false,
"channel": "#your-channel",
"server": "irc.freenode.net",
"botName": "gekkobot"
},
"xmppbot": {
"enabled": false,
"emitUpdats": false,
"client_id": "jabber_id",
"client_pwd": "jabber_pw",
"client_host": "jabber_server",
"client_port": 5222,
"status_msg": "I'm online",
"receiver": "jabber_id_for_updates"
},
"campfire": {
"enabled": false,
"emitUpdates": false,
"nickname": "Gordon",
"roomId": null,
"apiKey": "",
"account": ""
},
"redisBeacon": {
"enabled": false,
"port": 6379,
"host": "127.0.0.1",
"channelPrefix": "",
"broadcast": [
"candle"
]
},
"candleWriter": {
"adapter": "sqlite",
"enabled": true
},
"adapters": {
"sqlite": {
"path": "plugins/sqlite",
"dataDirectory": "./history",
"version": 0.1,
"dependencies": [
{
"module": "sqlite3",
"version": "3.1.4"
}
]
},
"postgresql": {
"path": "plugins/postgresql",
"version": 0.1,
"connectionString": "postgres://user:pass@localhost:5432",
"dependencies": [
{
"module": "pg",
"version": "6.1.0"
}
]
}
},
"backtest": {
"adapter": "sqlite",
"daterange": "scan",
"batchSize": 50
},
"importer": {
"daterange": {
"from": "2015-09-09 12:00:00"
}
},
"I understand that Gekko only automates MY OWN trading strategies": false
}

Loading…
Cancel
Save