Skip to content

Commit e2cb420

Browse files
committed
feat: replace chainlink consumers with chainsync
1 parent 2803399 commit e2cb420

140 files changed

Lines changed: 768 additions & 30890 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/packages/npm-package/README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ services too.
3636
| `MB_STACK_PUBLIC_PORT` | Application RPC port | `6699` |
3737
| `MB_STACK_ER_PORT` | Ephemeral validator RPC port | `7799` |
3838
| `MB_STACK_BASE_PORT` | Base-chain test validator RPC port | `8899` |
39-
| `MB_STACK_ER_REMOTES` | External base-chain remotes, comma-separated | Local test validator |
39+
| `MBV_CHAINSYNC__HTTP` | External base-chain HTTP URLs as an array, e.g. `'["https://api.devnet.solana.com"]'` | Local test validator |
4040
| `MB_STACK_CRANKER_PORT` | hydra-cranker Prometheus/health port (`--cranker`) | `9797` |
4141
| `MB_STACK_CRANKER_KEYPAIR` | Funded keypair the cranker signs `Trigger` txs with | required with `--cranker` |
4242

43-
Each WebSocket port is its RPC port plus one. Setting `MB_STACK_ER_REMOTES`
43+
Each WebSocket port is its RPC port plus one. Setting `MBV_CHAINSYNC__HTTP`
4444
skips the local base-chain validator; the external chain must have the required
45-
MagicBlock programs and accounts.
45+
MagicBlock programs and accounts. Configure explicit WebSocket providers and gRPC
46+
streams through `MBV_CHAINSYNC__WEBSOCKET__PROVIDERS` and `MBV_CHAINSYNC__GRPC`.
4647

4748
Extra arguments go to the base-chain test validator, for example:
4849

‎.github/packages/npm-package/mbStack.ts‎

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,6 @@ const BASE_PORT = port("MB_STACK_BASE_PORT", 8899);
3737
// what readiness is gated on.
3838
const CRANKER_PORT = port("MB_STACK_CRANKER_PORT", 9797);
3939

40-
// Which base chain the ephemeral-validator clones from / commits to. Defaults to
41-
// the local mb-test-validator; override (comma-separated remotes, e.g.
42-
// MB_STACK_ER_REMOTES=devnet) to point the ER at a real provisioned base.
43-
function erRemotes(): string[] {
44-
const override = process.env.MB_STACK_ER_REMOTES;
45-
if (override) {
46-
return override
47-
.split(",")
48-
.map((r) => r.trim())
49-
.filter((r) => r.length > 0)
50-
.flatMap((r) => ["--remotes", r]);
51-
}
52-
return [
53-
"--remotes",
54-
`http://${HOST}:${BASE_PORT}`,
55-
"--remotes",
56-
`ws://${HOST}:${BASE_PORT + 1}`,
57-
];
58-
}
59-
6040
interface Service {
6141
name: string;
6242
script: string;
@@ -139,7 +119,12 @@ const SERVICES: Service[] = [
139119
// --no-tui is required: the published ER is built with the TUI feature, and a
140120
// supervised child with redirected stdio (no TTY) would otherwise exit
141121
// immediately. The stack is headless by design.
142-
args: ["--no-tui", "--listen", `${HOST}:${ER_PORT}`, ...erRemotes()],
122+
args: ["--no-tui", "--listen", `${HOST}:${ER_PORT}`],
123+
extraEnv: {
124+
MBV_CHAINSYNC__HTTP:
125+
process.env.MBV_CHAINSYNC__HTTP ??
126+
JSON.stringify([`http://${HOST}:${BASE_PORT}`]),
127+
},
143128
healthPort: ER_PORT,
144129
tag: "er",
145130
color: "\x1b[32m", // green
@@ -422,7 +407,7 @@ function startService(svc: Service): ChildProcess {
422407
function printSummary(): void {
423408
console.log("");
424409
console.log(color("MagicBlock stack is ready.", `${BOLD}`));
425-
const remotesOverride = process.env.MB_STACK_ER_REMOTES;
410+
const remotesOverride = process.env.MBV_CHAINSYNC__HTTP;
426411
if (remotesOverride) {
427412
console.log(`${color("Base chain:", CYAN)} ${remotesOverride}`);
428413
}
@@ -443,7 +428,7 @@ async function main(): Promise<void> {
443428
// skip it so we don't boot an idle validator. The cranker is opt-in.
444429
const services = SERVICES.filter((s) => {
445430
if (s.script === "mbTestValidator.js")
446-
return !process.env.MB_STACK_ER_REMOTES;
431+
return !process.env.MBV_CHAINSYNC__HTTP;
447432
if (s.script === "hydraCranker.js") return WITH_CRANKER;
448433
return true;
449434
});

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ changing that boundary.
99
- `bins/validator` owns leader orchestration;
1010
`bins/verifier` owns follower lifecycle. Only the leader starts
1111
application services.
12-
- `runtime` owns the shared runtime image; `chainlink`
12+
- `runtime` owns the shared runtime image; `chainsync`
1313
owns account synchronization/materialization; `aperture` owns RPC;
1414
committor crates own settlement; `task-scheduler` owns repeated tasks.
1515
- Keep operator work in `bins/magicblock` and `bins/validator-tui`,

‎Cargo.lock‎

Lines changed: 3 additions & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)