mirror of https://github.com/status-im/js-waku.git
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
|
||||
- Enable passing `string`s to `addPeerToAddressBook`.
|
||||
- Use `addPeerToAddressBook` in examples.
|
||||
- Use `addPeerToAddressBook` in examples and usage doc.
|
||||
|
||||
## [0.1.0] - 2021-05-12
|
||||
|
||||
|
|
|
@ -24,6 +24,10 @@ Connect to a new peer:
|
|||
import { multiaddr } from 'multiaddr';
|
||||
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(
|
||||
'16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ',
|
||||
['/dns4/node-01.do-ams3.jdev.misc.statusim.net/tcp/7010/wss']
|
||||
|
|
Loading…
Reference in New Issue