From b9892545e7fb913ec6dc4fb0458f2d1660d1dcda Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Sun, 29 May 2022 20:20:35 +0200 Subject: [PATCH] add notes --- examples/community/index.tsx | 3 +++ packages/status-js/.scripts/example copy 2.ts | 19 +++---------------- packages/status-js/src/client.ts | 1 + 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/examples/community/index.tsx b/examples/community/index.tsx index 3eb4ac3d..ee8e72af 100644 --- a/examples/community/index.tsx +++ b/examples/community/index.tsx @@ -1,7 +1,10 @@ import React, { StrictMode } from 'react' import { render } from 'react-dom' +// FIXME!: fixme from; Unable to resolve path to module '@status-im/react' import { Community } from '@status-im/react' +// TODO?: import/rename Chats, Messages, Messenger +// TODO?: import/rename CommunityAndMessenger, or Status even const App = () => { return diff --git a/packages/status-js/.scripts/example copy 2.ts b/packages/status-js/.scripts/example copy 2.ts index 12526da7..fa0aec85 100644 --- a/packages/status-js/.scripts/example copy 2.ts +++ b/packages/status-js/.scripts/example copy 2.ts @@ -1,37 +1,24 @@ -// import wtfnode from 'wtfnode' -// [WTF Node?] open handles: -// - Timers: -// node_modules/wtfnode/index.js:43 -// - (84600000 ~ 23 hr) (anonymous) @ //status-im/status-web/node_modules/promise-timeout/index.js:26 // libp2p -// node_modules/wtfnode/index.js:43 -// - Intervals: -// node_modules/wtfnode/index.js:43 -// - (300000 ~ 5 min) (anonymous) @ //status-im/status-web/node_modules/js-waku/src/lib/waku.ts:431 // js-waku - import { createClient } from '../src/client' import { Community } from '../src/community' -import { Messenger } from '../src/messenger' +// import { Messenger } from '../src/messenger' -// const COMMUNITY_PUBLIC_KEY = '0x02cf13719c8b836bebd4e430c497ee38e798a43e4d8c4760c34bbd9bf4f2434d26' const COMMUNITY_PUBLIC_KEY = '0x029dd5fecbd689dc11e2a5b399afed92cf1fab65d315b883efca753e8f3882f3bd' // compressed ;(async () => { const client = await createClient() - // Retrieve Community's metadata (e.g. description) + // Community (e.g. description, channels, channel messages) const community = await Community.instantiateCommunity( COMMUNITY_PUBLIC_KEY, client ) - // // Retrieve and subscribe to messages + // // Messenger/Messages (e.g. direct messages) // const messenger = await Messenger.create(, client) // // TODO: Register observers/callbacks // messenger.addObserver(() => {}) await client.stop() - - // wtfnode.dump() })() diff --git a/packages/status-js/src/client.ts b/packages/status-js/src/client.ts index 652ee902..80e56e25 100644 --- a/packages/status-js/src/client.ts +++ b/packages/status-js/src/client.ts @@ -6,6 +6,7 @@ import { Waku } from 'js-waku' // TODO?: error handling // TOOD?: teardown export async function createClient(): Promise { + // TODO?: set tiemout const waku = await Waku.create({ bootstrap: { default: false,