@effectstream/orchestrator 0.100.14 → 0.100.15

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 ADDED
@@ -0,0 +1,116 @@
1
+ # @effectstream/orchestrator
2
+
3
+ A multi-chain local development environment for EffectStream. One CLI
4
+ starts every dependency a template needs — Postgres / PgLite, Hardhat,
5
+ contracts, Bitcoin Core, Midnight node + indexer + proof server,
6
+ Cardano-side services, Avail node + light client, NEAR sandbox,
7
+ Celestia, plus the EffectStream sync + runtime + batcher — in the right
8
+ order, with health checks.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ bun add @effectstream/orchestrator
14
+ # or
15
+ npm install @effectstream/orchestrator
16
+ ```
17
+
18
+ ## Standalone usage
19
+
20
+ The orchestrator is mostly invoked as a CLI from a template's repo
21
+ root:
22
+
23
+ ```bash
24
+ # Start every process defined in orchestrator.config.ts (or .json)
25
+ bun packages/build-tools/orchestrator/src/cli.ts start
26
+
27
+ # Show what's running and the health of each
28
+ bun packages/build-tools/orchestrator/src/cli.ts status
29
+
30
+ # Stop everything
31
+ bun packages/build-tools/orchestrator/src/cli.ts stop
32
+ ```
33
+
34
+ Each process is declared in an `OrchestratorConfig` object: its command,
35
+ working directory, environment, the ports/endpoints to watch for
36
+ readiness, and which other processes it depends on. Then the
37
+ orchestrator builds the dependency graph and runs them in parallel where
38
+ possible.
39
+
40
+ ```typescript
41
+ import type { OrchestratorConfig } from "@effectstream/orchestrator/config";
42
+
43
+ export const config: OrchestratorConfig = {
44
+ processes: [
45
+ {
46
+ name: "pglite",
47
+ command: ["bun", "run", "@effectstream/db/start-pglite"],
48
+ readiness: { tcp: { port: 5432 } },
49
+ },
50
+ {
51
+ name: "hardhat",
52
+ command: ["bun", "run", "hardhat", "node"],
53
+ readiness: { http: { url: "http://127.0.0.1:8545" } },
54
+ },
55
+ {
56
+ name: "deploy-contracts",
57
+ command: ["bun", "scripts/deploy.ts"],
58
+ dependsOn: ["hardhat"],
59
+ },
60
+ // …
61
+ ],
62
+ };
63
+ ```
64
+
65
+ Common chain launchers ship as subpath scripts you can compose: `./launch-pglite`,
66
+ `./launch-evm`, `./launch-bitcoin`, `./launch-cardano`, `./launch-midnight`,
67
+ `./launch-avail`, `./launch-near`. Each wraps a pinned binary from
68
+ `@effectstream/binaries/*` with sensible defaults.
69
+
70
+ > **Tip:** Disable chains you don't need with env vars: `DISABLE_EVM=true`,
71
+ > `DISABLE_BITCOIN=true`, `DISABLE_MIDNIGHT=true`, etc. Same flags work for
72
+ > the orchestrator and `e2e/runner.ts`.
73
+
74
+ ## CLI reference
75
+
76
+ ```
77
+ orchestrator start [config] Start processes (daemonised, exposes HTTP API)
78
+ orchestrator status Show process status
79
+ orchestrator restart <name> Restart a named process
80
+ orchestrator stop [name] Stop a named process, or all
81
+ orchestrator list [config] List processes without starting
82
+ orchestrator silence <name...> Suppress terminal output for named processes
83
+ orchestrator unsilence <name...> Resume terminal output
84
+ orchestrator logs [name...] Follow background daemon log files
85
+
86
+ Global flags:
87
+ --port <n> Orchestrator API port (default: 4747)
88
+ ```
89
+
90
+ ## Inside EffectStream
91
+
92
+ Every template under
93
+ [`templates/`](https://github.com/PaimaStudios/paima-engine/tree/main/templates)
94
+ defines an `orchestrator.config.ts` (or `.json`) and starts dev with one
95
+ command. The E2E runner at
96
+ [`e2e/runner.ts`](https://github.com/PaimaStudios/paima-engine/blob/main/e2e/runner.ts)
97
+ is the same machinery, serialised across nine chain suites.
98
+
99
+ ## Key subpath exports
100
+
101
+ - `@effectstream/orchestrator/config` — `OrchestratorConfig`, `ProcessConfig` types.
102
+ - `@effectstream/orchestrator/resolve-package` — resolve a package's bin to an absolute path (used by launcher scripts).
103
+ - `@effectstream/orchestrator/launch-pglite`, `./launch-evm`, `./launch-bitcoin`, `./launch-cardano`, `./launch-midnight`, `./launch-avail`, `./launch-near` — opinionated launcher scripts for each chain.
104
+ - `@effectstream/orchestrator/wait-tcp`, `./wait-http` — readiness-check helpers.
105
+
106
+ ## Examples
107
+
108
+ - Templates: every directory under [`templates/`](https://github.com/PaimaStudios/paima-engine/tree/main/templates) ships a working orchestrator config.
109
+ - E2E: [`e2e/`](https://github.com/PaimaStudios/paima-engine/tree/main/e2e) drives the orchestrator under the hood.
110
+
111
+ Runnable: [`test/examples.test.ts`](./test/examples.test.ts).
112
+
113
+ ## Links
114
+
115
+ - Docs: https://effectstream.github.io/docs/packages/tools/orchestrator
116
+ - Source: https://github.com/PaimaStudios/paima-engine/tree/main/packages/build-tools/orchestrator
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effectstream/orchestrator",
3
- "version": "0.100.14",
3
+ "version": "0.100.15",
4
4
  "license": "MIT",
5
5
  "homepage": "https://effectstream.github.io/docs/",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "start": "bun src/cli.ts start"
32
32
  },
33
33
  "dependencies": {
34
- "@effectstream/db": "0.100.14"
34
+ "@effectstream/db": "0.100.15"
35
35
  },
36
36
  "description": "Multi-chain local development environment for EffectStream"
37
37
  }
@@ -0,0 +1,32 @@
1
+ // Examples for the README — verify the public surface resolves.
2
+
3
+ import { test, expect } from "bun:test";
4
+ import type { OrchestratorConfig, ProcessConfig } from "../src/config.ts";
5
+
6
+ test("README: OrchestratorConfig + ProcessConfig types compose into a valid object", () => {
7
+ const config: OrchestratorConfig = {
8
+ processes: [
9
+ {
10
+ name: "pglite",
11
+ command: ["bun", "run", "@effectstream/db/start-pglite"],
12
+ readiness: { tcp: { port: 5432 } },
13
+ },
14
+ {
15
+ name: "hardhat",
16
+ command: ["bun", "run", "hardhat", "node"],
17
+ readiness: { http: { url: "http://127.0.0.1:8545" } },
18
+ },
19
+ {
20
+ name: "deploy-contracts",
21
+ command: ["bun", "scripts/deploy.ts"],
22
+ dependsOn: ["hardhat"],
23
+ },
24
+ ],
25
+ };
26
+
27
+ expect(config.processes.length).toBe(3);
28
+ expect(config.processes[0].name).toBe("pglite");
29
+
30
+ const proc: ProcessConfig = config.processes[1];
31
+ expect(proc.name).toBe("hardhat");
32
+ });