@@ -43,9 +43,17 @@ const RN_FOLLOWER_RPC_URL: &str = "http://localhost:8546";
4343/// The l2geth node RPC URL for the Docker Compose environment.
4444const L2GETH_SEQUENCER_RPC_URL : & str = "http://localhost:8547" ;
4545
46+ /// The l2geth follower node RPC URL for the Docker Compose environment.
4647const L2GETH_FOLLOWER_RPC_URL : & str = "http://localhost:8548" ;
4748
48- const RN_SEQUENCER_ENODE : & str = "enode://e7f7e271f62bd2b697add14e6987419758c97e83b0478bd948f5f2d271495728e7edef5bd78ad65258ac910f28e86928ead0c42ee51f2a0168d8ca23ba939766@{IP}:30303" ;
49+ /// The remote source node RPC URL for the Docker Compose environment.
50+ const RN_REMOTE_SOURCE_RPC_URL : & str = "http://localhost:8546" ;
51+
52+ /// The l2geth skip signer check node RPC URL for the Docker Compose environment.
53+ const L2GETH_SKIPSIGNERCHECK_RPC_URL : & str = "http://localhost:8547" ;
54+
55+ const RN_SEQUENCER_ENODE : & str = "enode://e7f7e271f62bd2b697add14e6987419758c97e83b0478bd948f5f2d271495728e7edef5bd78ad65258ac910f28e86928ead0c42ee51f2a0168d8ca23ba939766@{IP}:30303" ;
56+ const RN_REMOTE_SOURCE_ENODE : & str = "enode://849431bd98c23f8203cf475cfd8efb980d1e2af46337141cfb7dd960d4ae6f8c489846da293305705c8918fbf991e41805afc8c7231c96f3f938120b6826affc@{IP}:30303" ;
4957const L2GETH_SEQUENCER_ENODE : & str = "enode://8fc4f6dfd0a2ebf56560d0b0ef5e60ad7bcb01e13f929eae53a4c77086d9c1e74eb8b8c8945035d25c6287afdd871f0d41b3fd7e189697decd0f13538d1ac620@{IP}:30303" ;
5058
5159pub struct DockerComposeEnv {
@@ -83,6 +91,33 @@ impl DockerComposeEnv {
8391 Ok ( env)
8492 }
8593
94+ /// Create a new DockerComposeEnv for remote block source tests and wait for all services to be
95+ /// ready
96+ pub async fn new_remote_source ( test_name : & str ) -> Result < Self > {
97+ let project_name = format ! ( "test-{test_name}" ) ;
98+ let compose_file = "docker-compose.remote-source.yml" ;
99+
100+ tracing:: info!( "🚀 Starting test environment: {project_name}" ) ;
101+
102+ // Pre-cleanup existing containers to avoid conflicts
103+ Self :: cleanup ( compose_file, & project_name, false ) ;
104+
105+ // Start the environment
106+ let env = Self :: start_environment ( compose_file, & project_name) ?;
107+
108+ // Start streaming logs in the background
109+ let _ = Self :: stream_container_logs ( compose_file, & project_name) . await ;
110+
111+ // Wait for all services to be ready
112+ tracing:: info!( "⏳ Waiting for services to be ready..." ) ;
113+ Self :: wait_for_l2_node_ready ( RN_SEQUENCER_RPC_URL , 30 ) . await ?;
114+ Self :: wait_for_l2_node_ready ( RN_REMOTE_SOURCE_RPC_URL , 30 ) . await ?;
115+ Self :: wait_for_l2_node_ready ( L2GETH_SKIPSIGNERCHECK_RPC_URL , 30 ) . await ?;
116+
117+ tracing:: info!( "✅ All services are ready!" ) ;
118+ Ok ( env)
119+ }
120+
86121 fn start_environment ( compose_file : & str , project_name : & str ) -> Result < Self > {
87122 tracing:: info!( "📦 Starting docker-compose services..." ) ;
88123
@@ -188,6 +223,21 @@ impl DockerComposeEnv {
188223 ) )
189224 }
190225
226+ /// Get a configured remote source provider
227+ pub async fn get_rn_remote_source_provider ( & self ) -> Result < NamedProvider > {
228+ let provider = ProviderBuilder :: < _ , _ , Scroll > :: default ( )
229+ . with_recommended_fillers ( )
230+ . connect ( RN_REMOTE_SOURCE_RPC_URL )
231+ . await
232+ . map_err ( |e| eyre:: eyre!( "Failed to connect to RN remote source: {}" , e) ) ?;
233+ Ok ( NamedProvider :: new (
234+ Box :: new ( provider) ,
235+ "RN Remote Source" ,
236+ "rollup-node-remote-source" ,
237+ RN_REMOTE_SOURCE_RPC_URL ,
238+ ) )
239+ }
240+
191241 /// Get a configured l2geth sequencer provider
192242 pub async fn get_l2geth_sequencer_provider ( & self ) -> Result < NamedProvider > {
193243 let provider = ProviderBuilder :: < _ , _ , Scroll > :: default ( )
@@ -218,6 +268,21 @@ impl DockerComposeEnv {
218268 ) )
219269 }
220270
271+ /// Get a configured l2geth skip signer check provider
272+ pub async fn get_l2geth_skipsignercheck_provider ( & self ) -> Result < NamedProvider > {
273+ let provider = ProviderBuilder :: < _ , _ , Scroll > :: default ( )
274+ . with_recommended_fillers ( )
275+ . connect ( L2GETH_SKIPSIGNERCHECK_RPC_URL )
276+ . await
277+ . map_err ( |e| eyre:: eyre!( "Failed to connect to l2geth skip signer check: {}" , e) ) ?;
278+ Ok ( NamedProvider :: new (
279+ Box :: new ( provider) ,
280+ "L2Geth SkipSignerCheck" ,
281+ "l2geth-skipsignercheck" ,
282+ L2GETH_SKIPSIGNERCHECK_RPC_URL ,
283+ ) )
284+ }
285+
221286 // ===== UTILITIES =====
222287
223288 /// Wait for L2 node to be ready
@@ -441,6 +506,13 @@ impl DockerComposeEnv {
441506 Ok ( RN_SEQUENCER_ENODE . replace ( "{IP}" , & ip) )
442507 }
443508
509+ /// Get the rollup node remote source enode URL with resolved IP address
510+ pub fn rn_remote_source_enode ( & self ) -> Result < String > {
511+ let ip =
512+ self . get_container_ip ( & self . get_full_container_name ( "rollup-node-remote-source" ) ) ?;
513+ Ok ( RN_REMOTE_SOURCE_ENODE . replace ( "{IP}" , & ip) )
514+ }
515+
444516 /// Get the l2geth sequencer enode URL with resolved IP address
445517 pub fn l2geth_sequencer_enode ( & self ) -> Result < String > {
446518 let ip = self . get_container_ip ( & self . get_full_container_name ( "l2geth-sequencer" ) ) ?;
0 commit comments