Skip to content

Commit

Permalink
chore(docs): update tutorials (#113)
Browse files Browse the repository at this point in the history
Updated current tutorials:
- Run local rollup and sequencer
- Run local rollup against remote sequencer
  • Loading branch information
sambukowski authored Jan 29, 2025
1 parent 45b3e75 commit 869628d
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 51 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function sidebar() {
items: [
{text: 'Run a Local Rollup and Sequencer', link: '/tutorials/run-local-rollup-and-sequencer.md' },
{text: 'Run a Local Rollup against a Remote Sequencer', link: '/tutorials/run-local-rollup-against-remote-sequencer.md' },
{text: 'Run a novm-messenger Rollup', link: '/tutorials/novm-messenger-rollup.md' },
{text: 'Run a noVM-messenger Rollup', link: '/tutorials/novm-messenger-rollup.md' },
{text: 'Test Transactions', link: '/tutorials/test-transactions.md' }
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@
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
./build/bin/geth version
```

```bash [HTTPS]
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
./build/bin/geth version
```

:::
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/developer/spamooor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Requirements:

- [Go](https://go.dev/doc/install)

<!--@include: ../components/_git-clone-and-build-spamooor.md-->
<!--@include: ../components/_clone-build-spamooor.md-->

## Setup Your Environment for `spamooor`

Expand Down
81 changes: 47 additions & 34 deletions docs/tutorials/run-local-rollup-against-remote-sequencer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ Astria stack locally on your machine.

### Build Geth

Requires `Go`, `just`, and `Foundry`:
Requires `Go`, `just`, `make`, and `Foundry`:

- [Go](https://go.dev/doc/install)
- [Go](https://go.dev/doc/install) - specifically Go 1.21
- [just](https://github.com/casey/just)
- [make](https://www.gnu.org/software/make/)
- [Foundry](https://book.getfoundry.sh/getting-started/installation)

Open a new terminal window and clone and build Geth.

<!--@include: ../../components/_clone-geth.md-->
<!--@include: ../components/_clone-build-astria-geth.md-->

### Configure the Geth Genesis Information

Expand All @@ -26,10 +27,10 @@ additional genesis information to work with the remote sequencer.
Run the following using the Astira cli:

```bash
astria-go sequencer blockheight
astria-go sequencer blockheight --network dawn
```

Then, open the `geth-genesis-local.json` file and update the `chainId` and
Then, open the `dev/geth-genesis-local.json` file and update the `chainId` and
`astriaRollupName` to something of your choosing, as well as updating
`astriaSequencerInitialHeight` using the block height from the previous command
to choose which sequencer block the first block of your rollup will be in:
Expand All @@ -40,7 +41,7 @@ Create a new genesis account for your Geth rollup:
cast w new
```

Also in the `geth-genesis-local.json` file, update the `"alloc"` account with
Also in the `dev/geth-genesis-local.json` file, update the `"alloc"` account with
your new one:

```json{4-6,9}
Expand All @@ -60,7 +61,8 @@ your new one:

Keep the `chainId` and `astriaRollupName` you chose on hand, as they will also
be needed for running the [test transactions](./test-transactions.md) and
[configuring the Astria composer](#configure-the-local-astria-components) later on.
[configuring the Astria composer](#configure-the-local-astria-services) later
on.

:::tip
When starting a new rollup, it is always best to use the most recent height of
Expand All @@ -76,61 +78,72 @@ transactions](./test-transactions.md) later on.

## Start Geth

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

```bash
# in astria-geth dir
just init
just run
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 run
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 clean-restart
just -f dev/justfile clean-restart
```

## Configure the Local Astria components
## Configure the Local Astria Services

Open a new terminal window and initialize the cli:

```bash
astria-go dev init
```

When running against the remote sequencer, you will also need to create a new
sequencer account.

```bash
astria-go sequencer createaccount --insecure
```

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 `[networks.dusk]` sections using the same
`"astriaRollupName"` you used when [setting up your Geth
`rollup_name` variable in the `[local]` sections using the same
`"astriaRollupName"` you used when [setting up your astria-geth
rollup](#setup-a-geth-rollup).

```toml{5}
[networks.dusk]
sequencer_chain_id = 'astria-dusk-10'
sequencer_grpc = 'https://grpc.sequencer.dusk-10.devnet.astria.org/'
sequencer_rpc = 'https://rpc.sequencer.dusk-10.devnet.astria.org/'
rollup_name = '<your rollup name>' # update this value
[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>'
default_denom = 'ntia'
```

::: tip

You can perform the above steps using the following commands. `NEW_NAME` should
match the `"astriaRollupName"` in your `dev/geth-genesis-local.json`:

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

:::

When running against the remote sequencer, you will also need to create a new
sequencer account.

```bash
astria-go sequencer createaccount --insecure
```

Then open the `~/.astria/default/config/composer_dev_priv_key` and replace dev private
key in that file with your private key from the sequencer account you just
created.
Expand All @@ -141,19 +154,19 @@ but your Composer will not be able to submit transactions to the sequencer.
:::

You can then use the [Sequencer
Faucet](https://faucet.sequencer.dusk-10.devnet.astria.org/) to fund the account
Faucet](https://faucet.sequencer.dawn-1.astria.org/) to fund the account
you just created using the account address.

## Run the local Astria components against the Remote Sequencer
## Run the local Astria services against the Remote Sequencer

Run the local Astria components against the remote sequencer:

```bash
astria-go dev run --network dusk
astria-go dev run --network dawn
```

When running against the remote sequencer, you will see a TUI that displays the logs
of the Astria Conductor and Composer:
When running against the remote sequencer, you will see that the TUI only
displays the logs of the Astria Conductor and Composer:
![Running against a remote sequencer using the Astria
cli](./assets/dusk-10-go-cli-remote-sequencer.png)

Expand Down
13 changes: 8 additions & 5 deletions docs/tutorials/run-local-rollup-and-sequencer.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ View the source code

Requires `Go`, `just`, `make`, and `Foundry`:

- [Go](https://go.dev/doc/install)
- [Go](https://go.dev/doc/install) - specifically Go 1.21
- [just](https://github.com/casey/just)
- [make](https://www.gnu.org/software/make/)
- [Foundry](https://book.getfoundry.sh/getting-started/installation)

Open a new terminal window and clone and build Geth:

<!--@include: ../components/_clone-geth.md-->
<!--@include: ../../components/_clone-build-astria-geth.md-->

Create a new genesis account for your Geth rollup:

Expand Down Expand Up @@ -55,7 +55,6 @@ transactions](./test-transactions.md) later on.
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
```
Expand Down Expand Up @@ -95,15 +94,19 @@ Open the `~/.astria/default/networks-config.toml` file and update the
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
rollup_name = '<your rollup name>'
default_denom = 'ntia'
```

::: tip

You can perform the above steps using the following commands. `NEW_NAME` should
match the `"astriaRollupName"` in your `dev/geth-genesis-local.json`:

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

:::
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/test-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Requirements:

- [Go](https://go.dev/doc/install)

<!--@include: ../../components/_git-clone-and-build-spamooor.md-->
<!--@include: ../components/_clone-build-spamooor.md-->

## Configure Your Rollup Account

Expand All @@ -21,7 +21,7 @@ Make sure you have a local Geth rollup configured and running.
Add your private key from your testing account and the rollup rpc to the environment:

```bash
export PRIV_KEY="<your private key>" # DON'T include the '0x' prefix
export PRIV_KEY="<your astria-geth private key>" # DON'T include the '0x' prefix
export ROLLUP_RPC="http://localhost:8545"
```

Expand Down

0 comments on commit 869628d

Please sign in to comment.