Skip to content

Commit

Permalink
Separate query and response RPC logs
Browse files Browse the repository at this point in the history
  • Loading branch information
D4nte committed May 27, 2022
1 parent 9fd09fa commit 199d7e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test_utils/nwaku.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import { ChildProcess, spawn } from "child_process";

import appRoot from "app-root-path";
import debug from "debug";
import { Multiaddr, multiaddr } from "multiaddr";
import PeerId from "peer-id";
Expand All @@ -21,8 +20,8 @@ import waitForLine from "./log_file";

const dbg = debug("waku:nwaku");

const NIM_WAKU_DIR = appRoot + "/nim-waku";
const NIM_WAKU_BIN = NIM_WAKU_DIR + "/build/wakunode2";
const NIM_WAKU_DIR = "/home/fryorcraken/src/status-im/go-waku";
const NIM_WAKU_BIN = NIM_WAKU_DIR + "/build/waku";
const NODE_READY_LOG_LINE = "Node setup complete";

const LOG_DIR = "./log";
Expand Down Expand Up @@ -355,6 +354,7 @@ export class Nwaku {
method: string,
params: Array<string | number | unknown>
): Promise<T> {
dbg("RPC Query: ", method, params);
const res = await fetch(this.rpcUrl, {
method: "POST",
body: JSON.stringify({
Expand All @@ -365,8 +365,8 @@ export class Nwaku {
}),
headers: new Headers({ "Content-Type": "application/json" }),
});
dbg(`Response received for ${method} call: `, res, "params: ", params);
const json = await res.json();
dbg(`RPC Response: `, res, json);
return json.result;
}

Expand Down

0 comments on commit 199d7e2

Please sign in to comment.