From e44776d09c99fcb1a28cfd3699920b7fd1785868 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 13 May 2021 11:51:39 +1000 Subject: [PATCH] Update usage with dial peer method --- CHANGELOG.md | 2 +- README.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 775f2af9a4..ba9725419e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index d0717d2383..347e969458 100644 --- a/README.md +++ b/README.md @@ -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']