mirror of https://github.com/status-im/js-waku.git
Get messages from store in chronological order
This commit is contained in:
parent
de3aea626a
commit
fb7e9f2b9e
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Implement [Waku v2 Light Push protocol](https://rfc.vac.dev/spec/19/).
|
- 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
|
## [0.4.0] - 2021-05-18
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import util from 'util';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ChatMessage,
|
ChatMessage,
|
||||||
|
Direction,
|
||||||
Environment,
|
Environment,
|
||||||
getStatusFleetNodes,
|
getStatusFleetNodes,
|
||||||
StoreCodec,
|
StoreCodec,
|
||||||
|
@ -80,6 +81,7 @@ export default async function startChat(): Promise<void> {
|
||||||
const messages = await waku.store.queryHistory({
|
const messages = await waku.store.queryHistory({
|
||||||
peerId,
|
peerId,
|
||||||
contentTopics: [ChatContentTopic],
|
contentTopics: [ChatContentTopic],
|
||||||
|
direction: Direction.FORWARD,
|
||||||
});
|
});
|
||||||
messages?.map((msg) => {
|
messages?.map((msg) => {
|
||||||
if (msg.payload) {
|
if (msg.payload) {
|
||||||
|
|
|
@ -13,6 +13,6 @@ export {
|
||||||
|
|
||||||
export { WakuRelay, RelayCodec } from './lib/waku_relay';
|
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';
|
export * as proto from './proto';
|
||||||
|
|
|
@ -11,6 +11,8 @@ import { Direction, HistoryRPC } from './history_rpc';
|
||||||
|
|
||||||
export const StoreCodec = '/vac/waku/store/2.0.0-beta3';
|
export const StoreCodec = '/vac/waku/store/2.0.0-beta3';
|
||||||
|
|
||||||
|
export { Direction };
|
||||||
|
|
||||||
export interface Options {
|
export interface Options {
|
||||||
peerId: PeerId;
|
peerId: PeerId;
|
||||||
contentTopics: string[];
|
contentTopics: string[];
|
||||||
|
|
Loading…
Reference in New Issue