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

Commit

Permalink
feat!: update to latest libp2p interfaces (#137)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: uses new single-issue libp2p interface modules
  • Loading branch information
achingbrain authored Jun 15, 2022
1 parent 6fea68d commit aabed1d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
# js-libp2p-bootstrap
# @libp2p/bootstrap <!-- omit in toc -->

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)
[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)
[![](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-bootstrap.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-bootstrap)
[![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)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
![](https://img.shields.io/badge/Node.js-%3E%3D14.0.0-orange.svg?style=flat-square)
[![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-bootstrap.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-bootstrap)
[![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)

> JavaScript libp2p Implementation of the railing process of a Node through a bootstrap peer list
> Node.js IPFS Implementation of the railing process of a Node through a bootstrap peer list
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#license)
- [Contribution](#contribution)

## Install

```console
$ npm i @libp2p/bootstrap
```

## Usage

Expand Down Expand Up @@ -60,16 +71,16 @@ start()

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:

- 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.
- **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
- 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.
- **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.

## 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)
- 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>)

### Contribution
## 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.
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
],
"exports": {
".": {
"types": "./src/index.d.ts",
"import": "./dist/src/index.js"
}
},
Expand Down Expand Up @@ -133,14 +134,17 @@
"release": "aegir release"
},
"dependencies": {
"@libp2p/interfaces": "^2.0.1",
"@libp2p/logger": "^1.1.3",
"@libp2p/interface-peer-discovery": "^1.0.0",
"@libp2p/interface-peer-info": "^1.0.1",
"@libp2p/interfaces": "^3.0.2",
"@libp2p/logger": "^2.0.0",
"@libp2p/peer-id": "^1.1.9",
"@multiformats/mafmt": "^11.0.2",
"@multiformats/multiaddr": "^10.1.7"
},
"devDependencies": {
"@libp2p/interface-compliance-tests": "^2.0.1",
"aegir": "^37.0.7"
"@libp2p/interface-peer-discovery-compliance-tests": "^1.0.0",
"@libp2p/interface-peer-id": "^1.0.2",
"aegir": "^37.2.0"
}
}
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { Multiaddr } from '@multiformats/multiaddr'
import { P2P } from '@multiformats/mafmt'
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
import { logger } from '@libp2p/logger'
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery'
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import { peerIdFromString } from '@libp2p/peer-id'
import { symbol } from '@libp2p/interfaces/peer-discovery'
import { symbol } from '@libp2p/interface-peer-discovery'

const log = logger('libp2p:bootstrap')

Expand Down
4 changes: 2 additions & 2 deletions test/bootstrap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { IPFS } from '@multiformats/mafmt'
import { Bootstrap } from '../src/index.js'
import peerList from './fixtures/default-peers.js'
import partialValidPeerList from './fixtures/some-invalid-peers.js'
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
import { isPeerId } from '@libp2p/interfaces/peer-id'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import { isPeerId } from '@libp2p/interface-peer-id'

describe('bootstrap', () => {
it('should throw if no peer list is provided', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/compliance.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env mocha */

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

Expand Down

0 comments on commit aabed1d

Please sign in to comment.