Skip to content
Snippets Groups Projects
Commit 386a7e3d authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[enh] Add config's storage into /node/summary - close #1441

parent d7a5c24c
No related branches found
No related tags found
1 merge request!1424enh(1441): Add config's storage into BMA /node/summary
Pipeline #31795 passed
......@@ -14,7 +14,6 @@
"use strict";
import { AbstractController } from "./AbstractController";
import { HttpSandbox, HttpSandboxes, HttpSummary } from "../dtos";
import { constants } from "buffer";
export class NodeBinding extends AbstractController {
summary = (): HttpSummary => {
......@@ -23,6 +22,12 @@ export class NodeBinding extends AbstractController {
software: "duniter",
version: this.server.version,
forkWindowSize: this.server.conf.forksize,
storage: {
transactions: this.server.conf.storage
? this.server.conf.storage.transactions
: true, // true by default (see app/module/config.ts)
wotwizard: this.server.conf.storage?.wotwizard || false, // false by default (see app/module/config.ts)
},
},
};
};
......
......@@ -21,6 +21,10 @@ export const Summary = {
software: String,
version: String,
forkWindowSize: Number,
storage: {
transactions: Boolean,
wotwizard: Boolean,
},
},
};
......@@ -29,6 +33,10 @@ export interface HttpSummary {
software: string;
version: string;
forkWindowSize: number;
storage: {
transactions: boolean;
wotwizard: boolean;
};
};
}
......
......@@ -239,13 +239,17 @@ GET technical informations about this peer.
**Returns**
Technical informations about the node.
Technical information about the node.
```json
{
"duniter": {
"software": "duniter",
"version": "0.10.3",
"forkWindowSize": 10
"version": "1.8.7",
"forkWindowSize": 100,
"storage": {
"transaction": true,
"wotwizard": false
}
}
}
```
......
......@@ -51,6 +51,8 @@ describe('Module usage', () => {
});
should.exist(json);
json.should.have.property('duniter').property('software').equal('duniter');
json.should.have.property('duniter').property('storage').property('transactions').equal(true);
json.should.have.property('duniter').property('storage').property('wotwizard').equal(false);
})
it('remoteipv4 should NOT be filled if remote Host is declared', async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment