@effectstream/orchestrator 0.100.16 → 0.100.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @effectstream/orchestrator
2
2
 
3
3
  A multi-chain local development environment for EffectStream. One CLI
4
- starts every dependency a template needs — Postgres / PgLite, Hardhat,
4
+ starts every dependency a template needs - Postgres / PgLite, Hardhat,
5
5
  contracts, Bitcoin Core, Midnight node + indexer + proof server,
6
6
  Cardano-side services, Avail node + light client, NEAR sandbox,
7
- Celestia, plus the EffectStream sync + runtime + batcher — in the right
7
+ Celestia, plus the EffectStream sync + runtime + batcher - in the right
8
8
  order, with health checks.
9
9
 
10
10
  - One CLI that starts every dependency a template needs: DB, chains, sync, runtime, batcher.
@@ -105,10 +105,10 @@ is the same machinery, serialised across nine chain suites.
105
105
 
106
106
  ## Key subpath exports
107
107
 
108
- - `@effectstream/orchestrator/config` — `OrchestratorConfig`, `ProcessConfig` types.
109
- - `@effectstream/orchestrator/resolve-package` — resolve a package's bin to an absolute path (used by launcher scripts).
110
- - `@effectstream/orchestrator/launch-pglite`, `./launch-evm`, `./launch-bitcoin`, `./launch-cardano`, `./launch-midnight`, `./launch-avail`, `./launch-near` — opinionated launcher scripts for each chain.
111
- - `@effectstream/orchestrator/wait-tcp`, `./wait-http` — readiness-check helpers.
108
+ - `@effectstream/orchestrator/config` - `OrchestratorConfig`, `ProcessConfig` types.
109
+ - `@effectstream/orchestrator/resolve-package` - resolve a package's bin to an absolute path (used by launcher scripts).
110
+ - `@effectstream/orchestrator/launch-pglite`, `./launch-evm`, `./launch-bitcoin`, `./launch-cardano`, `./launch-midnight`, `./launch-avail`, `./launch-near` - opinionated launcher scripts for each chain.
111
+ - `@effectstream/orchestrator/wait-tcp`, `./wait-http` - readiness-check helpers.
112
112
 
113
113
  ## Examples
114
114
 
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@effectstream/orchestrator",
3
- "version": "0.100.16",
3
+ "version": "0.100.17",
4
4
  "license": "MIT",
5
5
  "homepage": "https://effectstream.github.io/docs/",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/PaimaStudios/paima-engine",
8
+ "url": "https://github.com/effectstream/effectstream",
9
9
  "directory": "packages/build-tools/orchestrator"
10
10
  },
11
11
  "bugs": {
12
- "url": "https://github.com/PaimaStudios/paima-engine/issues"
12
+ "url": "https://github.com/effectstream/effectstream/issues"
13
13
  },
14
14
  "exports": {
15
15
  "./config": "./src/config.ts",
@@ -32,7 +32,7 @@
32
32
  "start": "bun src/cli.ts start"
33
33
  },
34
34
  "dependencies": {
35
- "@effectstream/db": "0.100.16"
35
+ "@effectstream/db": "0.100.17"
36
36
  },
37
37
  "description": "Multi-chain local development environment for EffectStream"
38
38
  }
@@ -1,10 +1,35 @@
1
+ import { spawnSync } from "node:child_process";
1
2
  import type { ProcessConfig } from "../src/config.ts";
2
3
  import { resolvePackageDir, type ResolveLocation } from "./resolve-package.ts";
3
4
 
5
+ /**
6
+ * Foundry's `forge` is required to compile the EVM contracts (the mod builder
7
+ * derives the TypeScript bindings from the Forge artifacts). It is a system
8
+ * toolchain, not an npm dependency, so verify it is on PATH up front and stop
9
+ * with an actionable message instead of letting `build:forge` die with a
10
+ * cryptic "command not found" (exit 127) mid-run.
11
+ */
12
+ function assertForgeInstalled(): void {
13
+ const found = spawnSync("forge", ["--version"], { stdio: "ignore" });
14
+ if (found.status === 0) return;
15
+ throw new Error(
16
+ [
17
+ "",
18
+ "Foundry's `forge` was not found on your PATH, but it is required to compile the EVM contracts.",
19
+ "",
20
+ " Install Foundry from: https://www.getfoundry.sh/",
21
+ "",
22
+ " (quick install) curl -L https://foundry.paradigm.xyz | bash && foundryup",
23
+ "",
24
+ ].join("\n"),
25
+ );
26
+ }
27
+
4
28
  export const EvmNames = {
5
29
  HARDHAT: "hardhat",
6
30
  HARDHAT_WAIT: "hardhat-wait",
7
31
  COMPILE: "compile-evm-contracts",
32
+ COMPILE_FORGE: "compile-evm-contracts-forge",
8
33
  DEPLOY: "deploy-evm-contracts",
9
34
  GENERATE_MOD: "generate-evm-mod",
10
35
  } as const;
@@ -13,6 +38,7 @@ const REQUIRED_SCRIPTS = {
13
38
  "chain:start": "Start the Hardhat node (e.g. `bun ./node_modules/.bin/hardhat node`)",
14
39
  "chain:wait": "Wait for the Hardhat node to be ready (e.g. `bun ./node_modules/.bin/hardhat node wait`)",
15
40
  "build:hardhat": "Compile Solidity contracts with Hardhat (e.g. `hardhat compile`)",
41
+ "build:forge": "Compile Solidity contracts with Forge (e.g. `forge build`) — produces the artifacts the mod builder reads",
16
42
  "deploy": "Deploy compiled contracts to the running chain (e.g. via Hardhat Ignition)",
17
43
  } as const;
18
44
 
@@ -22,6 +48,7 @@ export function launchEvm(
22
48
  opts?: { ports?: number[] },
23
49
  ): ProcessConfig[] {
24
50
  const cwd = resolvePackageDir("launchEvm", packageName, location, REQUIRED_SCRIPTS);
51
+ assertForgeInstalled();
25
52
  const ports = opts?.ports ?? [8545, 8546];
26
53
 
27
54
  return [
@@ -44,12 +71,25 @@ export function launchEvm(
44
71
  },
45
72
  {
46
73
  name: EvmNames.COMPILE,
47
- description: `Compile Solidity contracts (${packageName} build:hardhat)`,
74
+ description: `Compile Solidity contracts with Hardhat (${packageName} build:hardhat)`,
48
75
  cwd,
49
76
  args: ["run", "build:hardhat"],
50
77
  waitToExit: true,
51
78
  critical: true,
52
79
  },
80
+ {
81
+ // Serialized after Hardhat: both scripts rewrite the shared remappings.txt,
82
+ // so running them concurrently would race. The mod builder reads only the
83
+ // Forge artifacts (build/artifacts/forge), so this step is required for the
84
+ // TypeScript bindings to be generated.
85
+ name: EvmNames.COMPILE_FORGE,
86
+ description: `Compile Solidity contracts with Forge (${packageName} build:forge)`,
87
+ cwd,
88
+ args: ["run", "build:forge"],
89
+ waitToExit: true,
90
+ critical: true,
91
+ dependsOn: [EvmNames.COMPILE],
92
+ },
53
93
  {
54
94
  name: EvmNames.DEPLOY,
55
95
  description: `Deploy contracts to the running chain (${packageName} deploy)`,
@@ -63,10 +103,10 @@ export function launchEvm(
63
103
  name: EvmNames.GENERATE_MOD,
64
104
  description: `Generate TypeScript bindings from deployed contracts (${packageName})`,
65
105
  cwd,
66
- args: ["-e", "const fs=await import('node:fs');await fs.promises.mkdir('./build',{recursive:true});await fs.promises.writeFile('./build/mod.ts','export {};\\n');await import('@effectstream/evm-hardhat/builder')"],
106
+ args: ["-e", "await import('@effectstream/evm-hardhat/builder')"],
67
107
  waitToExit: true,
68
108
  critical: true,
69
- dependsOn: [EvmNames.DEPLOY],
109
+ dependsOn: [EvmNames.DEPLOY, EvmNames.COMPILE_FORGE],
70
110
  },
71
111
  ];
72
112
  }
@@ -1,6 +1,31 @@
1
+ import { spawnSync } from "node:child_process";
1
2
  import type { ProcessConfig } from "../src/config.ts";
2
3
  import { resolvePackageDir, type ResolveLocation } from "./resolve-package.ts";
3
4
 
5
+ /**
6
+ * Midnight's `compact` compiler is required to compile the Compact contracts
7
+ * (the midnight-contract:deploy step). It is a system toolchain, not an npm
8
+ * dependency, so verify it is on PATH up front and stop with an actionable
9
+ * message instead of failing with a cryptic "command not found" mid-deploy.
10
+ * Install tips mirror .github/Dockerfile.
11
+ */
12
+ function assertCompactInstalled(): void {
13
+ const found = spawnSync("compact", ["--version"], { stdio: "ignore" });
14
+ if (found.status === 0) return;
15
+ throw new Error(
16
+ [
17
+ "",
18
+ "Midnight's `compact` compiler was not found on your PATH, but it is required to compile the Midnight contracts.",
19
+ "",
20
+ " Install Compact from: https://github.com/midnightntwrk/compact",
21
+ "",
22
+ " (quick install) curl --proto '=https' --tlsv1.2 -LsSf https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh | sh",
23
+ " compact update 0.30.0",
24
+ "",
25
+ ].join("\n"),
26
+ );
27
+ }
28
+
4
29
  export const MidnightNames = {
5
30
  NODE: "midnight-node",
6
31
  NODE_WAIT: "midnight-node-wait",
@@ -30,6 +55,7 @@ export function launchMidnight(
30
55
  },
31
56
  ): ProcessConfig[] {
32
57
  const cwd = resolvePackageDir("launchMidnight", packageName, location, REQUIRED_SCRIPTS);
58
+ assertCompactInstalled();
33
59
  const deployEnv: Record<string, string> = {};
34
60
  if (opts?.env?.MIDNIGHT_STORAGE_PASSWORD) {
35
61
  deployEnv.MIDNIGHT_STORAGE_PASSWORD = opts.env.MIDNIGHT_STORAGE_PASSWORD;