@@ -37,26 +37,6 @@ const BASE_PORT = port("MB_STACK_BASE_PORT", 8899);
3737// what readiness is gated on.
3838const 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-
6040interface 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 {
422407function 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 } ) ;
0 commit comments