diff --git a/app/modules/bma/lib/controllers/node.ts b/app/modules/bma/lib/controllers/node.ts index a71870e7b99e518d9871816d8b734ae909de4b4d..84073fda096a1ad289bdce2ebfec8a8b675865f6 100644 --- a/app/modules/bma/lib/controllers/node.ts +++ b/app/modules/bma/lib/controllers/node.ts @@ -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) + }, }, }; }; diff --git a/app/modules/bma/lib/dtos.ts b/app/modules/bma/lib/dtos.ts index e236aa61186f3ede696ecd55c93cfc47f7d863a5..5f608f737d11336dc4c41ff489d225610cc12e77 100644 --- a/app/modules/bma/lib/dtos.ts +++ b/app/modules/bma/lib/dtos.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; + }; }; } diff --git a/doc/HTTP_API.md b/doc/HTTP_API.md index a6411a092d67d4353bc8c3a149a2bde05604641c..f5bb6f942cdb25d2c8f484afcd9f0af546111dd9 100644 --- a/doc/HTTP_API.md +++ b/doc/HTTP_API.md @@ -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 + } } } ``` diff --git a/test/fast/modules/bma/bma-module-test.ts b/test/fast/modules/bma/bma-module-test.ts index 58c20ea81a5824f6a2f6cd3bb8763b962636e08f..cbec2c94aa9dfd871868c9b897b836ac11a5ae9c 100644 --- a/test/fast/modules/bma/bma-module-test.ts +++ b/test/fast/modules/bma/bma-module-test.ts @@ -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 () => {