Skip to content

Commit

Permalink
Config changes to load balancer, forgingPK change, added a TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
crypt0jan committed Nov 10, 2019
1 parent fcd69a0 commit dc6ad95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ config.port = 6040; // Port to listen on

/**
* LISK node
*/
config.lisk.host = process.env.LISK_HOST || '127.0.0.1';
config.lisk.port = process.env.LISK_PORT || 5555;
*/
config.lisk.host = 'core-balancer.rise.vision';
config.lisk.port = 80;

/**
* FreeGeoIP server
Expand Down Expand Up @@ -55,7 +57,7 @@ config.log.level = 'info';
* Header price tickers, Currency switcher
*/
// Exchange rates support (true - enabled, false - disabled)
config.exchangeRates.enabled = true;
config.exchangeRates.enabled = false;
// Interval in ms for checking exchange rates (default: 30 seconds)
config.exchangeRates.updateInterval = 30000;

Expand Down
6 changes: 4 additions & 2 deletions pm2-explorer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"out_file": "./logs/explorer.app.log",
"error_file": "./logs/lisk.app.err",
"log_date_format": "YYYY-MM-DD HH:mm:ss SSS",
"watch": false,
"watch": true,
"watch_delay": 1000,
"ignore_watch": ["node_modules"],
"kill_timeout" : 10000,
"max_memory_restart": "512M",
"max_memory_restart": "1024M",
"node_args": "--max_old_space_size=512"
}]
}
10 changes: 6 additions & 4 deletions sockets/delegateMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = function (app, connectionHandler, socket) {
const log = (level, msg) => logger[level]('Delegate Monitor:', msg);

const findActiveByPublicKey = publicKey =>
data.active.delegates.find(d => d.publicKey === publicKey);
data.active.delegates.find(d => d.forgingPK === publicKey);

const getActive = (cb) => {
if (running.getActive) {
Expand Down Expand Up @@ -205,7 +205,8 @@ module.exports = function (app, connectionHandler, socket) {
};

const getLastBlocks = (init) => {
const limit = init ? 100 : 2;
// const limit = init ? 100 : 2;
const limit = 1;

if (running.getLastBlocks) {
return log('error', 'getLastBlocks (already running)');
Expand All @@ -231,10 +232,11 @@ module.exports = function (app, connectionHandler, socket) {
data.lastBlock.block = result.blocks[0];

const lastBlockDelegate = findActiveByBlock(data.lastBlock.block);
// const lastBlockDelegate = findActiveByPublicKey(data.lastBlock.block.generatorPublicKey);

if (!lastBlockDelegate) {
// couldnt find the delegate who minded the last block
callback('couldnt find the delegate who minded the last block ID ' + result.blocks[0].id);
// TODO: error is thrown when a delegate is outside of 101 (so, not an active forger)
callback('Couldn\'t find the delegate that forged the last block. ID: ' + result.blocks[0].id + ' | publicKey: ' + result.blocks[0].generatorPublicKey);
return;
}

Expand Down

0 comments on commit dc6ad95

Please sign in to comment.