File tree 1 file changed +20
-4
lines changed
1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ export const openKeys = [
30
30
export const secretKeys = [
31
31
'EL_RPC_URLS_1' ,
32
32
'EL_RPC_URLS_5' ,
33
+ 'EL_RPC_URLS_10' ,
34
+ 'EL_RPC_URLS_1868' ,
35
+ 'EL_RPC_URLS_1946' ,
33
36
'EL_RPC_URLS_17000' ,
34
37
'EL_RPC_URLS_11155111' ,
35
- 'EL_RPC_URLS_10' ,
36
38
'EL_RPC_URLS_11155420' ,
37
- 'EL_RPC_URLS_1868' ,
38
- 'EL_RPC_URLS_1946'
39
39
] ;
40
40
41
41
export const logOpenEnvironmentVariables = ( ) => {
@@ -61,8 +61,24 @@ export const logSecretEnvironmentVariables = () => {
61
61
console . log ( 'Log secret environment variables:' ) ;
62
62
console . log ( '---------------------------------------------' ) ;
63
63
64
- // console.log('process.env:', process.env)
64
+ if ( ! process . env [ 'SUPPORTED_CHAINS' ] ) {
65
+ console . warn ( 'SUPPORTED_CHAINS is not defined in process.env!' ) ;
66
+ console . warn ( 'Skip the logSecretEnvironmentVariables check!' ) ;
67
+ return ;
68
+ }
69
+
70
+ const supportedChains = process . env [ 'SUPPORTED_CHAINS' ] . split ( ',' ) . map ( s => s . trim ( ) ) ;
71
+
65
72
for ( const key of secretKeys ) {
73
+ if ( key . startsWith ( 'EL_RPC_URLS_' ) ) {
74
+ const chainId = key . replace ( 'EL_RPC_URLS_' , '' ) ;
75
+ if ( ! supportedChains . includes ( chainId ) ) {
76
+ console . info ( `Secret ${ key } - skipped (${ chainId } isn't in the SUPPORTED_CHAINS)!` ) ;
77
+ // Skip check if chainId isn't in the SUPPORTED_CHAINS
78
+ continue ;
79
+ }
80
+ }
81
+
66
82
if ( ! process . env . hasOwnProperty ( key ) ) {
67
83
console . error ( `Secret ${ key } - ERROR (not exist in process.env)` ) ;
68
84
continue ;
You can’t perform that action at this time.
0 commit comments