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 () => {
106
106
} else {
107
107
throw new Error ( 'Must pass one of L1_WALLET_KEY or MNEMONIC' )
108
108
}
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
112
113
}
113
114
const service = new MessageRelayerService ( {
114
115
l1RpcProvider : l1Provider ,
115
116
l2RpcProvider : l2Provider ,
116
- l2ChainId : chainId ,
117
+ l2ChainId,
117
118
addressManagerAddress : ADDRESS_MANAGER_ADDRESS ,
118
119
l1Wallet : wallet ,
119
120
relayGasLimit : RELAY_GAS_LIMIT ,
@@ -128,6 +129,14 @@ const main = async () => {
128
129
relayNumber : RELAY_NUMBER ,
129
130
} )
130
131
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
+
131
140
await service . start ( )
132
141
}
133
142
export default main
You can’t perform that action at this time.
0 commit comments