| 1 | # @ipshipyard/libp2p-inspector |
| 2 | |
| 3 | [](https://codecov.io/gh/ipshipyard/js-libp2p-inspector) |
| 4 | [](https://github.com/ipshipyard/js-libp2p-inspector/actions/workflows/js-test-and-release.yml?query=branch%3Amain) |
| 5 | |
| 6 | > Inspect a running libp2p node |
| 7 | |
| 8 | # About |
| 9 | |
| 10 | <!-- |
| 11 | |
| 12 | !IMPORTANT! |
| 13 | |
| 14 | Everything in this README between "# About" and "# Install" is automatically |
| 15 | generated and will be overwritten the next time the doc generator is run. |
| 16 | |
| 17 | To make changes to this section, please update the @packageDocumentation section |
| 18 | of src/index.js or src/index.ts |
| 19 | |
| 20 | To experiment with formatting, please run "npm run docs" from the root of this |
| 21 | repo and examine the changes made. |
| 22 | |
| 23 | --> |
| 24 | |
| 25 | An electron app that bundles @ipshipyard/libp2p-inspector-ui for use with |
| 26 | libp2p nodes running under Node.js or (eventually) in browsers. |
| 27 | |
| 28 |  |
| 29 | |
| 30 | ## Installation instructions |
| 31 | |
| 32 | ### 1. libp2p configuration |
| 33 | |
| 34 | Configure `@ipshipyard/libp2p-inspector-metrics` as your metrics implementation: |
| 35 | |
| 36 | ```ts |
| 37 | import { createLibp2p } from 'libp2p' |
| 38 | import { inspectorMetrics } from '@ipshipyard/libp2p-inspector-metrics' |
| 39 | |
| 40 | const node = await createLibp2p({ |
| 41 | metrics: inspectorMetrics(), |
| 42 | //... other options her |
| 43 | }) |
| 44 | ``` |
| 45 | |
| 46 | ### 2. Install the inspector |
| 47 | |
| 48 | ```console |
| 49 | $ npm i -g @ipshipyard/libp2p-inspector |
| 50 | ``` |
| 51 | |
| 52 | ### 3. Run |
| 53 | |
| 54 | ```console |
| 55 | $ libp2p-inspector |
| 56 | ``` |
| 57 | |
| 58 | Local libp2p nodes running the `@ipshipyard/libp2p-inspector-metrics` metrics |
| 59 | implementation will advertise themselves via MDNS and should appear in the |
| 60 | app. |
| 61 | |
| 62 | # License |
| 63 | |
| 64 | Licensed under either of |
| 65 | |
| 66 | - Apache 2.0, ([LICENSE-APACHE](https://github.com/ipshipyard/js-libp2p-inspector/blob/main/packages/libp2p-inspector/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>) |
| 67 | - MIT ([LICENSE-MIT](https://github.com/ipshipyard/js-libp2p-inspector/blob/main/packages/libp2p-inspector/LICENSE-MIT) / <http://opensource.org/licenses/MIT>) |
| 68 | |
| 69 | # Contribution |
| 70 | |
| 71 | Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |