This repository was archived by the owner on Oct 3, 2023. It is now read-only.
File tree 6 files changed +63
-61
lines changed
6 files changed +63
-61
lines changed Original file line number Diff line number Diff line change
1
+ name : ci
2
+ on :
3
+ push :
4
+ branches :
5
+ - master
6
+ pull_request :
7
+ branches :
8
+ - master
9
+
10
+ jobs :
11
+ check :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - uses : actions/checkout@v2
15
+ - run : npm install
16
+ - run : npx aegir lint
17
+ - run : npx aegir dep-check
18
+ test-node :
19
+ needs : check
20
+ runs-on : ${{ matrix.os }}
21
+ strategy :
22
+ matrix :
23
+ os : [windows-latest, ubuntu-latest, macos-latest]
24
+ node : [14, 15]
25
+ fail-fast : true
26
+ steps :
27
+ - uses : actions/checkout@v2
28
+ - uses : actions/setup-node@v1
29
+ with :
30
+ node-version : ${{ matrix.node }}
31
+ - run : npm install
32
+ - run : npx nyc --reporter=lcov aegir test -t node -- --bail
33
+ - uses : codecov/codecov-action@v1
34
+ test-chrome :
35
+ needs : check
36
+ runs-on : ubuntu-latest
37
+ steps :
38
+ - uses : actions/checkout@v2
39
+ - run : npm install
40
+ - run : npx aegir test -t browser -t webworker --bail
41
+ test-firefox :
42
+ needs : check
43
+ runs-on : ubuntu-latest
44
+ steps :
45
+ - uses : actions/checkout@v2
46
+ - run : npm install
47
+ - run : npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ js-libp2p-bootstrap
8
8
[ ![ ] ( https://img.shields.io/codecov/c/github/libp2p/js-libp2p-bootstrap.svg?style=flat-square )] ( https://codecov.io/gh/libp2p/js-libp2p-bootstrap )
9
9
[ ![ ] ( https://img.shields.io/travis/libp2p/js-libp2p-bootstrap.svg?style=flat-square )] ( https://travis-ci.com/libp2p/js-libp2p-bootstrap )
10
10
[ ![ js-standard-style] ( https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square )] ( https://github.com/feross/standard )
11
- ![ ] ( https://img.shields.io/badge/npm-%3E%3D6.0.0-orange.svg?style=flat-square )
12
- ![ ] ( https://img.shields.io/badge/Node.js-%3E%3D10.0.0-orange.svg?style=flat-square )
11
+ ![ ] ( https://img.shields.io/badge/Node.js-%3E%3D14.0.0-orange.svg?style=flat-square )
13
12
14
13
> JavaScript libp2p Implementation of the railing process of a Node through a bootstrap peer list
15
14
Original file line number Diff line number Diff line change 24
24
"homepage" : " https://github.com/libp2p/js-libp2p-bootstrap" ,
25
25
"repository" : " github:libp2p/js-libp2p-bootstrap" ,
26
26
"engines" : {
27
- "node" : " >=6.0.0" ,
28
- "npm" : " >=3.0.0"
27
+ "node" : " >=14.0.0"
29
28
},
30
29
"types" : " dist/src/index.d.ts" ,
31
30
"devDependencies" : {
32
31
"@types/debug" : " ^4.1.5" ,
33
- "aegir" : " ^30.3 .0" ,
34
- "libp2p-interfaces" : " ^0.4 .0"
32
+ "aegir" : " ^33.0 .0" ,
33
+ "libp2p-interfaces" : " ^0.9 .0"
35
34
},
36
35
"dependencies" : {
37
- "debug" : " ^4.1 .1" ,
38
- "mafmt" : " ^8 .0.0" ,
39
- "multiaddr" : " ^8 .0.0 " ,
36
+ "debug" : " ^4.3 .1" ,
37
+ "mafmt" : " ^9 .0.0" ,
38
+ "multiaddr" : " ^9 .0.1 " ,
40
39
"peer-id" : " ^0.14.0"
41
40
},
42
- "pre-push" : [
43
- " lint" ,
44
- " test"
45
- ],
46
41
"contributors" : [
47
42
48
43
" Vasco Santos <[email protected] >" ,
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const PeerId = require ( 'peer-id' )
4
- const multiaddr = require ( 'multiaddr' )
4
+ const { Multiaddr } = require ( 'multiaddr' )
5
5
const mafmt = require ( 'mafmt' )
6
6
const { EventEmitter } = require ( 'events' )
7
7
const debug = require ( 'debug' )
@@ -59,7 +59,7 @@ class Bootstrap extends EventEmitter {
59
59
return log . error ( 'Invalid multiaddr' )
60
60
}
61
61
62
- const ma = multiaddr ( candidate )
62
+ const ma = new Multiaddr ( candidate )
63
63
64
64
const peerId = PeerId . createFromB58String ( ma . getPeerId ( ) )
65
65
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ describe('bootstrap', () => {
21
21
throw new Error ( 'should throw if no peer list is provided' )
22
22
} )
23
23
24
- it ( 'find the other peer' , function ( ) {
24
+ it ( 'find the other peer' , async function ( ) {
25
25
this . timeout ( 5 * 1000 )
26
26
const r = new Bootstrap ( {
27
27
list : peerList ,
@@ -30,10 +30,12 @@ describe('bootstrap', () => {
30
30
31
31
const p = new Promise ( ( resolve ) => r . once ( 'peer' , resolve ) )
32
32
r . start ( )
33
- return p
33
+
34
+ await p
35
+ r . stop ( )
34
36
} )
35
37
36
- it ( 'not fail on malformed peers in peer list' , function ( ) {
38
+ it ( 'not fail on malformed peers in peer list' , async function ( ) {
37
39
this . timeout ( 5 * 1000 )
38
40
39
41
const r = new Bootstrap ( {
@@ -53,7 +55,8 @@ describe('bootstrap', () => {
53
55
54
56
r . start ( )
55
57
56
- return p
58
+ await p
59
+ r . stop ( )
57
60
} )
58
61
59
62
it ( 'stop emitting events when stop() called' , async function ( ) {
You can’t perform that action at this time.
0 commit comments