-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1278 from OriginTrail/release/testnet
OriginTrail Mainnet Prerelease v4.1.3
- Loading branch information
Showing
25 changed files
with
330 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const pjson = require('../../package.json'); | ||
|
||
class InfoController { | ||
constructor(ctx) { | ||
this.logger = ctx.logger; | ||
this.transport = ctx.transport; | ||
this.config = ctx.config; | ||
this.graphStorage = ctx.graphStorage; | ||
} | ||
|
||
async getNodeInfo(req, res) { | ||
this.logger.api('GET: Node information request received.'); | ||
|
||
try { | ||
const network = await this.transport.getNetworkInfo(); | ||
|
||
const basicConfig = { | ||
version: pjson.version, | ||
blockchain: this.config.blockchain.blockchain_title, | ||
network, | ||
is_bootstrap: this.config.is_bootstrap_node, | ||
}; | ||
|
||
if (!this.config.is_bootstrap_node) { | ||
const numberOfVertices = await this.graphStorage.getDocumentsCount('ot_vertices'); | ||
const numberOfEdges = await this.graphStorage.getDocumentsCount('ot_edges'); | ||
Object.assign(basicConfig, { | ||
node_wallet: this.config.node_wallet, | ||
erc_725_identity: this.config.erc725Identity, | ||
graph_size: { | ||
number_of_vertices: numberOfVertices, | ||
number_of_edges: numberOfEdges, | ||
}, | ||
}); | ||
} | ||
|
||
res.status(200); | ||
res.send(basicConfig); | ||
} catch (error) { | ||
this.logger.error(`Failed to process /api/info route. ${error}`); | ||
res.status(500); | ||
res.send({ | ||
message: error, | ||
}); | ||
} | ||
} | ||
} | ||
|
||
module.exports = InfoController; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const Utilities = require('../Utilities'); | ||
const { execSync } = require('child_process'); | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
/** | ||
* Changes the arango password to a randomly generated one | ||
*/ | ||
class M5ArangoPasswordMigration { | ||
constructor({ | ||
config, log, | ||
}) { | ||
this.config = config; | ||
this.log = log; | ||
} | ||
|
||
/** | ||
* Run migration | ||
*/ | ||
async run() { | ||
try { | ||
execSync('cp ./scripts/update-arango-password.sh ./'); | ||
execSync('chmod +x update-arango-password.sh'); | ||
execSync(`./update-arango-password.sh ${this.config.appDataPath} ${this.config.database.host} ${this.config.database.port}`, { stdio: 'inherit' }); | ||
execSync('rm ./update-arango-password.sh'); | ||
return 0; | ||
} catch (error) { | ||
this.log.error('Arango password update migration failed!'); | ||
this.log.error(error); | ||
return -1; | ||
} | ||
} | ||
} | ||
|
||
module.exports = M5ArangoPasswordMigration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.