Skip to content

Commit

Permalink
test: defaults light client to v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
homura committed Nov 7, 2023
1 parent b6f6a00 commit 1c33153
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 27 deletions.
51 changes: 25 additions & 26 deletions packages/e2e-test/scripts/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { join } from "node:path";
import { mkdirSync, rmSync } from "node:fs";
import { retry } from "@ckb-lumos/utils";
import { RPC } from "@ckb-lumos/rpc";
// import { LightClientRPC } from "@ckb-lumos/light-client";
import { LightClientRPC } from "@ckb-lumos/light-client";
import killPort from "kill-port";
import {
ckb,
Expand All @@ -15,7 +15,7 @@ import {
CKB_RPC_PORT,
CKB_RPC_URL,
LIGHT_CLIENT_RPC_PORT,
// LIGHT_CLIENT_RPC_URL,
LIGHT_CLIENT_RPC_URL,
} from "../src/constants";

const MODULE_PATH = join(__dirname, "..");
Expand Down Expand Up @@ -103,36 +103,35 @@ async function main() {
});

// TODO uncomment me when the light client is available for CKB2023
// const lightClientProcess = spawn(
// lightClientBinaryPath,
// ["run", "--config-file", join(LIGHT_CLIENT_CWD, "light-client.toml")],
// {
// stdio: "inherit",
// cwd: LIGHT_CLIENT_CWD,
// env: {
// RUST_LOG: "info",
// ckb_light_client: "info",
// },
// }
// );

// const lightClientRpc = new LightClientRPC(LIGHT_CLIENT_RPC_URL);
// const lightClientTip = await retry(() => lightClientRpc.getTipHeader(), {
// retries: 30,
// timeout: 30_000,
// delay: 100,
// });

// console.info("Light Client started, tip header:", lightClientTip);
const lightClientProcess = spawn(
lightClientBinaryPath,
["run", "--config-file", join(LIGHT_CLIENT_CWD, "light-client.toml")],
{
stdio: "inherit",
cwd: LIGHT_CLIENT_CWD,
env: {
RUST_LOG: "info",
ckb_light_client: "info",
},
}
);

const lightClientRpc = new LightClientRPC(LIGHT_CLIENT_RPC_URL);
const lightClientTip = await retry(() => lightClientRpc.getTipHeader(), {
retries: 30,
timeout: 30_000,
delay: 100,
});

console.info("Light Client started, tip header:", lightClientTip);

// TODO uncomment me when the light client is available for CKB2023
// execSync("npx ava '**/*.e2e.test.ts' --verbose --timeout=5m", {
execSync("npx ava '**/{rpc,indexer}.e2e.test.ts' --verbose --timeout=5m", {
execSync("npx ava '**/*.e2e.test.ts' --verbose --timeout=5m", {
cwd: pathTo("/"),
stdio: "inherit",
});

// lightClientProcess.kill();
lightClientProcess.kill();
ckbMinerProcess.kill();
ckbProcess.kill();

Expand Down
2 changes: 1 addition & 1 deletion packages/runner/src/light-client/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Options {
* @param options
*/
export function getReleaseUrl(options: Options = {}): string {
const { version = "v0.2.4", platform = os.platform() } = options;
const { version = "v0.3.0", platform = os.platform() } = options;

const compiledArch: string = (() => "x86_64")();

Expand Down

1 comment on commit 1c33153

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 New canary release: 0.0.0-ckb2023-1c33153-20231107083958

npm install @ckb-lumos/[email protected]

Please sign in to comment.