Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
docs: publish api docs (#51)
Browse files Browse the repository at this point in the history
Updates project config to publish api docs
  • Loading branch information
achingbrain committed Dec 16, 2022
1 parent 0a597f1 commit 149e3b9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
node_modules
coverage
.nyc_output
dist
.docs
.coverage
node_modules
package-lock.json
yarn.lock
docs
dist
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# @libp2p/peer-store <!-- omit in toc -->

[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-peer-store.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-peer-store)
[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-peer-store/actions/workflows/js-test-and-release.yml)
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-peer-store/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-peer-store/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> Stores information about peers libp2p knows on the network
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Browser `<script>` tag](#browser-script-tag)
- [Description](#description)
- [Submitting records to the PeerStore](#submitting-records-to-the-peerstore)
- [Identify](#identify)
Expand All @@ -31,15 +31,24 @@
- [Events](#events)
- [Data Persistence](#data-persistence)
- [Future Considerations](#future-considerations)
- [API Docs](#api-docs)
- [License](#license)
- [Contribute](#contribute)
- [Contribution](#contribution)

## Install

```console
$ npm i @libp2p/peer-store
```

### Browser `<script>` tag

Loading this module through a script tag will make it's exports available as `Libp2pPeerStore` in the global namespace.

```html
<script src="https://unpkg.com/@libp2p/peer-store/dist/index.min.js"></script>
```

## Description

Libp2p's PeerStore is responsible for keeping an updated register with the relevant information of the known peers. It should be the single source of truth for all peer data, where a subsystem can learn about peers' data and where someone can listen for updates. The PeerStore comprises four main components: `addressBook`, `keyBook`, `protocolBook` and `metadataBook`.
Expand Down Expand Up @@ -190,14 +199,18 @@ Metadata is stored under the following key pattern:
- When improving libp2p configuration for specific runtimes, we should take into account the PeerStore recommended datastore.
- When improving libp2p configuration, we should think about a possible way of allowing the configuration of Bootstrap to be influenced by the persisted peers, as a way to decrease the load on Bootstrap nodes.

## API Docs

- <https://libp2p.github.io/js-libp2p-peer-store>

## License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

## Contribute
## Contribution

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.

Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"types": "./dist/src/index.d.ts",
"files": [
"src",
"dist/src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
Expand Down Expand Up @@ -140,7 +140,8 @@
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node --cov",
"test:electron-main": "aegir test -t electron-main",
"release": "aegir release"
"release": "aegir release",
"docs": "aegir docs"
},
"dependencies": {
"@libp2p/interface-peer-id": "^1.0.4",
Expand All @@ -154,10 +155,10 @@
"@multiformats/multiaddr": "^11.0.0",
"err-code": "^3.0.1",
"interface-datastore": "^7.0.0",
"it-all": "^1.0.6",
"it-filter": "^1.0.3",
"it-foreach": "^0.1.1",
"it-map": "^1.0.6",
"it-all": "^2.0.0",
"it-filter": "^2.0.0",
"it-foreach": "^1.0.0",
"it-map": "^2.0.0",
"it-pipe": "^2.0.3",
"mortice": "^3.0.0",
"multiformats": "^10.0.0",
Expand All @@ -175,6 +176,6 @@
"p-defer": "^4.0.0",
"p-wait-for": "^5.0.0",
"protons": "^6.0.0",
"sinon": "^14.0.0"
"sinon": "^15.0.1"
}
}

0 comments on commit 149e3b9

Please sign in to comment.