Get messages from store in chronological order

This commit is contained in:
Franck Royer 2021-05-19 11:57:03 +10:00
parent de3aea626a
commit fb7e9f2b9e
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
4 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Implement [Waku v2 Light Push protocol](https://rfc.vac.dev/spec/19/).
- Expose `Direction` enum from js-waku root (it was only accessible via the proto module).
## [0.4.0] - 2021-05-18

View File

@ -3,6 +3,7 @@ import util from 'util';
import {
ChatMessage,
Direction,
Environment,
getStatusFleetNodes,
StoreCodec,
@ -80,6 +81,7 @@ export default async function startChat(): Promise<void> {
const messages = await waku.store.queryHistory({
peerId,
contentTopics: [ChatContentTopic],
direction: Direction.FORWARD,
});
messages?.map((msg) => {
if (msg.payload) {

View File

@ -13,6 +13,6 @@ export {
export { WakuRelay, RelayCodec } from './lib/waku_relay';
export { WakuStore, StoreCodec } from './lib/waku_store';
export { Direction, WakuStore, StoreCodec } from './lib/waku_store';
export * as proto from './proto';

View File

@ -11,6 +11,8 @@ import { Direction, HistoryRPC } from './history_rpc';
export const StoreCodec = '/vac/waku/store/2.0.0-beta3';
export { Direction };
export interface Options {
peerId: PeerId;
contentTopics: string[];