Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove Forester from light-cli #1229

Merged
merged 1 commit into from
Sep 16, 2024
Merged
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
5 changes: 2 additions & 3 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"topicSeparator": ""
},
"scripts": {
"add-bins": "./scripts/copyLocalProgramBinaries.sh && ./scripts/copyForester.sh && scripts/buildProver.sh",
"add-bins": "./scripts/copyLocalProgramBinaries.sh && scripts/buildProver.sh",
"postinstall": "[ -d ./bin ] && find ./bin -type f -exec chmod +x {} + || echo 'No bin directory found, skipping chmod'",
"build": "shx rm -rf dist && pnpm tsc -p tsconfig.json && pnpm tsc -p tsconfig.test.json && pnpm add-bins",
"format": "pnpm prettier --write \"src/**/*.{ts,js}\" \"test/**/*.{ts,js}\" -w",
Expand Down Expand Up @@ -128,8 +128,7 @@
"inputs": [
"{workspaceRoot}/js",
"{workspaceRoot}/programs",
"{workspaceRoot}/gnark-prover",
"{workspaceRoot}/forester"
"{workspaceRoot}/gnark-prover"
],
"outputs": [
"{workspaceRoot}/bin",
Expand Down
15 changes: 0 additions & 15 deletions cli/scripts/copyForester.sh

This file was deleted.

7 changes: 0 additions & 7 deletions cli/src/commands/test-validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ class SetupCommand extends Command {
"Runs a test validator without starting a new prover service.",
default: false,
}),
"skip-forester": Flags.boolean({
description:
"Runs a test validator without starting a new forester service.",
default: false,
}),
"skip-system-accounts": Flags.boolean({
description:
"Runs a test validator without initialized light system accounts.",
Expand Down Expand Up @@ -95,15 +90,13 @@ class SetupCommand extends Command {

if (flags["stop"] === true) {
await stopTestEnv({
forester: !flags["skip-forester"],
indexer: !flags["skip-indexer"],
prover: !flags["skip-prover"],
});
this.log("\nTest validator stopped successfully \x1b[32m✔\x1b[0m");
} else {
await initTestEnv({
checkPhotonVersion: !flags["relax-indexer-version-constraint"],
forester: !flags["skip-forester"],
indexer: !flags["skip-indexer"],
limitLedgerSize: flags["limit-ledger-size"],
photonDatabaseUrl: flags["indexer-db-url"],
Expand Down
1 change: 0 additions & 1 deletion cli/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const CARGO_GENERATE_TAG = "v0.18.4";
export const SOLANA_VALIDATOR_PROCESS_NAME = "solana-test-validator";
export const LIGHT_PROVER_PROCESS_NAME = "light-prover";
export const INDEXER_PROCESS_NAME = "photon";
export const FORESTER_PROCESS_NAME = "forester";

export const PHOTON_VERSION = "0.45.0";

Expand Down
16 changes: 0 additions & 16 deletions cli/src/utils/initTestEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,14 @@ import {
} from "./process";
import { killProver, startProver } from "./processProverServer";
import { killIndexer, startIndexer } from "./processPhotonIndexer";
import { killForester, startForester } from "./processForester";

export async function stopTestEnv(options: {
forester: boolean;
indexer: boolean;
prover: boolean;
}) {
const processesToKill = [
{ name: "photon", condition: options.indexer, killFunction: killIndexer },
{ name: "prover", condition: options.prover, killFunction: killProver },
{
name: "forester",
condition: options.forester,
killFunction: killForester,
},
{
name: "test-validator",
condition: true,
Expand Down Expand Up @@ -63,7 +56,6 @@ export async function initTestEnv({
skipSystemAccounts,
indexer = true,
prover = true,
forester = true,
rpcPort = 8899,
indexerPort = 8784,
proverPort = 3001,
Expand All @@ -78,7 +70,6 @@ export async function initTestEnv({
skipSystemAccounts?: boolean;
indexer: boolean;
prover: boolean;
forester: boolean;
rpcPort?: number;
indexerPort?: number;
proverPort?: number;
Expand Down Expand Up @@ -128,24 +119,18 @@ export async function initTestEnv({
setConfig(config);
await startProver(proverPort, proveCompressedAccounts, proveNewAddresses);
}

if (forester) {
await startForester();
}
}

export async function initTestEnvIfNeeded({
additionalPrograms,
skipSystemAccounts,
indexer = false,
prover = false,
forester = false,
}: {
additionalPrograms?: { address: string; path: string }[];
skipSystemAccounts?: boolean;
indexer?: boolean;
prover?: boolean;
forester?: boolean;
} = {}) {
try {
const anchorProvider = await setAnchorProvider();
Expand All @@ -159,7 +144,6 @@ export async function initTestEnvIfNeeded({
skipSystemAccounts,
indexer,
prover,
forester,
});
}
}
Expand Down
22 changes: 0 additions & 22 deletions cli/src/utils/processForester.ts

This file was deleted.