Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
Added symbol-bootstrap version (#597)
Browse files Browse the repository at this point in the history
* Added symbol-bootstrap version

* Added missing model schema
Fixed #595

* Fixed lint

* Made deployment config generic

Co-authored-by: fboucquez <[email protected]>
  • Loading branch information
rg911 and fboucquez authored May 24, 2021
1 parent 3aa164a commit 1d17751
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 7 deletions.
8 changes: 7 additions & 1 deletion catapult-sdk/src/model/ModelSchemaBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,13 @@ class ModelSchemaBuilder {
},
serverInfoData: {
restVersion: ModelType.string,
sdkVersion: ModelType.string
sdkVersion: ModelType.string,
deployment: { type: ModelType.object, schemaName: 'deploymentData' }
},
deploymentData: {
deploymentTool: ModelType.string,
deploymentToolVersion: ModelType.string,
lastUpdatedDate: ModelType.string
},
stateTree: {
tree: { type: ModelType.array, schemaName: ModelType.binary }
Expand Down
10 changes: 8 additions & 2 deletions catapult-sdk/test/model/ModelSchemaBuilder_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ describe('model schema builder', () => {
'nodeTime',
'serverInfo',
'serverInfoData',
'deploymentData',
'stateTree',
'storageInfo'
]);
Expand Down Expand Up @@ -179,7 +180,8 @@ describe('model schema builder', () => {

'nodeHealth.status',
'nodeTime.communicationTimestamps',
'serverInfo.serverInfo'
'serverInfo.serverInfo',
'serverInfoData.deployment'
]);
});

Expand Down Expand Up @@ -333,7 +335,11 @@ describe('model schema builder', () => {
'nodeInfo.friendlyName',
'nodeInfo.host',
'serverInfoData.restVersion',
'serverInfoData.sdkVersion'
'serverInfoData.sdkVersion',
'deploymentData.deploymentTool',
'deploymentData.deploymentToolVersion',
'deploymentData.lastUpdatedDate'

]);
});

Expand Down
8 changes: 7 additions & 1 deletion rest/resources/rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,11 @@
}
},

"numBlocksTransactionFeeStats": 300
"numBlocksTransactionFeeStats": 300,

"deployment": {
"deploymentTool": "",
"deploymentToolVersion": "",
"lastUpdatedDate": ""
}
}
9 changes: 8 additions & 1 deletion rest/src/routes/nodeRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,18 @@ module.exports = {
});

server.get('/node/server', (req, res, next) => {
const { deployment } = services.config;
res.send({
payload: {
serverInfo: {
restVersion,
sdkVersion
sdkVersion,
deployment: {
deploymentTool: deployment && deployment.deploymentTool ? deployment.deploymentTool : 'N/A',
deploymentToolVersion: deployment && deployment.deploymentToolVersion
? deployment.deploymentToolVersion : 'N/A',
lastUpdatedDate: deployment && deployment.lastUpdatedDate ? deployment.lastUpdatedDate : 'N/A'
}
}
},
type: routeResultTypes.serverInfo
Expand Down
14 changes: 12 additions & 2 deletions rest/test/routes/nodeRoutes_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ describe('node routes', () => {
})
},
config: {
apiNode: { timeout: 1000 }
apiNode: { timeout: 1000 },
deployment: {
deploymentTool: 'symbol-bootstrap',
deploymentToolVersion: '1.0.2',
lastUpdatedDate: '1900-01-01'
}
}
});

Expand Down Expand Up @@ -356,7 +361,12 @@ describe('node routes', () => {
payload: {
serverInfo: {
restVersion,
sdkVersion
sdkVersion,
deployment: {
deploymentTool: 'symbol-bootstrap',
deploymentToolVersion: '1.0.2',
lastUpdatedDate: '1900-01-01'
}
}
},
type: 'serverInfo'
Expand Down

0 comments on commit 1d17751

Please sign in to comment.