Update usage with dial peer method

This commit is contained in:
Franck Royer 2021-05-13 11:51:39 +10:00
parent 6f7c1e0ca3
commit e44776d09c
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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']