Skip to content

Run a Local Rollup and Sequencer

This guide will walk you through running a local Geth rollup against the Astria sequencer, using the astria-go cli to run the required components of the Astria stack locally on your machine.

Setup an astria-geth Rollup

astria-geth is a fork of go-ethereum modified to work with the Astria sequencing layer.

View the source code here.

Requires Go, just, make, and Foundry:

Open a new terminal window and clone and build Geth:

bash
git clone git@github.com:astriaorg/astria-geth.git
cd astria-geth
just -f dev/justfile build

# You can move the binary to a location in your PATH if you'd like
mv ./build/bin/astria-geth /usr/local/bin/
astria-geth version
bash
git clone https://github.com/astriaorg/astria-cli-go.git
cd astria-geth
just -f dev/justfile build

# You can move the binary to a location in your PATH if you'd like
mv ./build/bin/astria-geth /usr/local/bin/
astria-geth version

Create a new genesis account for your Geth rollup:

bash
cast w new

Open the dev/geth-genesis-local.json file in the astria-geth repo and update the "alloc" account with the new address you just created, as well as updating the "chainId" and "astriaRollupName" to something of your choosing:

json
{
    "config": {
        ...
        "chainId": <6 digit number>,
        "astriaRollupName": "<your rollup name>",
        ...
        "alloc": {
            "<your new address>": { "balance": "300000000000000000000" }
        }
    }
}

You will use the private key for your new account to send test transactions later on.

Start Geth

In your Geth terminal window, run the following to initialize and run the Geth rollup:

bash
# in astria-geth dir
just -f dev/justfile init
just -f dev/justfile run

If you need to restart the rollup, you can stop the program with Ctrl+C and restart with:

bash
just -f dev/justfile run

If you need to restart the rollup and want to also clear the state data, you can use:

bash
just -f dev/justfile clean-restart

Configure and Start the Local Astria Sequencer

Open a new terminal window and initialize the cli:

bash
astria-go dev init

Navigate to the ~/.astria directory. If you have run the commands shown above, you should find a default directory.

Open the ~/.astria/default/networks-config.toml file and update the rollup_name variable in the [local] sections using the same "astriaRollupName" you used when setting up your astria-geth rollup.

toml
[networks.local]
sequencer_chain_id = 'sequencer-test-chain-0'
sequencer_grpc = 'http://127.0.0.1:8080'
sequencer_rpc = 'http://127.0.0.1:26657'
rollup_name = '<your rollup name>' # update this value
default_denom = 'ntia'

TIP

shell
export NEW_NAME="my-new-chain"
sed -i '' '/\[networks\.local\]/,/^$/{ s/rollup_name = .*/rollup_name = '\'''$NEW_NAME''\''/; }' ~/.astria/default/networks-config.toml

Use the cli to run a local Astria Sequencer.

bash
astria-go dev run --network local

TIP

When running an Astria sequencer using the cli, the --network local setting is the default. astria-go dev run is effectively an alias for astria-go dev run --network local.

When running the Astria stack locally, you will see a TUI that displays the logs of the Astria Sequencer, the underlying Cometbft node, the Astria Conductor, and Astria Composer: Running a local sequencer in the Astria
cli

Test your Rollup

To test that your rollup and the sequencer are configured and running correctly, you can follow the Test Transactions instructions here.