Skip to content

Commit 1572d6c

Browse files
authored
Upgrade docusaurus and preset version (#244)
* feat: upgrade docusaurus and preset version * feat: add node fetch-content.js to build script
1 parent 1bebfcb commit 1572d6c

17 files changed

+7272
-5626
lines changed

.cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"IPFS",
8484
"cheatsheet",
8585
"hacken",
86-
"statusteam",
86+
"statusteam"
8787
],
8888
"flagWords": [],
8989
"ignorePaths": [

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Waku Documentation Portal](https://img.shields.io/badge/docs.waku.org-black)](https://docs.waku.org/)
44

5-
The Waku Documentation Portal can be accessed at <https://docs.waku.org/> and was built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
5+
The Waku Documentation Portal can be accessed at [https://docs.waku.org/](https://docs.waku.org/) and was built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
66

77
## Prerequisites
88

@@ -88,8 +88,8 @@ yarn clear
8888

8989
## CI/CD
9090

91-
- [CI builds](https://ci.infra.status.im/job/website/job/docs.waku.org/) `master` and pushes to `deploy-master` branch, which is hosted at <https://docs.waku.org/>.
92-
- [CI builds](https://ci.infra.status.im/job/website/job/dev-docs.waku.org/) `develop` and pushes to `deploy-develop` branch, which is hosted at <https://dev-docs.waku.org/>.
91+
- [CI builds](https://ci.infra.status.im/job/website/job/docs.waku.org/) `master` and pushes to `deploy-master` branch, which is hosted at [https://docs.waku.org/](https://docs.waku.org/).
92+
- [CI builds](https://ci.infra.status.im/job/website/job/dev-docs.waku.org/) `develop` and pushes to `deploy-develop` branch, which is hosted at [https://dev-docs.waku.org/](https://dev-docs.waku.org/).
9393

9494
The hosting is done using [Caddy server with Git plugin for handling GitHub webhooks](https://github.com/status-im/infra-misc/blob/master/ansible/roles/caddy-git).
9595

@@ -101,4 +101,3 @@ Information about deployed build can be also found in `/build.json` available on
101101
2. Make your changes, push them to the origin, and open a Pull Request against the develop branch.
102102
3. After approval, merge the pull request, and verify the changes on the staging server (e.g., https://dev.vac.dev).
103103
4. When ready to promote changes to the live website, rebase the master branch on the staging changes: git checkout master; git pull origin master; git rebase origin/develop; git push.
104-

docs/guides/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Check out our [Learn section](/learn/waku-network), [YouTube channel](https://ww
4242
8. **Social Media Platforms**: Beyond chat messengers, use Waku for decentralised, censorship-resistant social media platforms like news feeds and multimedia sharing.
4343

4444
:::tip
45-
Looking for what to build with Waku? Discover a collection of sample ideas and use cases for inspiration, curated by our community at: https://ideas.waku.org/ and [Awesome Waku](https://github.com/waku-org/awesome-waku/).
45+
Looking for what to build with Waku? Discover a collection of sample ideas and use cases for inspiration, curated by our community at: [https://ideas.waku.org/](https://ideas.waku.org/) and [Awesome Waku](https://github.com/waku-org/awesome-waku/).
4646
:::
4747

4848
## Case studies
@@ -89,5 +89,5 @@ Waku is implemented in multiple SDKs, allowing it to integrate with different la
8989
| [@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) |
9090

9191
:::tip
92-
Explore some example apps built using Waku at https://examples.waku.org/ and view a list of projects and workshops from previous hackathons at [Awesome Waku](https://github.com/waku-org/awesome-waku/).
92+
Explore some example apps built using Waku at [https://examples.waku.org/](https://examples.waku.org/) and view a list of projects and workshops from previous hackathons at [Awesome Waku](https://github.com/waku-org/awesome-waku/).
9393
:::

docs/guides/js-waku/configure-discovery.md renamed to docs/guides/js-waku/configure-discovery.mdx

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ title: Bootstrap Nodes and Discover Peers
33
hide_table_of_contents: true
44
---
55

6+
import Tabs from '@theme/Tabs';
7+
import TabItem from '@theme/TabItem';
8+
69
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).
710

811
:::info
@@ -33,7 +36,7 @@ import { createLightNode } from "@waku/sdk";
3336

3437
// Bootstrap node using static peers
3538
const node = await createLightNode({
36-
bootstrapPeers: ["[PEER MULTIADDR]"],
39+
bootstrapPeers: ["[PEER MULTIADDR]"],
3740
});
3841
```
3942

@@ -42,26 +45,25 @@ For example, consider a node that connects to two static peers on the same local
4245
```js
4346
// Define the list of static peers to bootstrap
4447
const peers = [
45-
"/ip4/0.0.0.0/tcp/60002/ws/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H",
46-
"/ip4/0.0.0.0/tcp/60003/ws/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ",
48+
"/ip4/0.0.0.0/tcp/60002/ws/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H",
49+
"/ip4/0.0.0.0/tcp/60003/ws/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ",
4750
];
4851

4952
// Bootstrap node using the static peers
5053
const node = await createLightNode({
51-
bootstrapPeers: peers,
54+
bootstrapPeers: peers,
5255
});
5356
```
5457

55-
Alternatively, you can dial a particular node like this:
58+
Alternatively, you can dial a particular node like this:
5659

5760
```js
5861
// Define the list of static peers to bootstrap
5962
const peers = [
60-
"/ip4/0.0.0.0/tcp/60002/ws/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H",
61-
"/ip4/0.0.0.0/tcp/60003/ws/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ",
63+
"/ip4/0.0.0.0/tcp/60002/ws/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H",
64+
"/ip4/0.0.0.0/tcp/60003/ws/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ",
6265
];
6366

64-
6567
const node = await createLightNode();
6668

6769
// In case nodes are using IP address and / or `ws` protocol - additional configuration is needed:
@@ -73,7 +75,7 @@ const node = await createLightNode({
7375
});
7476
*/
7577

76-
const promises = peers.map(multiaddr => node.dial(multiaddr));
78+
const promises = peers.map((multiaddr) => node.dial(multiaddr));
7779

7880
await Promise.all(promises);
7981
```
@@ -114,21 +116,16 @@ const enrTree = "enrtree://[PUBLIC KEY]@[DOMAIN NAME]";
114116

115117
// Define node requirements
116118
const NODE_REQUIREMENTS = {
117-
store: 3,
118-
lightPush: 3,
119-
filter: 3,
119+
store: 3,
120+
lightPush: 3,
121+
filter: 3,
120122
};
121123

122124
// Bootstrap node using DNS Discovery
123125
const node = await createLightNode({
124-
libp2p: {
125-
peerDiscovery: [
126-
wakuDnsDiscovery(
127-
[enrTree],
128-
NODE_REQUIREMENTS,
129-
),
130-
],
131-
},
126+
libp2p: {
127+
peerDiscovery: [wakuDnsDiscovery([enrTree], NODE_REQUIREMENTS)],
128+
},
132129
});
133130
```
134131

@@ -139,14 +136,11 @@ import { enrTree } from "@waku/dns-discovery";
139136

140137
// Bootstrap node using DNS Discovery
141138
const node = await createLightNode({
142-
libp2p: {
143-
peerDiscovery: [
144-
wakuDnsDiscovery(
145-
[enrTree["PROD"], enrTree["TEST"]],
146-
NODE_REQUIREMENTS,
147-
),
148-
],
149-
},
139+
libp2p: {
140+
peerDiscovery: [
141+
wakuDnsDiscovery([enrTree["PROD"], enrTree["TEST"]], NODE_REQUIREMENTS),
142+
],
143+
},
150144
});
151145
```
152146

@@ -161,28 +155,23 @@ import { enrTree, wakuDnsDiscovery } from "@waku/dns-discovery";
161155

162156
// Define the list of static peers to bootstrap
163157
const peers = [
164-
"/ip4/0.0.0.0/tcp/60002/ws/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H",
165-
"/ip4/0.0.0.0/tcp/60003/ws/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ",
158+
"/ip4/0.0.0.0/tcp/60002/ws/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H",
159+
"/ip4/0.0.0.0/tcp/60003/ws/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ",
166160
];
167161

168162
// Define node requirements
169163
const NODE_REQUIREMENTS = {
170-
store: 3,
171-
lightPush: 3,
172-
filter: 3,
164+
store: 3,
165+
lightPush: 3,
166+
filter: 3,
173167
};
174168

175169
// Bootstrap node using DNS Discovery and static peers
176170
const node = await createLightNode({
177-
libp2p: {
178-
bootstrapPeers: peers,
179-
peerDiscovery: [
180-
wakuDnsDiscovery(
181-
[enrTree["PROD"]],
182-
NODE_REQUIREMENTS,
183-
),
184-
],
185-
},
171+
libp2p: {
172+
bootstrapPeers: peers,
173+
peerDiscovery: [wakuDnsDiscovery([enrTree["PROD"]], NODE_REQUIREMENTS)],
174+
},
186175
});
187176
```
188177

@@ -198,4 +187,4 @@ await node.waitForPeers();
198187

199188
// Retrieve array of peers connected to the node
200189
console.log(node.libp2p.getPeers());
201-
```
190+
```

docs/guides/js-waku/message-encryption.md renamed to docs/guides/js-waku/message-encryption.mdx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ import { createEncoder } from "@waku/message-encryption/symmetric";
5353

5454
// Create a symmetric message encoder
5555
const encoder = createEncoder({
56-
contentTopic: contentTopic, // message content topic
57-
symKey: symmetricKey, // symmetric key for encrypting messages
56+
contentTopic: contentTopic, // message content topic
57+
symKey: symmetricKey, // symmetric key for encrypting messages
5858
});
5959

6060
// Send the message using Light Push
@@ -101,8 +101,8 @@ import { createEncoder } from "@waku/message-encryption/ecies";
101101

102102
// Create an ECIES message encoder
103103
const encoder = createEncoder({
104-
contentTopic: contentTopic, // message content topic
105-
publicKey: publicKey, // ECIES public key for encrypting messages
104+
contentTopic: contentTopic, // message content topic
105+
publicKey: publicKey, // ECIES public key for encrypting messages
106106
});
107107

108108
// Send the message using Light Push
@@ -151,16 +151,16 @@ const alicePublicKey = getPublicKey(alicePrivateKey);
151151

152152
// Create a symmetric encoder that signs messages
153153
const symmetricEncoder = createSymmetricEncoder({
154-
contentTopic: contentTopic, // message content topic
155-
symKey: symmetricKey, // symmetric key for encrypting messages
156-
sigPrivKey: alicePrivateKey, // private key for signing messages before encryption
154+
contentTopic: contentTopic, // message content topic
155+
symKey: symmetricKey, // symmetric key for encrypting messages
156+
sigPrivKey: alicePrivateKey, // private key for signing messages before encryption
157157
});
158158

159159
// Create an ECIES encoder that signs messages
160160
const ECIESEncoder = createECIESEncoder({
161-
contentTopic: contentTopic, // message content topic
162-
publicKey: publicKey, // ECIES public key for encrypting messages
163-
sigPrivKey: alicePrivateKey, // private key for signing messages before encryption
161+
contentTopic: contentTopic, // message content topic
162+
publicKey: publicKey, // ECIES public key for encrypting messages
163+
sigPrivKey: alicePrivateKey, // private key for signing messages before encryption
164164
});
165165

166166
// Send and receive your messages as usual with Light Push and Filter
@@ -183,25 +183,25 @@ const bobPrivateKey = generatePrivateKey();
183183

184184
// Create an encoder that signs messages
185185
const encoder = createEncoder({
186-
contentTopic: contentTopic,
187-
symKey: symmetricKey,
188-
sigPrivKey: bobPrivateKey,
186+
contentTopic: contentTopic,
187+
symKey: symmetricKey,
188+
sigPrivKey: bobPrivateKey,
189189
});
190190

191191
// Modify the callback function to verify message signature
192192
const callback = (wakuMessage) => {
193-
// Extract the message signature and public key of the signature
194-
// You can compare the signaturePublicKey with Alice public key
195-
const signature = wakuMessage.signature;
196-
const signaturePublicKey = wakuMessage.signaturePublicKey;
197-
198-
// Verify the message was actually signed and sent by Alice
199-
// Alice's public key can be gotten from broadcasting or out-of-band methods
200-
if (wakuMessage.verifySignature(alicePublicKey)) {
201-
console.log("This message was signed by Alice");
202-
} else {
203-
console.log("This message was NOT signed by Alice");
204-
}
193+
// Extract the message signature and public key of the signature
194+
// You can compare the signaturePublicKey with Alice public key
195+
const signature = wakuMessage.signature;
196+
const signaturePublicKey = wakuMessage.signaturePublicKey;
197+
198+
// Verify the message was actually signed and sent by Alice
199+
// Alice's public key can be gotten from broadcasting or out-of-band methods
200+
if (wakuMessage.verifySignature(alicePublicKey)) {
201+
console.log("This message was signed by Alice");
202+
} else {
203+
console.log("This message was NOT signed by Alice");
204+
}
205205
};
206206

207207
await subscription.subscribe([encoder], callback);
@@ -233,4 +233,4 @@ const restoredPrivateKey = hexToBytes(privateKeyHex);
233233
You have successfully encrypted, decrypted, and signed your messages using `Symmetric` and `ECIES` encryption methods. Have a look at the [eth-pm](https://github.com/waku-org/js-waku-examples/tree/master/examples/eth-pm) example for a working demo.
234234
:::
235235

236-
<!-- [flush-notes](https://github.com/waku-org/js-waku-examples/tree/master/examples/flush-notes) and -->
236+
<!-- [flush-notes](https://github.com/waku-org/js-waku-examples/tree/master/examples/flush-notes) and -->

docs/guides/js-waku/run-waku-nodejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ Before using `@waku/sdk` in a NodeJS environment, take into account these limita
3131

3232
## Future developments
3333

34-
There are plans to release a NodeJS package based on [nwaku](/guides/nwaku/run-node) to streamline the process of using Waku Network features in NodeJS applications. You can track the progress and updates here: <https://github.com/waku-org/nwaku/issues/1332>.
34+
There are plans to release a NodeJS package based on [nwaku](/guides/nwaku/run-node) to streamline the process of using Waku Network features in NodeJS applications. You can track the progress and updates here: [https://github.com/waku-org/nwaku/issues/1332](https://github.com/waku-org/nwaku/issues/1332).

docs/guides/js-waku/use-waku-create-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ We welcome and appreciate the contributions of templates for the `@waku/create-a
4949
4. Finally, submit a pull request to the [js-waku-examples](https://github.com/waku-org/js-waku-examples) repository.
5050
5. Our team will carefully review and merge your submission upon approval.
5151

52-
Waku also provides bounties to encourage community members to contribute to the network and earn rewards. To participate in the bounty program, head to <https://github.com/waku-org/bounties>.
52+
Waku also provides bounties to encourage community members to contribute to the network and earn rewards. To participate in the bounty program, head to [https://github.com/waku-org/bounties](https://github.com/waku-org/bounties).

0 commit comments

Comments
 (0)