The astria-go
CLI simplifies local rollup development and minimizes
dependencies. It provides functionality to easily run the Astria stack and
interact with the Sequencer.
See all releases here.
-
Download the latest release for your platform:
# For macOS silicon (arm64) export RELEASE_URL="https://github.com/astriaorg/astria-cli-go/releases/download/v0.12.0/astria-go-v0.12.0-darwin-arm64.tar.gz" curl -L $RELEASE_URL --output astria-go.tar.gz
-
Extract the binary:
tar -xzvf astria-go.tar.gz
-
Verify the installation:
./astria-go version
-
Optionally, move the binary to a location in your PATH:
mv astria-go /usr/local/bin/
-
Download the nightly release:
export NIGHTLY_URL="download url of the build you need" curl -L $NIGHTLY_URL > astria-cli.tar.gz
-
Extract and install:
tar -xvzf astria-cli.tar.gz mv astria-go /usr/local/bin/
-
Verify the installation:
astria-go version
Prerequisites:
Steps:
-
Clone the repository:
git clone git@github.com:astriaorg/astria-cli-go.git cd astria-cli-go
-
Build the project:
just build
-
Verify the build:
just run "version" # or go run main.go version
astria-go dev init
This command downloads binaries, generates configuration files, and initializes
CometBFT. Files are organized in the ~/.astria/<instance>
directory.
astria-go dev run --network local
This command starts a local Sequencer (Cometbft and Astria-Sequencer), Conductor, and Composer using pre-built binaries.
To run Composer and Conductor locally against a remote Astria Sequencer:
# Run against the Astria Dusk dev net
astria-go dev run --network dusk
When using a remote sequencer, you'll need to create an account on the remote sequencer. For more details, refer to the Astria documentation.
You can run components from a local monorepo during development. For example, to use a locally compiled Conductor:
astria-go dev run --network local \
--conductor-path <absolute path to the Astria mono repo>/target/debug/astria-conductor
Or update the local path in the ~/.astria/<instance>/networks-config.toml
:
[networks.local.services.conductor]
name = 'astria-conductor'
version = 'dev'
download_url = ''
local_path = 'path to your local conductor'
args = []
You can swap out some or all binaries:
astria-go dev run --network local \
--sequencer-path <sequencer bin path> \
--cometbft-path <cometbft bin path> \
--composer-path <composer bin path> \
--conductor-path <conductor bin path>
Use astria-go sequencer [command]
to interact with the sequencer. For a full
list of commands:
astria-go sequencer -h
Use the --network
flag to configure which sequencer network the commands will
run against.
Use the --instance
flag to manage multiple rollups:
astria-go dev init
astria-go dev init --instance hello
astria-go dev init --instance world
This creates separate directories in ~/.astria/
for each instance, containing
configs and binaries for running the Astria stack.
The CLI uses the following configuration files:
tui-config.toml
: Controls app start state of the devrunner TUIbase-config.toml
: Sets service environment variablesnetworks-config.toml
: Configures services and sequencer networkssequencer-networks-config.toml
: Used forastria-go sequencer
commands
Once astria-go dev init
has been run, edit ~/.astria/tui-config.toml
to
control the starting settings of the TUI app.
The highlight_color
and border_color
accept both W3C named
colors and hexadecimal
notation:
highlight_color = "deepskyblue" # names should be all lowercase with no spaces
border_color = "#808080"
Edit ~/.astria/<instance>/config/base-config.toml
to add or change settings:
lower_snake_case_var_name = 'value'
The ~/.astria/<instance>/networks-config.toml
file configures which services
are run and provides overrides for different sequencer networks.
To use a specific version of a service, update the version
, download_url
,
and local_path
in the networks-config.toml
. For example, to roll back
Composer:
[networks.local.services.composer]
name = 'astria-composer'
version = 'v0.7.0'
download_url = 'https://github.com/astriaorg/astria/releases/download/composer-v0.7.0/astria-composer-aarch64-apple-darwin.tar.gz'
local_path = '<your home directory>/.astria/default/bin/astria-composer-v0.7.0'
args = []
Then run astria-go dev init
to download the specified service.
For local development, point to your locally built binary:
[networks.local.services.composer]
name = 'astria-composer'
version = 'dev'
download_url = ''
local_path = '<path to your local binary>'
args = []
Add a local service to your network:
[networks.local.services.echo]
name = 'echo'
version = ''
download_url = ''
local_path = '/bin/bash'
args = ['-c', 'echo -e "hello world\nhello again!"']
NOTE: All arguments are interpreted literally. This may affect how some service arguments are parsed. Running through a bash shell command resolves this issue in the case of running an
echo
command above.
Add a service from a release:
[networks.local.services.your_service]
name = 'your_service'
version = 'v0.0.0'
download_url = 'download url to the release'
local_path = '<your home directory>/.astria/default/bin/<your_service_name-version>'
args = ['your', 'service', 'args']
To add a new network, append a new section to networks-config.toml
:
[networks.sequencer_only]
sequencer_chain_id = 'sequencer-only'
sequencer_grpc = 'http://127.0.0.1:8080'
sequencer_rpc = 'http://127.0.0.1:26657'
rollup_name = 'astria-test-chain'
default_denom = 'ntia'
[networks.sequencer_only.services]
[networks.sequencer_only.services.cometbft]
name = 'cometbft'
version = 'v0.38.8'
download_url = 'https://github.com/cometbft/cometbft/releases/download/v0.38.8/cometbft_0.38.8_darwin_arm64.tar.gz'
local_path = '<your home directory>/.astria/default/bin/cometbft-v0.38.8'
args = []
[networks.sequencer_only.services.sequencer]
name = 'astria-sequencer'
version = 'v0.15.0'
download_url = 'https://github.com/astriaorg/astria/releases/download/sequencer-v0.15.0/astria-sequencer-aarch64-apple-darwin.tar.gz'
local_path = '<your home directory>/.astria/default/bin/astria-sequencer-v0.15.0'
args = []
Run your new network with:
astria-go dev init
astria-go dev run --network sequencer_only
The ~/.astria/sequencer-networks-config.toml
provides presets for interacting
with different sequencer networks when using astria-go sequencer
commands. Use
the --network <network name>
flag to simplify your commands.
To add presets for a new network, append to sequencer-networks-config.toml
:
[networks.new_network]
sequencer_chain_id = 'new-network'
sequencer_url = '<rpc endpoint for the sequencer>'
asset = '<new asset>'
fee_asset = '<new fee asset>'
Use the new config with:
astria-go sequencer nonce <other args> --network new_network
Requirements:
- Go version 1.22 or newer
- Updated
gopls
settings for correct parsing of build tags
The CLI uses Cobra for structuring the command-line interface. To add new commands:
-
Install Cobra CLI:
go install github.com/spf13/cobra-cli@latest
-
Add a new command:
cobra-cli add <command-name>
TUI logs are written to ~/.astria/<instance>/astria-go.log
. This file is
overwritten each time you run the TUI.
# Run unit tests
just test
The integration tests require a running local sequencer network to test against. Prior to testing, run:
just run dev run --network local
In a new terminal window run:
# Run integration tests
just test-integration
# Run all tests
just test-all