feat: script deterministic V1 demo state

This commit is contained in:
golem
2026-08-21 02:17:18 -06:00
parent 6dcbb03f3c
commit 52935acf5e
10 changed files with 1010 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
import { readFile } from "node:fs/promises";
import { join, resolve } from "node:path";
import { pathToFileURL } from "node:url";
import { atomicWrite, networkSpec, readManifest } from "./finalize-manifest.mjs";
export async function selectManifest({ root = process.cwd(), network }) {
const spec = networkSpec(network);
const source = join(root, "deployments", spec.canonical);
await readManifest(source);
const contents = await readFile(source);
const active = join(root, "deployments", "active.json");
await atomicWrite(active, contents);
return { source, active };
}
async function main(argv) {
if (argv.length !== 1) throw new Error("usage: select-manifest.mjs <anvil|base-sepolia>");
return selectManifest({ network: argv[0] });
}
if (process.argv[1] && pathToFileURL(resolve(process.argv[1])).href === import.meta.url) {
main(process.argv.slice(2)).catch((error) => {
console.error(error.message);
process.exitCode = 1;
});
}