diff --git a/docs/guides/getting-started.md b/docs/guides/getting-started.md index 13980a8..b7c1677 100644 --- a/docs/guides/getting-started.md +++ b/docs/guides/getting-started.md @@ -43,7 +43,7 @@ Waku provides integrations tailored for mobile applications, enabling Waku to ru | | Description | Documentation | | - | - | - | -| [REST API](https://waku-org.github.io/waku-rest-api/) | REST API interface provided by `nwaku` and `go-waku` to interact with the Waku Network | [Waku Node REST API Spec](https://waku-org.github.io/waku-rest-api/) | +| [REST API](https://waku-org.github.io/waku-rest-api/) | REST API interface provided by `nwaku` and `go-waku` to interact with the Waku Network | [Waku Node REST API Reference](https://waku-org.github.io/waku-rest-api/) | | [@waku/react](https://www.npmjs.com/package/@waku/react) | React components and UI adapters designed for seamless integration with `@waku/sdk` | [Build React DApps Using @waku/react](/guides/js-waku/use-waku-react) | | [@waku/create-app](https://www.npmjs.com/package/@waku/create-app) | Starter kit to bootstrap your next `@waku/sdk` project from various example templates | [Scaffold DApps Using @waku/create-app](/guides/js-waku/use-waku-create-app) | | [nwaku-compose](https://github.com/waku-org/nwaku-compose) | Pre-configured Docker Compose setup for running and monitoring a `nwaku` node using Prometheus and Grafana | [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) | \ No newline at end of file diff --git a/docs/guides/js-waku/configure-discovery.md b/docs/guides/js-waku/configure-discovery.md index 1d8b683..684bf45 100644 --- a/docs/guides/js-waku/configure-discovery.md +++ b/docs/guides/js-waku/configure-discovery.md @@ -5,6 +5,10 @@ hide_table_of_contents: true This guide provides detailed steps to bootstrap your your node using [Static Peers](/learn/concepts/static-peers) and discover peers in the Waku Network using [DNS Discovery](/learn/concepts/dns-discovery). +:::info +If you do not set up a bootstrap node or discovery mechanism, your node will not connect to any remote peer. +::: + :::tip Until [node incentivisation](/learn/research#prevention-of-denial-of-service-dos-and-node-incentivisation) is in place, you should [operate extra nodes](/#run-a-waku-node) alongside the ones provided by the Waku Network. When running a node, we recommend using the [DNS Discovery and Static Peers](#configure-dns-discovery-and-static-peers) configuration to connect to both the Waku Network and your node. ::: @@ -189,6 +193,16 @@ const node = await createLightNode({ }); ``` -:::info -If you do not set up a bootstrap node or discovery mechanism, your node will not connect to any remote peer. -::: \ No newline at end of file +## Retrieving connected peers + +You can retrieve the array of peers connected to a node using the `libp2p.getPeers()` function within the `@waku/sdk` package: + +```js +import { createLightNode, waitForRemotePeer } from "@waku/sdk"; + +const node = await createLightNode({ defaultBootstrap: true }); +await waitForRemotePeer(node); + +// Retrieve array of peers connected to the node +console.log(node.libp2p.getPeers()); +``` \ No newline at end of file diff --git a/docs/guides/js-waku/index.md b/docs/guides/js-waku/index.md index 47f71d5..13ac228 100644 --- a/docs/guides/js-waku/index.md +++ b/docs/guides/js-waku/index.md @@ -3,6 +3,10 @@ title: JavaScript Waku SDK hide_table_of_contents: true --- +:::caution +Currently, the JavaScript Waku SDK (`@waku/sdk`) is **NOT compatible** with React Native. We plan to add support for React Native in the future. +::: + The [JavaScript Waku SDK](https://github.com/waku-org/js-waku) (`@waku/sdk`) provides a TypeScript implementation of the [Waku protocol](/) designed for web browser environments. Developers can seamlessly integrate Waku functionalities into web applications, enabling efficient communication and collaboration among users using the `@waku/sdk` package. ## Installation diff --git a/docs/guides/js-waku/use-waku-react.md b/docs/guides/js-waku/use-waku-react.md index b8f7ff4..d8c6bc7 100644 --- a/docs/guides/js-waku/use-waku-react.md +++ b/docs/guides/js-waku/use-waku-react.md @@ -3,6 +3,10 @@ title: "Build React DApps Using @waku/react" hide_table_of_contents: true --- +:::caution +Currently, the JavaScript Waku SDK (`@waku/sdk`) is **NOT compatible** with React Native. We plan to add support for React Native in the future. +::: + The [@waku/react](https://www.npmjs.com/package/@waku/react) package provides components and UI adapters to integrate `@waku/sdk` into React applications effortlessly. This guide provides detailed steps for using `@waku/react` in your project. ## Install the dependencies diff --git a/docs/guides/nwaku/configure-nwaku.md b/docs/guides/nwaku/configure-nwaku.md index 20ea802..e7b51c7 100644 --- a/docs/guides/nwaku/configure-nwaku.md +++ b/docs/guides/nwaku/configure-nwaku.md @@ -34,6 +34,10 @@ Browser nodes can only connect to nodes with a domain name and secure WebSocket This example describes configuring a domain name that resolves to your node's IP address and is unrelated to [DNS Discovery](/learn/concepts/dns-discovery). ::: +:::tip +You can use the domain name provided by your cloud provider to configure the domain name for your node. +::: + ## Configure store protocol and message store To enable message caching and serve them to network peers, enable the [Store protocol](/learn/concepts/protocols#store) using the following configuration options: diff --git a/docs/guides/nwaku/run-node.md b/docs/guides/nwaku/run-node.md index cbcf381..cfa33fa 100644 --- a/docs/guides/nwaku/run-node.md +++ b/docs/guides/nwaku/run-node.md @@ -50,7 +50,7 @@ Once you have gotten the `nwaku` binary, run it using the [default configuration ``` :::tip -To learn how to customise the configuration of a `nwaku` node, have a look at the [Node Configuration Methods](/guides/nwaku/config-methods) and [Node Configuration Options](/guides/nwaku/config-options) guides. +To learn how to customise the configuration of a `nwaku` node, have a look at the [Node Configuration Methods](/guides/nwaku/config-methods) and [Node Configuration Examples](/guides/nwaku/configure-nwaku) guides. ::: ## Bootstrap the node @@ -104,6 +104,10 @@ curl --location 'http://127.0.0.1:8645/debug/v1/info' \ The `listenAddresses` field stores the node's listening addresses, while the `enrUri` field stores the discoverable `ENR` URI for peer discovery. ::: +:::tip +We suggest [configuring WebSocket transport](/guides/nwaku/configure-nwaku#configure-websocket-transport) for your node to enable support and serving of browser peers using [@waku/sdk](/guides/js-waku/). +::: + ## Find the node addresses You can find the addresses of a running node through its logs or by calling the [Get node info](https://waku-org.github.io/waku-rest-api/#get-/debug/v1/info) endpoint of the [REST API](https://waku-org.github.io/waku-rest-api/). diff --git a/docs/learn/waku-network.md b/docs/learn/waku-network.md index bd4320f..44d120a 100644 --- a/docs/learn/waku-network.md +++ b/docs/learn/waku-network.md @@ -4,7 +4,7 @@ hide_table_of_contents: true --- :::info -The public Waku Network replaces the previous experimental shared routing layer based on a default pubsub topic (`/waku/2/default-waku/proto`). If your project currently uses this or any other shared pubsub topics, we encourage you to migrate to the public Waku Network with built-in DoS protection, better scalability, etc. +The public Waku Network replaces the previous experimental shared routing layer based on a default pubsub topic (`/waku/2/default-waku/proto`). If your project currently uses this or any other shared pubsub topics, we encourage you to migrate to the public Waku Network with built-in DoS protection, with built-in DoS protection, scalability and reasonable bandwidth usage. ::: The Waku Network is a shared p2p messaging network that is open-access, useful for generalized messaging, privacy-preserving, scalable and accessible even to resource-restricted devices. Some of the most prominent features include: diff --git a/docusaurus.config.js b/docusaurus.config.js index e7b1650..41963d8 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -51,6 +51,10 @@ const config = { ], ], themeConfig: { + colorMode: { + disableSwitch: false, + respectPrefersColorScheme: true, + }, docs: { sidebar: { hideable: false, @@ -159,11 +163,6 @@ const config = { }, ], }, - colorMode: { - defaultMode: "dark", - disableSwitch: false, - respectPrefersColorScheme: false, - }, }, markdown: { mermaid: true, diff --git a/package.json b/package.json index da97799..b59c7e3 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "@acid-info/docusaurus-fathom": "^1.0.0-alpha.111", - "@acid-info/logos-docusaurus-preset": "^1.0.0-alpha.119", + "@acid-info/logos-docusaurus-preset": "^1.0.0-alpha.122", "@docusaurus/core": "^2.4.1", "@docusaurus/preset-classic": "^2.4.1", "@docusaurus/theme-mermaid": "^2.4.1", diff --git a/sidebars.js b/sidebars.js index addce68..13a1b65 100644 --- a/sidebars.js +++ b/sidebars.js @@ -19,6 +19,10 @@ const sidebars = { "guides/nwaku/configure-nwaku", "guides/nwaku/config-methods", "guides/nwaku/config-options", + { + type: 'html', + value: 'REST API Reference', + }, ] }, { diff --git a/yarn.lock b/yarn.lock index a093b65..7693788 100644 --- a/yarn.lock +++ b/yarn.lock @@ -36,14 +36,14 @@ satori "^0.10.1" sharp "^0.32.1" -"@acid-info/logos-docusaurus-preset@^1.0.0-alpha.119": - version "1.0.0-alpha.119" - resolved "https://registry.yarnpkg.com/@acid-info/logos-docusaurus-preset/-/logos-docusaurus-preset-1.0.0-alpha.119.tgz#877fffb3d662a082a412836c2e99b90b68b07626" - integrity sha512-rN7OlyYGCGVphm7+ivtaQdDQVw9CppPnAzLUfJLSub878gbD2N1rSzbhwLXCQKc7yP7gsmyuMbq4nEFgTOQihA== +"@acid-info/logos-docusaurus-preset@^1.0.0-alpha.122": + version "1.0.0-alpha.122" + resolved "https://registry.yarnpkg.com/@acid-info/logos-docusaurus-preset/-/logos-docusaurus-preset-1.0.0-alpha.122.tgz#17413393d9c7a77db5faf4b9333a8760446feebc" + integrity sha512-evBg2XFiU8/F8B78mIA/Ii1oP0zSKZ2qn1eMgx+4t8fyDr0w8VyqCBSInWmWjYkkzOrAEQWDrL0ZxNp/Ct47KA== dependencies: "@acid-info/docusaurus-og" "^1.0.0-alpha.111" "@acid-info/logos-docusaurus-search-local" "^1.0.0-alpha.111" - "@acid-info/logos-docusaurus-theme" "^1.0.0-alpha.119" + "@acid-info/logos-docusaurus-theme" "^1.0.0-alpha.122" "@docusaurus/core" "^2.4.1" "@docusaurus/module-type-aliases" "^2.4.1" "@docusaurus/preset-classic" "^2.4.1" @@ -71,10 +71,10 @@ "@easyops-cn/docusaurus-search-local" "^0.33.6" lodash "^4.17.21" -"@acid-info/logos-docusaurus-theme@^1.0.0-alpha.119": - version "1.0.0-alpha.119" - resolved "https://registry.yarnpkg.com/@acid-info/logos-docusaurus-theme/-/logos-docusaurus-theme-1.0.0-alpha.119.tgz#6c911305979eae077ef29747a0542a8f63df663d" - integrity sha512-hlQwQWtPvJOnauhhOgdMT75oR0ZjftEU36LTnz15bg23ciINflEHaMSUrOzWEYjTMydPlg0rD4bQZ4Ifimk+IQ== +"@acid-info/logos-docusaurus-theme@^1.0.0-alpha.122": + version "1.0.0-alpha.122" + resolved "https://registry.yarnpkg.com/@acid-info/logos-docusaurus-theme/-/logos-docusaurus-theme-1.0.0-alpha.122.tgz#4da98bf673acb11ebcaad685d8b1cab5f634b26f" + integrity sha512-0GKEb94cObPzgfuH21X7MNro7j/zSisI+/7710VMOyidoI9W2OSfe7KwCuIQbW7Y9N+oyw+2YLYKu69RfiLbZg== dependencies: "@acid-info/docusaurus-og" "^1.0.0-alpha.111" "@acid-info/lsd-react" "^0.1.0-alpha.21"