bltjs
Version:
A BigchainDB Load Tester
27 lines (26 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ApiInfo_1 = require("./ApiInfo");
/**
* NodeInfo is a class used to store information about the connected node. Its the information you get to see when you navigate to the root_node url.
*/
class NodeInfo {
/**
* Copy constructor for loading a NodeInfo object from a JSON Object.
* @param {any} jsonObject - The JSON Object that we'll extract the information from.
* @returns {NodeInfo} The constructed NodeInfo object.
*/
static copyConstructor(jsonObject) {
let nodeInfo = new NodeInfo();
// Extract ApiInfo
nodeInfo.apiInfo = ApiInfo_1.ApiInfo.copyConstructor(jsonObject.api.v1);
nodeInfo.apiInfo.version = "v1";
nodeInfo.docs = jsonObject.docs;
nodeInfo.keyring = jsonObject.keyring;
nodeInfo.public_key = jsonObject.public_key;
nodeInfo.software = jsonObject.software;
nodeInfo.version = jsonObject.version;
return nodeInfo;
}
}
exports.NodeInfo = NodeInfo;