Skip to content

Latest commit

 

History

History

delayedInbox-l2msg

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Tutorial: send a signed transaction from the parent chain

delayedInbox-l2msg shows how to send a signed transaction to your chain (also referred to as an L2Message) only using an RPC of the parent chain. This demo has 2 parts:

  1. how to send a normal signed transaction using the delayed inbox (./scripts/normalTx.js)
  2. how to withdraw your funds back without sending a transaction directly to the sequencer (./scripts/withdrawFunds.js)

Bypassing the sequencer

This tutorial also shows the initial step to take if the sequencer is misbehaving. In that case, after 24 hours have passed from the moment the message was sent from the parent chain, you can use the SequencerInbox's forceInclusion method to move it from the delayed inbox into the core inbox, at which point it's considered finalized.

You can also use the Arbitrum SDK to force include your transaction. See an example here.

Set environment variables

Set the values shown in .env-sample as environmental variables. To copy it into a .env file:

cp .env-sample .env

You'll still need to edit some variables, i.e., PRIVATE_KEY, CHAIN_RPC and PARENT_CHAIN_RPC.

Note that you can also set the environment variables in an .env file in the root of the monorepo, which will be available in all tutorials.

Run

Normal transaction:

yarn normalTx

Withdraw funds:

yarn withdrawFunds