mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-05 23:33:08 +00:00
Update usage with dial peer method
This commit is contained in:
parent
6f7c1e0ca3
commit
e44776d09c
@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Enable passing `string`s to `addPeerToAddressBook`.
|
- Enable passing `string`s to `addPeerToAddressBook`.
|
||||||
- Use `addPeerToAddressBook` in examples.
|
- Use `addPeerToAddressBook` in examples and usage doc.
|
||||||
|
|
||||||
## [0.1.0] - 2021-05-12
|
## [0.1.0] - 2021-05-12
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,10 @@ Connect to a new peer:
|
|||||||
import { multiaddr } from 'multiaddr';
|
import { multiaddr } from 'multiaddr';
|
||||||
import PeerId from 'peer-id';
|
import PeerId from 'peer-id';
|
||||||
|
|
||||||
|
// Directly dial a new peer
|
||||||
|
await waku.dial('/dns4/node-01.do-ams3.jdev.misc.statusim.net/tcp/7010/wss/p2p/16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ');
|
||||||
|
|
||||||
|
// Or, add peer to address book so it auto dials in the background
|
||||||
waku.addPeerToAddressBook(
|
waku.addPeerToAddressBook(
|
||||||
'16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ',
|
'16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ',
|
||||||
['/dns4/node-01.do-ams3.jdev.misc.statusim.net/tcp/7010/wss']
|
['/dns4/node-01.do-ams3.jdev.misc.statusim.net/tcp/7010/wss']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user