@@ -199,6 +199,27 @@ function getChainInfo(): ChainInfo {
199199 return chainInfo ;
200200}
201201
202+ function applyTxFilteringConfig ( config : any ) {
203+ config . execution [ "address-filter" ] = {
204+ "enable" : true ,
205+ "s3" : {
206+ "access-key" : "minioadmin" ,
207+ "secret-key" : "minioadmin" ,
208+ "region" : "us-east-1" ,
209+ "endpoint" : "http://minio:9000" ,
210+ "bucket" : "tx-filtering" ,
211+ "object-key" : "address-hashes.json"
212+ } ,
213+ "poll-interval" : "30s"
214+ } ;
215+ config . execution [ "transaction-filterer-rpc-client" ] = {
216+ "url" : "http://transaction-filterer:8547"
217+ } ;
218+ config [ "init" ] = {
219+ "transaction-filtering-enabled" : true
220+ } ;
221+ }
222+
202223function writeConfigs ( argv : any ) {
203224 const valJwtSecret = path . join ( consts . configpath , "val_jwt.hex" )
204225 const chainInfoFile = path . join ( consts . configpath , "l2_chain_info.json" )
@@ -331,24 +352,7 @@ function writeConfigs(argv: any) {
331352 simpleConfig . node [ "data-availability" ] [ "rpc-aggregator" ] . enable = true
332353 }
333354 if ( argv . txfiltering ) {
334- simpleConfig . execution [ "address-filter" ] = {
335- "enable" : true ,
336- "s3" : {
337- "access-key" : "minioadmin" ,
338- "secret-key" : "minioadmin" ,
339- "region" : "us-east-1" ,
340- "endpoint" : "http://minio:9000" ,
341- "bucket" : "tx-filtering" ,
342- "object-key" : "address-hashes.json"
343- } ,
344- "poll-interval" : "30s"
345- } ;
346- simpleConfig . execution [ "transaction-filterer-rpc-client" ] = {
347- "url" : "http://transaction-filterer:8547"
348- } ;
349- simpleConfig [ "init" ] = {
350- "transaction-filtering-enabled" : true
351- } ;
355+ applyTxFilteringConfig ( simpleConfig ) ;
352356 }
353357 fs . writeFileSync ( path . join ( consts . configpath , "sequencer_config.json" ) , JSON . stringify ( simpleConfig ) )
354358 } else {
@@ -374,24 +378,7 @@ function writeConfigs(argv: any) {
374378 } ;
375379 }
376380 if ( argv . txfiltering ) {
377- sequencerConfig . execution [ "address-filter" ] = {
378- "enable" : true ,
379- "s3" : {
380- "access-key" : "minioadmin" ,
381- "secret-key" : "minioadmin" ,
382- "region" : "us-east-1" ,
383- "endpoint" : "http://minio:9000" ,
384- "bucket" : "tx-filtering" ,
385- "object-key" : "address-hashes.json"
386- } ,
387- "poll-interval" : "30s"
388- } ;
389- sequencerConfig . execution [ "transaction-filterer-rpc-client" ] = {
390- "url" : "http://transaction-filterer:8547"
391- } ;
392- sequencerConfig [ "init" ] = {
393- "transaction-filtering-enabled" : true
394- } ;
381+ applyTxFilteringConfig ( sequencerConfig ) ;
395382 }
396383 fs . writeFileSync ( path . join ( consts . configpath , "sequencer_config.json" ) , JSON . stringify ( sequencerConfig ) )
397384
0 commit comments