mirror of https://github.com/waku-org/js-waku.git
Remove TODO, update code (#518)
This commit is contained in:
parent
f5a693c601
commit
b432902fc9
|
@ -19,21 +19,19 @@
|
||||||
* This example demonstrates how to use the js-waku minified bundle
|
* This example demonstrates how to use the js-waku minified bundle
|
||||||
* available on unpkg.com.
|
* available on unpkg.com.
|
||||||
*
|
*
|
||||||
* It is a simple scripts that uses Waku Store to retrieve ping relay messages
|
* It is a simple script that uses Waku Store to retrieve ping relay messages
|
||||||
* and displays the timestamp of the most recent ping relay message.
|
* and displays the timestamp of the most recent ping relay message.
|
||||||
*
|
|
||||||
* More explanations are provided in this guide (TODO).
|
|
||||||
*/
|
*/
|
||||||
const timestampDiv = document.getElementById('timestamp');
|
const timestampDiv = document.getElementById('timestamp');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
timestampDiv.innerHTML = '<p>Starting waku.</p>';
|
timestampDiv.innerHTML = '<p>Starting waku.</p>';
|
||||||
jswaku.Waku.create({ bootstrap: true }).catch(e => {
|
jswaku.Waku.create({ bootstrap: { default: true } }).catch(e => {
|
||||||
timestampDiv.innerHTML = 'Failed to create Waku: ' + e.toString();
|
timestampDiv.innerHTML = 'Failed to create Waku: ' + e.toString();
|
||||||
}
|
}
|
||||||
).then(waku => {
|
).then(waku => {
|
||||||
timestampDiv.innerHTML = '<p>Connecting to a peer.</p>';
|
timestampDiv.innerHTML = '<p>Connecting to a peer.</p>';
|
||||||
waku.waitForConnectedPeer()
|
waku.waitForRemotePeer()
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
timestampDiv.innerHTML = 'Failed to connect to peers' + e.toString();
|
timestampDiv.innerHTML = 'Failed to connect to peers' + e.toString();
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue