Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,20 @@
"IPFS",
"cheatsheet",
"hacken",
"statusteam"
"statusteam",
"pubkey",
"multiaddresses",
"peerstore",
"addrs",
"cred",
"Kadmelia",
"storev",
"unsubs",
"Linea",
"upnp",
"dnsaddr",
"multiaddress",
"Kademlia's"
],
"flagWords": [],
"ignorePaths": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Debug Your Waku DApp and WebSocket
hide_table_of_contents: true
displayed_sidebar: build
---

This guide provides detailed steps to enable and use debug logs to troubleshoot your Waku DApp, whether in a NodeJS or browser environment and check your WebSocket connections in [nwaku](/guides/nwaku/run-node).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: JavaScript SDK FAQ
hide_table_of_contents: true
sidebar_label: Frequently Asked Questions
displayed_sidebar: build
---

import { AccordionItem } from '@site/src/components/mdx'
Expand Down
11 changes: 10 additions & 1 deletion docs/guides/js-waku/index.md → docs/build/javascript/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: JavaScript Waku SDK
title: JavaScript
hide_table_of_contents: true
displayed_sidebar: build
---

:::caution
Expand All @@ -9,6 +10,14 @@ Currently, the JavaScript Waku SDK (`@waku/sdk`) is **NOT compatible** with Reac

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.

## Video Tutorials

<div class="video-container">
<iframe class="yt-video two-items" src="https://www.youtube.com/embed/PYQaXCxUCwA" title="Waku Tutorial 001: Introduction to Waku" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

<iframe class="yt-video two-items" src="https://www.youtube.com/embed/sfmMcrbiX0c" title="Build a game using Waku Protocol" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>

## Installation

Install the `@waku/sdk` package using your preferred package manager:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Send and Receive Messages Using Light Push and Filter
hide_table_of_contents: true
displayed_sidebar: build
---

This guide provides detailed steps to start using the `@waku/sdk` package by setting up a [Light Node](/learn/glossary#light-node) to send messages using the [Light Push protocol](/learn/concepts/protocols#light-push), and receive messages using the [Filter protocol](/learn/concepts/protocols#filter). Have a look at the [installation guide](/guides/js-waku/#installation) for steps on adding `@waku/sdk` to your project.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Manage Your Filter Subscriptions
hide_table_of_contents: true
displayed_sidebar: build
---

This guide provides detailed steps to manage [Filter](/learn/concepts/protocols#filter) subscriptions and handle node disconnections in your application. Have a look at the [Send and Receive Messages Using Light Push and Filter](/guides/js-waku/light-send-receive) guide for using the `Light Push` and `Filter` protocols.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Send and Receive Messages in a Reliable Channel
hide_table_of_contents: true
displayed_sidebar: build
---

Learn how to send and receive messages with a convenient SDK that provide various reliable functionalities out-of-the-box.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Run @waku/sdk in a NodeJS Application"
hide_table_of_contents: true
displayed_sidebar: build
---

While the `@waku/sdk` package is primarily designed for browser environments, you can use it in a NodeJS application. However, there are certain limitations and considerations to keep in mind. This guide provides a comprehensive overview of using `@waku/sdk` in NodeJS.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Retrieve Messages Using Store Protocol
hide_table_of_contents: true
displayed_sidebar: build
---

This guide provides detailed steps to create a Light Node for retrieving and filtering historical messages using the [Store protocol](/learn/concepts/protocols#store).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Scaffold DApps Using @waku/create-app"
hide_table_of_contents: true
displayed_sidebar: build
---

This guide provides detailed steps to bootstrap your next `@waku/sdk` project from [various example templates](https://github.com/waku-org/js-waku-examples/tree/master/examples) using the [@waku/create-app](https://www.npmjs.com/package/@waku/create-app) package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Build React DApps Using @waku/react"
hide_table_of_contents: true
displayed_sidebar: build
---

:::caution
Expand Down
163 changes: 163 additions & 0 deletions docs/build/nim/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
title: Nim
hide_table_of_contents: true
displayed_sidebar: build
---

Nwaku provides a native Nim implementation of the Waku protocol, allowing developers to build Waku native applications directly in Nim.
This guide demonstrates how to use the Waku library API to create and configure Waku nodes.

## Installation

To use the Waku Nim SDK, you'll need to:

1. Install [Nim](https://nim-lang.org/install.html) (version 2.2.4 or higher)
2. Add the nwaku library to your project

:::warning
Waku does not currently work with Nimble package manager. You can track progress on Nimble support in [PR #3564](https://github.com/waku-org/nwaku/pull/3564).
:::

```bash
# Install nwaku as a dependency
nimble install waku
```

## Creating a Waku Node

Waku uses blockchain smart contract to DoS protect nodes in the network.
The protocol is called [RLN relay](/learn/concepts/protocols#rln-relay).

To connect to the Waku Network, you'll need a Linea Sepolia RPC endpoint.

Let's create a simple CLI that takes an RPC URL as argument:

`your_waku_app.nim`
```nim
import std/options
import chronos, results, confutils, confutils/defs
import waku

type CliArgs = object
ethRpcEndpoint* {.
defaultValue: "",
desc: "ETH RPC Endpoint for RLN support"
.}: string

when isMainModule:
let args = CliArgs.load()

if args.ethRpcEndpoint == "":
echo "Please provide a Linea Sepolia RPC endpoint to connect to the Waku Network"
quit(QuitFailure)

echo "Starting Waku node with RLN..."

# Create configuration with RLN enabled
let config = NodeConfig.init(
ethRpcEndpoints = @[args.ethRpcEndpoint]
)

# Create the node
let node = (waitFor createNode(config)).valueOr:
echo "Failed to create node: ", error
quit(QuitFailure)

echo "Waku node created successfully!"

# Start the node
(waitFor startWaku(addr node)).isOkOr:
echo "Failed to start node: ", error
quit(QuitFailure)

echo "Node started successfully with RLN enabled!"
runForever()
```

### Running the CLI

To run your CLI:

```bash
nim c -r your_waku_app.nim --ethRpcEndpoint="https://linea-sepolia.infura.io/v3/some-api-key"
```

## Blockchain-less Development Mode

For development and testing purposes, you can create a Waku node without blockchain integration.
This mode wil not have DoS protection but allows you to experiment with the Waku protocol without needing an RPC endpoint.

`your_waku_app.nim`
```nim
import std/options
import chronos, results
import waku

when isMainModule:
echo "Starting Waku node in development mode..."

# Create a basic configuration without RLN
let config = NodeConfig.init(
wakuConfig = WakuConfig.init(
entryNodes = @[], # Add ENRs of bootstrap nodes if needed
clusterId = 42 # Use a custom cluster ID for your test network
)
)

# Create the node
let node = (waitFor createNode(config)).valueOr:
echo "Failed to create node: ", error
quit(QuitFailure)

echo "Waku node created successfully!"

# Start the node
(waitFor startWaku(addr node)).isOkOr:
echo "Failed to start node: ", error
quit(QuitFailure)

echo "Node started in development mode!"
runForever()
```

### Running in Development Mode

```bash
nim c -r your_waku_app.nimyour_waku_app.nim
```

## Configuration Options

### With Custom Bootstrap Nodes

You can specify bootstrap nodes to connect to specific networks:

```nim
let config = NodeConfig.init(
wakuConfig = WakuConfig.init(
entryNodes = @[
"enr:-P-4QG_d...", # Replace with actual ENR
"/ip5/1.2..." # Replace with actual multiaddr
],
clusterId = 42
)
)
```

## API Status

:::info
The Waku Nim library API is under active development. Currently, node creation and configuration are supported. Additional API verbs for message handling, subscriptions, and protocol interactions are work in progress.
:::

## Examples and Resources

- [nwaku examples](https://github.com/waku-org/nwaku/tree/master/examples) - Official examples repository
- [waku_api.nim](https://github.com/waku-org/nwaku/blob/master/examples/waku_api.nim) - Library API example
- [nwaku repo](https://github.com/waku-org/nwaku) - nwaku GitHub Repository

## Get Help

- Visit the #help-desk channel on [Discord](https://discord.waku.org/)
- Check the [nwaku GitHub repository](https://github.com/waku-org/nwaku) for issues and updates
- Review the [protocol documentation](/learn/concepts/protocols) to understand Waku's capabilities
93 changes: 0 additions & 93 deletions docs/guides/getting-started.md

This file was deleted.

Loading
Loading