Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit aabed1d

Browse files
authored
feat!: update to latest libp2p interfaces (#137)
BREAKING CHANGE: uses new single-issue libp2p interface modules
1 parent 6fea68d commit aabed1d

File tree

5 files changed

+40
-25
lines changed

5 files changed

+40
-25
lines changed

README.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
# js-libp2p-bootstrap
1+
# @libp2p/bootstrap <!-- omit in toc -->
22

3-
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)
4-
[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
5-
[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
6-
[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)
7-
[![](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-bootstrap.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-bootstrap)
8-
[![Build Status](https://github.com/libp2p/js-libp2p-bootstrap/actions/workflows/js-test-and-release.yml/badge.svg?branch=main)](https://github.com/libp2p/js-libp2p-bootstrap/actions/workflows/js-test-and-release.yml)
9-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
10-
![](https://img.shields.io/badge/Node.js-%3E%3D14.0.0-orange.svg?style=flat-square)
3+
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4+
[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
5+
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
6+
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-bootstrap.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-bootstrap)
7+
[![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-bootstrap/actions/workflows/js-test-and-release.yml)
118

12-
> JavaScript libp2p Implementation of the railing process of a Node through a bootstrap peer list
9+
> Node.js IPFS Implementation of the railing process of a Node through a bootstrap peer list
10+
11+
## Table of contents <!-- omit in toc -->
12+
13+
- [Install](#install)
14+
- [Usage](#usage)
15+
- [Contribute](#contribute)
16+
- [License](#license)
17+
- [Contribution](#contribution)
18+
19+
## Install
20+
21+
```console
22+
$ npm i @libp2p/bootstrap
23+
```
1324

1425
## Usage
1526

@@ -60,16 +71,16 @@ start()
6071

6172
The libp2p implementation in JavaScript is a work in progress. As such, there are a few things you can do right now to help out:
6273

63-
- Go through the modules and **check out existing issues**. This is especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
64-
- **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
74+
- Go through the modules and **check out existing issues**. This is especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
75+
- **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
6576

6677
## License
6778

6879
Licensed under either of
6980

70-
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
71-
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
81+
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
82+
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
7283

73-
### Contribution
84+
## Contribution
7485

7586
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.

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
],
2929
"exports": {
3030
".": {
31+
"types": "./src/index.d.ts",
3132
"import": "./dist/src/index.js"
3233
}
3334
},
@@ -133,14 +134,17 @@
133134
"release": "aegir release"
134135
},
135136
"dependencies": {
136-
"@libp2p/interfaces": "^2.0.1",
137-
"@libp2p/logger": "^1.1.3",
137+
"@libp2p/interface-peer-discovery": "^1.0.0",
138+
"@libp2p/interface-peer-info": "^1.0.1",
139+
"@libp2p/interfaces": "^3.0.2",
140+
"@libp2p/logger": "^2.0.0",
138141
"@libp2p/peer-id": "^1.1.9",
139142
"@multiformats/mafmt": "^11.0.2",
140143
"@multiformats/multiaddr": "^10.1.7"
141144
},
142145
"devDependencies": {
143-
"@libp2p/interface-compliance-tests": "^2.0.1",
144-
"aegir": "^37.0.7"
146+
"@libp2p/interface-peer-discovery-compliance-tests": "^1.0.0",
147+
"@libp2p/interface-peer-id": "^1.0.2",
148+
"aegir": "^37.2.0"
145149
}
146150
}

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { Multiaddr } from '@multiformats/multiaddr'
22
import { P2P } from '@multiformats/mafmt'
33
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
44
import { logger } from '@libp2p/logger'
5-
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery'
6-
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
5+
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
6+
import type { PeerInfo } from '@libp2p/interface-peer-info'
77
import { peerIdFromString } from '@libp2p/peer-id'
8-
import { symbol } from '@libp2p/interfaces/peer-discovery'
8+
import { symbol } from '@libp2p/interface-peer-discovery'
99

1010
const log = logger('libp2p:bootstrap')
1111

test/bootstrap.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { IPFS } from '@multiformats/mafmt'
55
import { Bootstrap } from '../src/index.js'
66
import peerList from './fixtures/default-peers.js'
77
import partialValidPeerList from './fixtures/some-invalid-peers.js'
8-
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
9-
import { isPeerId } from '@libp2p/interfaces/peer-id'
8+
import type { PeerInfo } from '@libp2p/interface-peer-info'
9+
import { isPeerId } from '@libp2p/interface-peer-id'
1010

1111
describe('bootstrap', () => {
1212
it('should throw if no peer list is provided', () => {

test/compliance.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-env mocha */
22

3-
import tests from '@libp2p/interface-compliance-tests/peer-discovery'
3+
import tests from '@libp2p/interface-peer-discovery-compliance-tests'
44
import { Bootstrap } from '../src/index.js'
55
import peerList from './fixtures/default-peers.js'
66

0 commit comments

Comments
 (0)