117 Commits

Author SHA1 Message Date
Alex Potsides
ceb44f9e98
docs: add build step to docs (#1275)
Now that we need to build ts to js a build step is necessary.

Add it to the instructions where we are telling people to clone the repo first.

Refs: #1273
2022-06-24 16:28:56 +01:00
Alex Potsides
199395de4d
feat: convert to typescript (#1172)
Converts this module to typescript.

- Ecosystem modules renamed from (e.g.) `libp2p-tcp` to `@libp2p/tcp`
- Ecosystem module now have named exports
- Configuration has been updated, now pass instances of modules instead of classes:
- Some configuration keys have been renamed to make them more descriptive.  `transport` -> `transports`, `connEncryption` -> `connectionEncryption`.  In general where we pass multiple things, the key is now plural, e.g. `streamMuxer` -> `streamMuxers`, `contentRouting` -> `contentRouters`, etc.  Where we are configuring a singleton the config key is singular, e.g. `connProtector` -> `connectionProtector` etc.
- Properties of the `modules` config key have been moved to the root
- Properties of the `config` config key have been moved to the root
```js
// before
import Libp2p from 'libp2p'
import TCP from 'libp2p-tcp'

await Libp2p.create({
  modules: {
    transport: [
      TCP
    ],
  }
  config: {
    transport: {
      [TCP.tag]: {
        foo: 'bar'
      }
    },
    relay: {
      enabled: true,
      hop: {
        enabled: true,
        active: true
      }
    }
  }
})
```
```js
// after
import { createLibp2p } from 'libp2p'
import { TCP } from '@libp2p/tcp'

await createLibp2p({
  transports: [
    new TCP({ foo: 'bar' })
  ],
  relay: {
    enabled: true,
    hop: {
      enabled: true,
      active: true
    }
  }
})
```
- Use of `enabled` flag has been reduced - previously you could pass a module but disable it with config.  Now if you don't want a feature, just don't pass an implementation.   Eg:
```js
// before
await Libp2p.create({
  modules: {
    transport: [
      TCP
    ],
    pubsub: Gossipsub
  },
  config: {
    pubsub: {
      enabled: false
    }
  }
})
```
```js
// after
await createLibp2p({
  transports: [
    new TCP()
  ]
})
```
- `.multiaddrs` renamed to `.getMultiaddrs()` because it's not a property accessor, work is done by that method to calculate announce addresses, observed addresses, etc
- `/p2p/${peerId}` is now appended to all addresses returned by `.getMultiaddrs()` so they can be used opaquely (every consumer has to append the peer ID to the address to actually use it otherwise).  If you need low-level unadulterated addresses, call methods on the address manager.

BREAKING CHANGE: types are no longer hand crafted, this module is now ESM only
2022-03-28 14:30:27 +01:00
Tim Daubenschütz
a0516ebc85
docs: update node and npm version badge according to package.json (#1074) 2021-12-22 14:01:54 +01:00
Vasco Santos
f342c1ff50
docs: update package list (#969) 2021-08-26 12:02:17 +02:00
Vasco Santos
42b51d8f01
chore: add github actions badge and fix codecov (#837) 2020-12-17 14:22:36 +01:00
Vasco Santos
408868655c chore: remove secio from packages table (#833) 2020-12-16 13:56:41 +01:00
Vasco Santos
4eabe07bde chore: update node badge 2020-10-12 12:48:48 +02:00
Vasco Santos
bd26bde876
chore: remove libp2p-pubsub from package table (#743) 2020-08-31 15:19:43 +02:00
Vasco Santos
fa5ee873e3
chore: update node and npm badges (#727) 2020-08-05 18:26:50 +02:00
Cayman
afafd08943
chore: fix discv5 npm link
chore: update package name for discv5
2020-06-11 13:03:31 +02:00
Vasco Santos
3f2b06dc26 chore: remove peer-info from package table 2020-05-28 12:37:48 +02:00
Vasco Santos
43630f1e0b test: use libp2p-noise (#585)
* chore: use libp2p-noise

* chore: address review
2020-05-28 12:37:48 +02:00
Cayman
2aac3b0f69 chore: update libp2p-gossipsub url 2020-05-27 23:14:54 +02:00
Vasco Santos
9862653051 chore: add readme reference to migrations 2020-05-25 14:54:03 +02:00
David Dias
5255d87d0a
docs: remove Tech Lead from README (#623) 2020-04-30 11:51:21 +02:00
Vasco Santos
2620d46f01
chore: remove spdy from package table (#607) 2020-04-14 12:40:03 +02:00
Vasco Santos
b57de4ed0c
chore: add discv5 peer-discovery module (#606) 2020-04-14 10:51:29 +02:00
David Dias
aa78d2ef15 Update README.md 2020-03-05 11:16:34 +01:00
Vasco Santos
5a4641980d
chore: remove websocket star from package table (#565)
* chore: remove websocket star from package table

* chore: update package-table

* chore: remove not active modules

* chore: use package-table updated with correct ci badge url
2020-03-04 11:24:39 +01:00
David Dias
eb2528c1d6
docs: fix chat url (#550) 2020-02-05 11:58:04 +01:00
shresthagrawal
ed0c2cb6c1
docs: redirect to the npm docs for latest release (#541)
* docs: redirect to the npm docs for latest release

* Apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-01-29 15:53:57 +01:00
Vasco Santos
d21b7ce4ff docs: getting started (#514)
* docs: getting started

* docs: review getting started (#520)

* doc: initial review of getting started

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>

* chore: move multiplexing to basic setup

* chore: add read more cta

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* chore: just configure multiplexer

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* chore: just use websockets and changed dht module introduction

* chore: add reference for events in the API doc

* docs: simplify getting started guide and clean up language

* chore: apply suggestions from code review

Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>

* docs(fix): address review comments

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
2020-01-24 14:40:40 +01:00
Vasco Santos
854ac49a10 chore: update readme (#513) 2020-01-24 14:40:40 +01:00
Vasco Santos
287f1b98e5 docs: new api (#472)
* docs: new api

* chore: new iteration

* chore: apply suggestions from code review

Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* chore: address review

* docs: add events

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
2020-01-24 14:40:40 +01:00
Vasco Santos
432b0997ae refactor: pubsub (#467)
* feat: peer-store v0

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* chore: address review

* refactor: pubsub subsystem

* chore: address review

* chore: use topology interface

* chore: address review

* chore: address review

* chore: simplify tests
2020-01-24 14:40:40 +01:00
Jacob Heun
0cef51d4c2 Add streaming iterables guide (#459)
* docs: add streaming iterables guide placeholder

* chore: move peer discovery readme to doc fold:wqer

* docs: add link to async refactor issue
2020-01-24 14:40:40 +01:00
David Dias
b277b26043 docs: add missing ones 2019-12-11 10:52:13 +01:00
David Dias
bc071ce7d7 docs: fix gossipsub link 2019-12-11 10:52:13 +01:00
David Dias
01730214d6 docs: fix js-interfaces badge 2019-12-11 10:52:13 +01:00
David Dias
0826531e31 docs: update the package table for my pepz :) 2019-12-11 10:52:13 +01:00
Ryan Bell
0fc4537a5e docs(fix): update README.md language (#468) 2019-10-24 10:52:40 +02:00
Jacob Heun
6a05f3e6e7
docs(fix): correct docs and example for pnet (#464)
* docs(fix): correct docs and example for pnet

* docs(fix): correct pnet docs
2019-10-16 17:27:31 +02:00
swedneck
2a80618740 docs: add bridged chats (#454) 2019-09-23 11:39:47 +02:00
Vasco Santos
5b1bd389f8 docs: update packages table (#265)
* docs: update packages table

* docs: removed not implemented packages
2019-09-03 10:29:03 +02:00
Fei Liu
3e31c2d0df docs: remove dead link from readme (#450) 2019-08-27 17:07:21 +02:00
a1300
b0f124b5ff fix: pubsub configuration (#404)
* fix: add pubsub default config (#401)

License: MIT
Signed-off-by: Matthias Knopp <matthias-knopp@gmx.net>

* docs: add default pubsub config to README (#401)

License: MIT
Signed-off-by: Matthias Knopp <matthias-knopp@gmx.net>

* fix: pass config to provided PubSub (#401)

License: MIT
Signed-off-by: Matthias Knopp <matthias-knopp@gmx.net>

* docs: adapt pubsub/example for new config (#401)

License: MIT
Signed-off-by: Matthias Knopp <matthias-knopp@gmx.net>

* Update examples/pubsub/README.md

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* test: add pubsub config tests (#401)

License: MIT
Signed-off-by: Matthias Knopp <matthias-knopp@gmx.net>
2019-08-19 17:06:08 +02:00
Vasco Santos
a2b3446ed7 docs: async migration (#397) 2019-08-06 12:01:16 +02:00
Vasco Santos
791f39a09b feat: integrate gossipsub by default (#365)
BREAKING CHANGE: new configuration for deciding the implementation of pubsub to be used.
In this context, the experimental flags were also removed. See the README for the latest usage.
2019-07-31 09:38:14 +02:00
Alex Potsides
df6ef45a2d feat: promisify all api methods that accept callbacks (#381)
* feat: promisify all api methods that accept callbacks

This is a stop-gap until the full async/await migration can be
completed.  It means we can refactor tests of other modules that
depend on this module without having to mix async flow control
strategies.

N.b. some methods that were previously callable without callbacks
(e.g. `node.start()`, `node.stop()`, etc) now require callbacks
otherwise a promise is returned which, if rejected, can cause
`unhandledPromiseRejection` events and lead to memory leaks.

* docs: add a global note to the api about promisify

* fix: update the logic for unsubscribe

* test(fix): correct pubsub unsubscribe usage for api change

* test(fix): update content routing tests for latest delegate version
2019-07-29 15:40:40 +02:00
Jacob Heun
9433c6c398
docs: add createLibp2p to readme (#368)
* chore: update deps
* test(fix): account for wrtcrendezvous now being thenable
2019-06-07 15:50:23 +02:00
Jacob Heun
51cc993876
docs: fix incorrect references for enabling dht discovery (#358) 2019-04-16 15:04:23 +02:00
Jacob Heun
313b1eae20
fix: connection emits (#352)
* fix: add connection tracking events

* chore: update dependencies
2019-04-11 13:49:31 +02:00
Jacob Heun
01aa44724e
feat: auto dial discovered peers (#349) 2019-04-11 12:44:58 +02:00
Vasco Santos
8b627797e2 chore: add discourse badge (#351) 2019-04-10 11:53:19 +02:00
Yusef Napora
5204da73f7 chore: update readme with links to docs & discuss (#347) 2019-04-04 10:49:40 +02:00
Andrew Nesbitt
da52af704e docs: update package table in readme (#337) 2019-03-15 16:18:27 +01:00
Aditya Bose
ef3238bdee docs: update README.md (#334)
Fixed a typo in the Tutorials and Examples section.
2019-03-12 08:55:24 +01:00
Hugo Dias
d497961938 fix: bundle-size (#298)
* fix: bundle-size

* fix: feedback

* fix: lint

* chore: update deps

* fix: add bundle size check and update deps

* fix: fix badges

* fix: add once to package.json

* fix: fix config validation
2019-02-21 17:07:35 +01:00
Vasco Santos
c4cab007af feat: enable dht by default (#313)
BREAKING CHANGE: dht experimental flag was removed and a dht.enabled property was added to the config
2019-01-29 18:57:09 +01:00
Vasco Santos
970deec2a4 feat: add maxNumProviders to findprovs (#283)
* feat: add maxNumProviders to findprovs

* chore: upgrade libp2p-kad-dht
2018-11-13 11:46:51 +01:00