Skip to content

Commit d3d8358

Browse files
committed
docs: update readmes
1 parent 952d8f0 commit d3d8358

File tree

6 files changed

+71
-9
lines changed

6 files changed

+71
-9
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
# js-libp2p-inspector-monorepo
1+
# js-libp2p-inspector
22

33
[![codecov](https://img.shields.io/codecov/c/github/ipshipyard/js-libp2p-inspector.svg?style=flat-square)](https://codecov.io/gh/ipshipyard/js-libp2p-inspector)
44
[![CI](https://img.shields.io/github/actions/workflow/status/ipshipyard/js-libp2p-inspector/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipshipyard/js-libp2p-inspector/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
55

66
> Inspect a running libp2p node
77
8+
A web based inspector for libp2p nodes that runs in [browser devtools](https://github.com/ipshipyard/js-libp2p-inspector/tree/main/packages/libp2p-devtools) or as a
9+
standalone [Electron app](https://github.com/ipshipyard/js-libp2p-inspector/tree/main/packages/libp2p-inspector).
10+
11+
![libp2p-inspector running in Electron](https://github.com/ipshipyard/js-libp2p-inspector/blob/main/assets/electron.png)
12+
813
# Packages
914

1015
- [`packages/libp2p-devtools`](https://github.com/ipshipyard/js-libp2p-inspector/tree/main/packages/libp2p-devtools) Browser DevTools plugin to inspect a libp2p node running on the current page

assets/electron.png

682 KB
Loading

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"dep-check": "aegir run dep-check",
3333
"doc-check": "aegir run doc-check",
3434
"spell-check": "aegir spell-check",
35+
"start": "aegir run start",
3536
"release": "run-s build docs:no-publish npm:release docs",
3637
"npm:release": "aegir run release --concurrency 1",
3738
"docs": "aegir docs",

packages/libp2p-devtools/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ Browse to your webapp and open the DevTools, you should see a "libp2p" tab towar
101101

102102
6. ??? more features here
103103

104-
# Install
105-
106-
```console
107-
$ npm i @ipshipyard/libp2p-devtools
108-
```
109-
110104
# License
111105

112106
Licensed under either of

packages/libp2p-inspector/README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,40 @@ repo and examine the changes made.
2525
An electron app that bundles @ipshipyard/libp2p-inspector-ui for use with
2626
libp2p nodes running under Node.js or (eventually) in browsers.
2727

28-
# Install
28+
![libp2p-inspector running in Electron](https://github.com/ipshipyard/js-libp2p-inspector/blob/main/assets/electron.png)
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
2953

3054
```console
31-
$ npm i @ipshipyard/libp2p-inspector
55+
$ libp2p-inspector
3256
```
3357

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+
3462
# License
3563

3664
Licensed under either of

packages/libp2p-inspector/src/index.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,40 @@
33
*
44
* An electron app that bundles @ipshipyard/libp2p-inspector-ui for use with
55
* libp2p nodes running under Node.js or (eventually) in browsers.
6+
*
7+
* ![libp2p-inspector running in Electron](https://github.com/ipshipyard/js-libp2p-inspector/blob/main/assets/electron.png)
8+
*
9+
* ## Installation instructions
10+
*
11+
* ### 1. libp2p configuration
12+
*
13+
* Configure `@ipshipyard/libp2p-inspector-metrics` as your metrics implementation:
14+
*
15+
* ```ts
16+
* import { createLibp2p } from 'libp2p'
17+
* import { inspectorMetrics } from '@ipshipyard/libp2p-inspector-metrics'
18+
*
19+
* const node = await createLibp2p({
20+
* metrics: inspectorMetrics(),
21+
* //... other options her
22+
* })
23+
* ```
24+
*
25+
* ### 2. Install the inspector
26+
*
27+
* ```console
28+
* $ npm i -g @ipshipyard/libp2p-inspector
29+
* ```
30+
*
31+
* ### 3. Run
32+
*
33+
* ```console
34+
* $ libp2p-inspector
35+
* ```
36+
*
37+
* Local libp2p nodes running the `@ipshipyard/libp2p-inspector-metrics` metrics
38+
* implementation will advertise themselves via MDNS and should appear in the
39+
* app.
640
*/
741

842
export {}

0 commit comments

Comments
 (0)