Test Transactions
Configure the Testing Script
To run the test transactions script you will need Foundry
:
In a new terminal window, clone and configure the evm test transactions repo:
git clone --recurse-submodules git@github.com:astriaorg/astria-web3.git
cd astria-web3
git checkout local-evm
cd packages/evm-test-data/
forge install
cp .env.example .env
Open the .env
file and update the chain id and private key. The chain id should match the "chainId"
value in the geth-genesis-local.json
file in the astria-geth
repo. The private key used here should be the private key for the account you used when setting up Geth previously:
# this value should be the same as what you used for configuring Geth above
CHAIN_ID=<6 digit number>
PRIVATE_KEY=<your evm account private key>
Run the Testing Script
just generate-transactions
You will see the transactions going through in both the forge
script and the log windows in the astria-go
cli.
TIP
The test script sends transactions directly to the local rollup running on your machine. Thus, the transactions will work regardless of whether you are running everything locally with astria-go dev run --network local
or if you are running against a remote sequencer with astria-go dev run --network dusk
.
Common Issues
EvmError: OutOfFunds
If you see a an OutOfFunds
error when running the testing script, this means that your rollup genesis account was not configured correctly. To fix this issue:
- Go back to the
astria-geth
repo. - Run
cast w new
to create a new rollup account. - Add the new address to the
geth-genesis-local.json
under"alloc"
. - Restart your rollup with
just clean-restart
. - Update the
PRIVATE_KEY
env var in the test transactions repo with the private key from the new account. - Rerun the testing script.
Test script hangs
If you are running against a remote sequencer and the transactions test script hangs, navigate to the cli TUI and look at the logs for the Composer. You will likely see an error that contains sequencer rejected the transaction ... insufficient funds for asset
. This means that the sequencer account that was created was either improperly configure or not funded correctly. To fix this issue:
- Stop the
astria-go
cli. - Create a new sequencer account with
astria-go sequencer createaccount
or use an existing account if you already have one for testing, and fund the account using the Sequencer Faucet. - Make sure the
astria_composer_private_key
variable in the~/.astria/default/config/base-config.toml
is set to the private key for your funded sequencer account. - Re-launch the cli with
astria-go dev run --network dusk
. - Rerun the transactions testing script.
Chain Data Mismatch
If you start seeing warning in Composer that say failed getting latest nonce from sequencer
or errors in Conductor that say first latest height from sequencer was bad
, this likely means that block data on your rollup and the block data coming from whatever sequencer you are using (either local or remote) are mismatched. To fix this issue:
- Stop your rollup and the cli.
- Restart the rollup with
just clean-restart
and restart the cli with the run conditions you were using.
This will clean the data your rollup and allow it to resync.
If issues still persist, you can clean the data for the rollup and the sequencer (if you are running a local sequencer):
- Stop your rollup and the cli.
- With the cli run
astria-go dev clean
thenastria-go dev init
. - Restart the rollup with
just clean-restart
. - Restart the cli with
astria-go dev run
.