add notes

This commit is contained in:
Felicio Mununga 2022-05-29 23:06:18 +02:00
parent f25e65bb20
commit e55c610fd8
No known key found for this signature in database
GPG Key ID: 0EB8D75C775AB6F1
2 changed files with 8 additions and 5 deletions

View File

@ -4,12 +4,15 @@ import { Community } from '../src/community'
// import { Messenger } from '../src/messenger' // import { Messenger } from '../src/messenger'
const COMMUNITY_PUBLIC_KEY = const COMMUNITY_PUBLIC_KEY =
'0x029dd5fecbd689dc11e2a5b399afed92cf1fab65d315b883efca753e8f3882f3bd' // compressed '0x029dd5fecbd689dc11e2a5b399afed92cf1fab65d315b883efca753e8f3882f3bd' // compressed; A catchy name
// '0x02c788e419b56c714460220bedadc9c5d401ea10eee48d25ac81fc9a06fb75162e' // compressed; A boring name
// const COMMUNITY_CHANNEL_KEY = '0x029dd5fecbd689dc11e2a5b399afed92cf1fab65d315b883efca753e8f3882f3bd06935bce-a863-4827-9990-1652ae375c89' // 06935bce-a863-4827-9990-1652ae375c89; #channel
const COMMUNITY_CHANNEL_KEY = '6102c603-3246-4b90-986d-43c1b87b165f' // #random; UUID
;(async () => { ;(async () => {
const client = await createClient() const client = await createClient()
// Community (e.g. description, channels, channel messages) // Community (e.g. name, description, permissions, members, channels, channel messages)
const community = await Community.instantiateCommunity( const community = await Community.instantiateCommunity(
COMMUNITY_PUBLIC_KEY, COMMUNITY_PUBLIC_KEY,
client client
@ -17,8 +20,8 @@ const COMMUNITY_PUBLIC_KEY =
// // Messenger/Messages (e.g. direct messages) // // Messenger/Messages (e.g. direct messages)
// const messenger = await Messenger.create(, client) // const messenger = await Messenger.create(, client)
// // TODO: Register observers/callbacks
// messenger.addObserver(() => {}) // history
await client.stop() await client.stop()
})() })()

View File

@ -13,7 +13,7 @@ import type { Waku } from 'js-waku'
const dbg = debug('communities:messenger') const dbg = debug('communities:messenger')
// tood: pass waku client // TODO: pass waku client
export class Messenger { export class Messenger {
waku: Waku waku: Waku
chatsById: Map<string, Chat> chatsById: Map<string, Chat>