chore(store-js): bump js-waku to 0.30.0

This commit is contained in:
fryorcraken.eth 2022-10-28 11:30:05 +11:00
parent 2076592b55
commit 7de548c8a6
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 9 additions and 24 deletions

View File

@ -13,10 +13,10 @@
<div id='timestamp'></div> <div id='timestamp'></div>
<script type='module'> <script type='module'>
import {Protocols} from 'https://unpkg.com/js-waku@0.29.0/bundle/index.js'; import {Protocols} from 'https://unpkg.com/js-waku@0.30.0/bundle/index.js';
import {createWaku} from 'https://unpkg.com/js-waku@0.29.0/bundle/lib/create_waku.js' import {createLightNode} from 'https://unpkg.com/js-waku@0.30.0/bundle/lib/create_waku.js'
import {waitForRemotePeer} from 'https://unpkg.com/js-waku@0.29.0/bundle/lib/wait_for_remote_peer.js' import {waitForRemotePeer} from 'https://unpkg.com/js-waku@0.30.0/bundle/lib/wait_for_remote_peer.js'
import {DecoderV0} from 'https://unpkg.com/js-waku@0.29.0/bundle/lib/waku_message/version_0.js' import {DecoderV0} from 'https://unpkg.com/js-waku@0.30.0/bundle/lib/waku_message/version_0.js'
/** /**
* This example demonstrates how to use the js-waku minified bundle * This example demonstrates how to use the js-waku minified bundle
@ -28,7 +28,7 @@
const timestampDiv = document.getElementById('timestamp'); const timestampDiv = document.getElementById('timestamp');
timestampDiv.innerHTML = '<p>Creating waku.</p>'; timestampDiv.innerHTML = '<p>Creating waku.</p>';
const node = await createWaku({defaultBootstrap: true}); const node = await createLightNode({defaultBootstrap: true});
timestampDiv.innerHTML = '<p>Starting waku.</p>'; timestampDiv.innerHTML = '<p>Starting waku.</p>';
await node.start(); await node.start();
@ -46,25 +46,10 @@
return true; return true;
}; };
const startTime = new Date();
// Only retrieve a week of messages
startTime.setTime(Date.now() - 7 * 24 * 60 * 60 * 1000);
try {
await node.store await node.store
.queryOrderedCallback([new DecoderV0("/relay-ping/1/ping/null")], .queryOrderedCallback([new DecoderV0("/relay-ping/1/ping/null")],
callback, callback,
{ {pageDirection: 'backward'});
pageDirection: 'backward',
pageSize: 1,
timeFilter: {
startTime,
endTime: new Date()
}
});
} catch (e) {
// Known issue: https://github.com/status-im/nwaku/issues/1157
console.log(e)
}
</script> </script>
</body> </body>