File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/message-relayer/src/exec Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,15 @@ const main = async () => {
106106 } else {
107107 throw new Error ( 'Must pass one of L1_WALLET_KEY or MNEMONIC' )
108108 }
109- var chainId = L2_NODE_CHAIN_ID
110- if ( ! chainId || chainId == 0 ) {
111- chainId = await l2Provider . send ( 'eth_chainId' , [ ] )
109+ let l2ChainId = L2_NODE_CHAIN_ID
110+ if ( ! l2ChainId ) {
111+ const network = await l2Provider . getNetwork ( )
112+ l2ChainId = network . chainId
112113 }
113114 const service = new MessageRelayerService ( {
114115 l1RpcProvider : l1Provider ,
115116 l2RpcProvider : l2Provider ,
116- l2ChainId : chainId ,
117+ l2ChainId,
117118 addressManagerAddress : ADDRESS_MANAGER_ADDRESS ,
118119 l1Wallet : wallet ,
119120 relayGasLimit : RELAY_GAS_LIMIT ,
@@ -128,6 +129,14 @@ const main = async () => {
128129 relayNumber : RELAY_NUMBER ,
129130 } )
130131
132+ const stop = async ( signal ) => {
133+ console . log ( `"{"msg": "${ signal } - Stopping message relayer"}"` )
134+ await service . stop ( )
135+ }
136+
137+ process . on ( 'SIGTERM' , stop )
138+ process . on ( 'SIGINT' , stop )
139+
131140 await service . start ( )
132141}
133142export default main
You can’t perform that action at this time.
0 commit comments