Skip to content

Commit

Permalink
Merge pull request #1167 from OriginTrail/develop
Browse files Browse the repository at this point in the history
OriginTrail Testnet Prerelease v4.0.6
  • Loading branch information
djordjekovac authored Feb 21, 2020
2 parents be0d793 + b4efd0b commit 6566522
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"dh_min_stake_amount": "100000000000",
"dh_min_reputation": -50,
"latest_api_version" : "v2.0",
"send_challenges_log" : true,
"database": {
"provider": "arangodb",
"username": "root",
Expand Down Expand Up @@ -140,6 +141,7 @@
"dh_min_stake_amount": "100000000000",
"dh_min_reputation": -50,
"latest_api_version" : "v2.0",
"send_challenges_log" : true,
"database": {
"provider": "arangodb",
"username": "root",
Expand Down Expand Up @@ -249,6 +251,7 @@
"dh_min_stake_amount": "100000000000",
"dh_min_reputation": -50,
"latest_api_version" : "v2.0",
"send_challenges_log" : true,
"database": {
"provider": "arangodb",
"username": "root",
Expand Down
18 changes: 18 additions & 0 deletions modules/command/dh/dh-challenge-command.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const Command = require('../command');
const models = require('../../../models/index');
const bugsnag = require('bugsnag');

/**
* Handles one data challenge
Expand Down Expand Up @@ -51,6 +52,23 @@ class DHChallengeCommand extends Command {
);
const answer = this.challengeService.answerChallengeQuestion(blockIndex, otObject);

if (this.config.send_challenges_log) {
const bugsnagMessage = 'DH challenge answer';
bugsnag.notify(bugsnagMessage, {
user: {
dh_node_id: this.config.identity,
dc_identity: litigatorNodeId,
challenge_id: challengeId,
data_set_id: datasetId,
object_index: objectIndex,
block_index: blockIndex,
answer,
otObject,
},
severity: 'info',
});
}

this.logger.info(`Calculated answer for dataset ${datasetId}, color ${color}, object index ${objectIndex}, and block index ${blockIndex} is ${answer}`);
try {
await this.transport.challengeResponse({
Expand Down
2 changes: 1 addition & 1 deletion test/modules/utilities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Utilities module', () => {
'autoUpdater', 'bugSnag', 'network', 'dataSetStorage', 'dc_holding_time_in_minutes', 'dc_choose_time', 'dc_litigation_interval_in_minutes',
'dh_max_holding_time_in_minutes', 'dh_min_litigation_interval_in_minutes',
'erc725_identity_filepath', 'requireApproval', 'dh_maximum_dataset_filesize_in_mb', 'latest_api_version', 'litigationEnabled', 'commandExecutorVerboseLoggingEnabled',
'reputationWindowInMinutes'],
'reputationWindowInMinutes', 'send_challenges_log'],
`Some config items are missing in config for environment '${environment}'`,
);
assert.hasAllKeys(
Expand Down

0 comments on commit 6566522

Please sign in to comment.