Merge pull request #1402 from waku-org/chores/nwaku-v0.18.0

This commit is contained in:
fryorcraken.eth 2023-07-04 15:59:27 +10:00 committed by GitHub
commit 86c2e9e014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 30 deletions

View File

@ -57,7 +57,7 @@ jobs:
node:
runs-on: ubuntu-latest
env:
WAKUNODE_IMAGE: "statusteam/nim-waku:v0.17.0"
WAKUNODE_IMAGE: "statusteam/nim-waku:v0.18.0"
steps:
- uses: actions/checkout@v3

View File

@ -14,7 +14,7 @@ export interface Args {
peerExchange?: boolean;
discv5Discovery?: boolean;
storeMessageDbUrl?: string;
topics?: string;
topic?: string;
rpcPrivate?: boolean;
websocketSupport?: boolean;
tcpPort?: number;

View File

@ -27,7 +27,7 @@ const WAKU_SERVICE_NODE_PARAMS =
const NODE_READY_LOG_LINE = "Node setup complete";
const DOCKER_IMAGE_NAME =
process.env.WAKUNODE_IMAGE || "statusteam/nim-waku:v0.17.0";
process.env.WAKUNODE_IMAGE || "statusteam/nim-waku:v0.18.0";
const isGoWaku = DOCKER_IMAGE_NAME.includes("go-waku");

View File

@ -4,7 +4,7 @@ import { promisify } from "util";
const execAsync = promisify(exec);
const WAKUNODE_IMAGE =
process.env.WAKUNODE_IMAGE || "statusteam/nim-waku:v0.17.0";
process.env.WAKUNODE_IMAGE || "statusteam/nim-waku:v0.18.0";
async function main() {
try {

View File

@ -23,34 +23,36 @@ const TestEncoder = createEncoder({
contentTopic: TestContentTopic,
});
describe("Waku Light Push [node only]", () => {
let waku: LightNode;
let nwaku: NimGoNode;
const runNodes = async (
async function runNodes(
context: Mocha.Context,
pubSubTopic?: string
): Promise<void> => {
const nwakuOptional = pubSubTopic ? { topics: pubSubTopic } : {};
nwaku = new NimGoNode(makeLogFileName(context));
): Promise<[NimGoNode, LightNode]> {
const nwakuOptional = pubSubTopic ? { topic: pubSubTopic } : {};
const nwaku = new NimGoNode(makeLogFileName(context));
await nwaku.start({
lightpush: true,
relay: true,
...nwakuOptional,
});
waku = await createLightNode({
const waku = await createLightNode({
pubSubTopic,
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.LightPush]);
};
return [nwaku, waku];
}
describe("Waku Light Push [node only]", () => {
let waku: LightNode;
let nwaku: NimGoNode;
beforeEach(async function () {
this.timeout(15_000);
await runNodes(this);
[nwaku, waku] = await runNodes(this);
});
afterEach(async function () {
@ -108,12 +110,29 @@ describe("Waku Light Push [node only]", () => {
expect(pushResponse.recipients.length).to.eq(0);
expect(pushResponse.error).to.eq(SendError.SIZE_TOO_BIG);
});
});
it("Push on custom pubsub topic", async function () {
this.timeout(15_000);
describe("Waku Light Push [node only] - custom pubsub topic", () => {
let waku: LightNode;
let nwaku: NimGoNode;
const customPubSubTopic = "/waku/2/custom-dapp/proto";
await runNodes(this, customPubSubTopic);
beforeEach(async function () {
this.timeout(15_000);
[nwaku, waku] = await runNodes(this, customPubSubTopic);
});
afterEach(async function () {
try {
nwaku?.stop();
waku?.stop();
} catch (e) {
console.error("Failed to stop nodes: ", e);
}
});
it("Push message", async function () {
this.timeout(15_000);
const nimPeerId = await nwaku.getPeerId();
const messageText = "Light Push works!";

View File

@ -575,7 +575,7 @@ describe("Waku Store, custom pubsub topic", () => {
nwaku = new NimGoNode(makeLogFileName(this));
await nwaku.start({
store: true,
topics: customPubSubTopic,
topic: customPubSubTopic,
relay: true,
});
});