-
Notifications
You must be signed in to change notification settings - Fork 8
chore: add docs for @opchan forum library
#257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| "node": ">=16.14" | ||
| } | ||
| }, | ||
| "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not convinced this belongs here.
| "build/javascript/manage-filter", | ||
| "build/javascript/faq", | ||
| ======= | ||
| "guides/js-waku/light-send-receive", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum... no :)
| @@ -0,0 +1,537 @@ | |||
| --- | |||
| title: Build Forum UIs with @opchan/react | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| title: Build Forum UIs with @opchan/react | |
| title: Build a Forum |
| description: Ship decentralized forum experiences over Waku using the OpChan React SDK. | ||
| --- | ||
|
|
||
| `@opchan/react` adds a forum-focused state layer on top of `@opchan/core`, Wagmi, and the Waku network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do a raw non react example too?
fryorcraken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you feed that in an LLM see if they can build with it? IT would be the easiest way to test.
| @@ -0,0 +1,537 @@ | |||
| --- | |||
| title: Build Forum UIs with @opchan/react | |||
| sidebar_label: Build Forum UIs with OpChan | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| sidebar_label: Build Forum UIs with OpChan | |
| sidebar_label: Build a Forum |
|
|
||
| ## Why OpChan on Waku? | ||
|
|
||
| - **Forum-first primitives** – cells, posts, comments, votes, bookmarks, and moderation helpers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relevance score should be top of the list
|
|
||
| ## 1. Bootstrap the provider | ||
|
|
||
| Add the Buffer polyfill (still required by many crypto libraries) and wrap your tree with `OpChanProvider`. The provider internally wires Wagmi, React Query, and the OpChan client to the Waku relay layer. Configure it with the content topic you want to publish under plus the reliable channel id you use for the [Waku Reliable Message Channel](https://specs.vac.dev/specs/waku/waku-reliable-message-delivery/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Add the Buffer polyfill (still required by many crypto libraries) and wrap your tree with `OpChanProvider`. The provider internally wires Wagmi, React Query, and the OpChan client to the Waku relay layer. Configure it with the content topic you want to publish under plus the reliable channel id you use for the [Waku Reliable Message Channel](https://specs.vac.dev/specs/waku/waku-reliable-message-delivery/). | |
| Add the Buffer polyfill (still required by many crypto libraries) and wrap your tree with `OpChanProvider`. The provider internally wires Wagmi, React Query, and the OpChan client to the Waku relay layer. Configure it with the content topic you want to publish under plus the reliable channel id you use for the [Reliable Channel](/build/javascript/reliable-channels). |
Point to reliable channel docs which are simpler, instead of specs.
| contentTopic: '/opchan/1/messages/proto', | ||
| reliableChannelId: 'opchan-messages', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment that by using this value, they will get the data from the deployed https://opchan.app/ instance; they should change both values if they want different their own data silo.
| contentTopic: '/opchan/1/messages/proto', | ||
| reliableChannelId: 'opchan-messages', | ||
| }, | ||
| reownProjectId: import.meta.env.VITE_REOWN_PROJECT_ID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it clarified how this value is passed later?
| | Hook | Purpose | Typical actions | | ||
| | --- | --- | --- | | ||
| | `useAuth()` | Manage sessions, ENS verification, call signs, and delegation | `connect()`, `startAnonymous()`, `delegate('7days')`, `updateProfile()` | | ||
| | `useContent()` | Read/write cells, posts, comments, votes, bookmarks | `createPost()`, `vote()`, `moderate.post()`, `pending.isPending(id)` | | ||
| | `usePermissions()` | Query derived capabilities and friendly denial reasons | `canCreateCell`, `canModerate(cellId)`, `check('canPost')` | | ||
| | `useNetwork()` | Reflect Waku connection status and hydration lifecycle | `isConnected`, `statusMessage`, `refresh()` | | ||
| | `useUserDisplay(address)` | Resolve ENS + call-sign metadata for any address | `displayName`, `ensAvatar`, `verificationStatus` | | ||
| | `useUIState(key, defaultValue, category?)` | Persist UI state to IndexedDB | `[value, setValue]` pair scoped by key | | ||
| | `useEthereumWallet()` / `useClient()` | Advanced access to Wagmi connectors or the raw `OpChanClient` | `signMessage()`, direct database interactions | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you format the table in MD so it's easier to review?
No description provided.