{"_id":"@bajerm/cactus-plugin-consortium-manual","_rev":"1-c95e6a7287eee8210d4c8f49d46623f9","name":"@bajerm/cactus-plugin-consortium-manual","dist-tags":{"latest":"1.1.3-u2"},"versions":{"1.1.3-u1":{"name":"@bajerm/cactus-plugin-consortium-manual","version":"1.1.3-u1","description":"A web service plugin that provides management capabilities on a Cactus consortium as a whole for administrative purposes.","keywords":["Hyperledger","Cactus","Integration","Blockchain","Distributed Ledger Technology"],"homepage":"https://github.com/hyperledger/cactus#readme","bugs":{"url":"https://github.com/hyperledger/cactus/issues"},"repository":{"type":"git","url":"git+https://github.com/hyperledger/cactus.git"},"license":"Apache-2.0","author":{"name":"Hyperledger Cactus Contributors","email":"cactus@lists.hyperledger.org","url":"https://www.hyperledger.org/use/cactus"},"contributors":[{"name":"Please add yourself to the list of contributors","email":"your.name@example.com","url":"https://example.com"},{"name":"Peter Somogyvari","email":"peter.somogyvari@accenture.com","url":"https://accenture.com"}],"main":"dist/lib/main/typescript/index.js","module":"dist/lib/main/typescript/index.js","browser":"dist/cactus-plugin-consortium-manual.web.umd.js","types":"dist/lib/main/typescript/index.d.ts","scripts":{"codegen":"run-p 'codegen:*'","codegen:openapi":"npm run generate-sdk","generate-sdk":"openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected","watch":"npm-watch","webpack":"npm-run-all webpack:dev","webpack:dev":"npm-run-all webpack:dev:node webpack:dev:web","webpack:dev:node":"webpack --env=dev --target=node --config ../../webpack.config.js","webpack:dev:web":"webpack --env=dev --target=web --config ../../webpack.config.js"},"dependencies":{"@hyperledger/cactus-common":"1.1.3","@hyperledger/cactus-core":"1.1.3","@hyperledger/cactus-core-api":"1.1.3","axios":"0.21.4","body-parser":"1.20.2","express":"4.17.3","jose":"4.9.2","json-stable-stringify":"1.0.1","prom-client":"13.2.0","typescript-optional":"2.0.1","uuid":"8.3.2"},"devDependencies":{"@types/express":"4.17.13","@types/json-stable-stringify":"1.0.33","@types/uuid":"8.3.1"},"engines":{"node":">=10","npm":">=6"},"publishConfig":{"access":"public"},"browserMinified":"dist/cactus-plugin-consortium-manual.web.umd.min.js","mainMinified":"dist/cactus-plugin-consortium-manual.node.umd.min.js","watch":{"codegen:openapi":{"patterns":["./src/main/json/openapi.json"]}},"gitHead":"ec53718ee00de2bc333ab455b8256475248a6bb7","_id":"@bajerm/cactus-plugin-consortium-manual@1.1.3-u1","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-jzK19MU7UdEXRv4WxaXN7qJCVDKgfUp46WhNAsKFkMOG8zeLYmFSDcA3XMS/07oWrtjViImsuCeeigCokqDiuw==","shasum":"cf81f62c0c712a4aaeca9e608bd50ecabf9a4c7c","tarball":"https://registry.npmjs.org/@bajerm/cactus-plugin-consortium-manual/-/cactus-plugin-consortium-manual-1.1.3-u1.tgz","fileCount":43,"unpackedSize":124439,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfer/JP3ZkwC6wcLU4m0NWWKsH5Y4Clv8Ab8T+Eg1H0AiEAyBvphlc2PzItuFHTm4q/PjdQxe3Wy7VF6Y4fuK8Pw7Q="}]},"_npmUser":{"name":"bajerm","email":"michal.bajer@fujitsu.com"},"directories":{},"maintainers":[{"name":"bajerm","email":"michal.bajer@fujitsu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cactus-plugin-consortium-manual_1.1.3-u1_1687771215477_0.190265379291769"},"_hasShrinkwrap":false},"1.1.3-u2":{"name":"@bajerm/cactus-plugin-consortium-manual","version":"1.1.3-u2","description":"A web service plugin that provides management capabilities on a Cactus consortium as a whole for administrative purposes.","keywords":["Hyperledger","Cactus","Integration","Blockchain","Distributed Ledger Technology"],"homepage":"https://github.com/hyperledger/cactus#readme","bugs":{"url":"https://github.com/hyperledger/cactus/issues"},"repository":{"type":"git","url":"git+https://github.com/hyperledger/cactus.git"},"license":"Apache-2.0","author":{"name":"Hyperledger Cactus Contributors","email":"cactus@lists.hyperledger.org","url":"https://www.hyperledger.org/use/cactus"},"contributors":[{"name":"Please add yourself to the list of contributors","email":"your.name@example.com","url":"https://example.com"},{"name":"Peter Somogyvari","email":"peter.somogyvari@accenture.com","url":"https://accenture.com"}],"main":"dist/lib/main/typescript/index.js","module":"dist/lib/main/typescript/index.js","browser":"dist/cactus-plugin-consortium-manual.web.umd.js","types":"dist/lib/main/typescript/index.d.ts","scripts":{"codegen":"run-p 'codegen:*'","codegen:openapi":"npm run generate-sdk","generate-sdk":"openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected","watch":"npm-watch","webpack":"npm-run-all webpack:dev","webpack:dev":"npm-run-all webpack:dev:node webpack:dev:web","webpack:dev:node":"webpack --env=dev --target=node --config ../../webpack.config.js","webpack:dev:web":"webpack --env=dev --target=web --config ../../webpack.config.js"},"dependencies":{"@hyperledger/cactus-common":"1.1.3","@bajerm/cactus-core":"1.1.3-u2","@hyperledger/cactus-core-api":"1.1.3","axios":"0.21.4","body-parser":"1.20.2","express":"4.17.3","jose":"4.9.2","json-stable-stringify":"1.0.1","prom-client":"13.2.0","typescript-optional":"2.0.1","uuid":"8.3.2"},"devDependencies":{"@types/express":"4.17.13","@types/json-stable-stringify":"1.0.33","@types/uuid":"8.3.1"},"engines":{"node":">=10","npm":">=6"},"publishConfig":{"access":"public"},"browserMinified":"dist/cactus-plugin-consortium-manual.web.umd.min.js","mainMinified":"dist/cactus-plugin-consortium-manual.node.umd.min.js","watch":{"codegen:openapi":{"patterns":["./src/main/json/openapi.json"]}},"gitHead":"ec53718ee00de2bc333ab455b8256475248a6bb7","_id":"@bajerm/cactus-plugin-consortium-manual@1.1.3-u2","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-dIgJNkAnNIPAKsoc2aM0zBmHqRTneCienoYAfoOOC9dG2l6a0RX94Hc7RCXB1YTk6kfiBYib+9Xgh3yXvtV7Gg==","shasum":"9d28fbbf18d3e53bb3c9cf92e75702f3b7c5f45f","tarball":"https://registry.npmjs.org/@bajerm/cactus-plugin-consortium-manual/-/cactus-plugin-consortium-manual-1.1.3-u2.tgz","fileCount":43,"unpackedSize":124437,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGTx5D0XMkY+jveuJVvKjOW3H/TLuLvHtmOOfnqSQ+TnAiAfQvrjhIUlamvwhV8ZDp13ONuIAY7pD5Rt9rOR85oLVg=="}]},"_npmUser":{"name":"bajerm","email":"michal.bajer@fujitsu.com"},"directories":{},"maintainers":[{"name":"bajerm","email":"michal.bajer@fujitsu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cactus-plugin-consortium-manual_1.1.3-u2_1687771573113_0.09818584685887788"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-26T09:20:15.408Z","1.1.3-u1":"2023-06-26T09:20:15.685Z","modified":"2023-06-26T09:26:13.381Z","1.1.3-u2":"2023-06-26T09:26:13.288Z"},"maintainers":[{"name":"bajerm","email":"michal.bajer@fujitsu.com"}],"description":"A web service plugin that provides management capabilities on a Cactus consortium as a whole for administrative purposes.","homepage":"https://github.com/hyperledger/cactus#readme","keywords":["Hyperledger","Cactus","Integration","Blockchain","Distributed Ledger Technology"],"repository":{"type":"git","url":"git+https://github.com/hyperledger/cactus.git"},"contributors":[{"name":"Please add yourself to the list of contributors","email":"your.name@example.com","url":"https://example.com"},{"name":"Peter Somogyvari","email":"peter.somogyvari@accenture.com","url":"https://accenture.com"}],"author":{"name":"Hyperledger Cactus Contributors","email":"cactus@lists.hyperledger.org","url":"https://www.hyperledger.org/use/cactus"},"bugs":{"url":"https://github.com/hyperledger/cactus/issues"},"license":"Apache-2.0","readme":"# `@hyperledger/cactus-plugin-consortium-manual`\n\n## Prometheus Exporter\nThis class creates a prometheus exporter, which scrapes the total Cactus node count.\n\n### Usage Prometheus\nThe prometheus exporter object is initialized in the `PluginConsortiumManual` class constructor itself, so instantiating the object of the `PluginConsortiumManual` class, gives access to the exporter object.\nYou can also initialize the prometheus exporter object seperately and then pass it to the `IPluginConsortiumManualOptions` interface for `PluginConsortiumManual` constructor.\n\n`getPrometheusMetricsV1` function returns the prometheus exporter metrics, currently displaying the total cactus node count, which currently refreshes to match the node count in the consortium, everytime `updateMetricNodeCount` method of the `PluginConsortiumManual` class is called.\n\n### Prometheus Integration\nTo use Prometheus with this exporter make sure to install [Prometheus main component](https://prometheus.io/download/).\nOnce Prometheus is setup, the corresponding scrape_config needs to be added to the prometheus.yml\n\n```(yaml)\n- job_name: 'consortium_manual_exporter'\n  metrics_path: api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics\n  scrape_interval: 5s\n  static_configs:\n    - targets: ['{host}:{port}']\n```\n\nHere the `host:port` is where the prometheus exporter metrics are exposed. The test cases (For example, packages/cactus-plugin-consortium-manual/src/test/typescript/unit/consortium/get-node-jws-endpoint-v1.test.ts) exposes it over `0.0.0.0` and a random port(). The random port can be found in the running logs of the test case and looks like (42379 in the below mentioned URL)\n`Metrics URL: http://0.0.0.0:42379/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics`\n\nOnce edited, you can start the prometheus service by referencing the above edited prometheus.yml file.\nOn the prometheus graphical interface (defaulted to http://localhost:9090), choose **Graph** from the menu bar, then select the **Console** tab. From the **Insert metric at cursor** drop down, select **cactus_consortium_manual_total_node_count** and click **execute**\n\n### Helper code\n\n###### response.type.ts\nThis file contains the various responses of the metrics.\n\n###### data-fetcher.ts\nThis file contains functions encasing the logic to process the data points.\n\n###### metrics.ts\nThis file lists all the prometheus metrics and what they are used for.","readmeFilename":"README.md"}