-
Notifications
You must be signed in to change notification settings - Fork 57
feat: update sequencing section to include local sequencer and steps to connect sequencers with rollups #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Astria Sequencing | ||
|
||
Coming soon ... | ||
|
||
Track progress on the [GitHub](https://github.com/rollkit/astria-sequencer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Based Sequencing | ||
|
||
Coming soon ... | ||
|
||
Track progress on the [GitHub](https://github.com/rollkit/based-sequencer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# Centralized Sequencer | ||
|
||
<!-- markdownlint-disable MD033 --> | ||
<script setup> | ||
import constants from '../../.vitepress/constants/constants.js' | ||
</script> | ||
|
||
A centralized sequencer is a sequencing middleware that receives rollup transactions and provides a local sequencing capabilities. Meaning, the transactions are ordered in the order they are received by the sequencer without any censorship. Further, the sequenced batches are made available in the DA network (such as Celestia). Under the hood, the centralized sequencer is a GRPC server that implements `go-sequencing` interface and the server is hosted by the same node that is running the aggregator for the Rollkit rollup. | ||
|
||
 | ||
|
||
## Prerequisites {#prerequisites} | ||
|
||
This tutorial serves as a comprehensive guide for using the [centralized-sequencer](https://github.com/rollkit/centralized-sequencer) with your chain. | ||
|
||
Before proceeding, ensure that you have completed the [quick start](/tutorials/quick-start) or [build a chain](/tutorials/wordle) tutorial, which covers installing the rollkit CLI, building your chain, and running your chain. | ||
|
||
:::tip | ||
It is important to note that the centralized sequencer expects a DA layer to be running when it starts. This means that you need to launch your DA Layer before starting the centralized sequencer. | ||
::: | ||
|
||
Additionally, you should have completed one of the [DA Layer tutorials](../da/overview) and have your DA layer ready to use with the centralized sequencer. This tutorial will use the [local-da layer](../da/local) as an example. | ||
|
||
## Installation the Centralized Sequencer {#installation-centralized-sequencer} | ||
|
||
```sh-vue | ||
git clone --depth 1 --branch {{constants.centralizedSequencerLatestTag}} https://github.com/rollkit/centralized-sequencer.git | ||
cd centralized-sequencer | ||
make build | ||
./build/centralized-sequencer -h | ||
``` | ||
|
||
```sh | ||
Usage: | ||
-host string | ||
centralized sequencer host (default "localhost") | ||
-port string | ||
centralized sequencer port (default "50051") | ||
-listen-all | ||
listen on all network interfaces (0.0.0.0) instead of just localhost | ||
-rollup-id string | ||
rollup id (default "rollupId") | ||
-batch-time duration | ||
time in seconds to wait before generating a new batch (default 2s) | ||
-da_address string | ||
DA address (default "http://localhost:26658") | ||
-da_auth_token string | ||
auth token for the DA | ||
-da_namespace string | ||
DA namespace where the sequencer submits transactions | ||
-db_path string | ||
path to the database | ||
``` | ||
|
||
As shown by the help command, a centralized sequencer is configured to serve a rollup (via `rollup_id`). The DA network to persist the sequenced batches are specified using `da_address`, `da_auth_token` and `da_namespace`. | ||
|
||
|
||
## Run the centralized sequencer {#run-the-centralized-sequencer} | ||
|
||
:::tip | ||
As mentioned in the prerequisities, you should have your DA layer running. These steps assume the local-da is running on `http://localhost:7980`. | ||
::: | ||
|
||
Start your centralized sequencer with the following command: | ||
|
||
::: code-group | ||
|
||
```sh [Quick Start] | ||
./build/centralized-sequencer -rollup-id my-rollup -da_address http://localhost:7980 | ||
``` | ||
|
||
```sh [Build a Chain] | ||
./build/centralized-sequencer -rollup-id wordle -da_address http://localhost:7980 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just realized that we have underscore and dash in flags, when we can have only underscores |
||
``` | ||
::: | ||
|
||
|
||
## Run your chain {#run-your-chain} | ||
|
||
To connect your chain to the centralized sequencer, you need to pass the `--rollkit.sequencer_address` flag with the local sequencer address and the `--rollkit.sequencer_rollup_id` to ensure your rollup id matches what the sequencer is expecting. | ||
|
||
Start your chain with the following command, ensuring to include the sequencer flag: | ||
|
||
::: code-group | ||
|
||
```sh [Quick Start] | ||
rollkit start \ | ||
--rollkit.da_address http://localhost:7980 \ | ||
--rollkit.sequencer_address localhost:50051 \ | ||
--rollkit.sequencer_rollup_id my-rollup | ||
``` | ||
|
||
```sh [Wordle Chain] | ||
rollkit start \ | ||
--rollkit.aggregator \ | ||
--rollkit.da_address http://localhost:7980 \ | ||
--rollkit.sequencer_address localhost:50051 \ | ||
--rollkit.sequencer_rollup_id wordle | ||
``` | ||
|
||
::: | ||
|
||
You should see the following log messages indicating that your chain is connected to the local sequencer: | ||
|
||
```sh | ||
I[2024-11-15|15:22:33.636] sequencer already running module=main address=localhost:50051 | ||
I[2024-11-15|15:22:33.636] make sure your rollupID matches your sequencer module=main rollupID=my-rollup | ||
``` | ||
|
||
Then after a few blocks you should see this message confirming that your sequencer is successfully submitting batches to the DA layer: | ||
|
||
```sh | ||
I[2024-11-15|16:04:07.698] successfully submitted Rollkit headers to DA layer module=BlockManager gasPrice=-1 daHeight=1 headerCount=14 | ||
``` | ||
MSevey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Summary {#summary} | ||
|
||
By following these steps, you will have successfully set up and connected your chain to the centralized sequencer. You can now start submitting transactions to your chain. |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Local Sequencer | ||
|
||
<!-- markdownlint-disable MD033 --> | ||
<script setup> | ||
import constants from '../../.vitepress/constants/constants.js' | ||
</script> | ||
|
||
## Introduction {#introduction} | ||
|
||
This tutorial serves as a comprehensive guide for using the [local-sequencer](https://github.com/rollkit/go-sequencing) with your chain. | ||
|
||
Before proceeding, ensure that you have completed the [quick start](/tutorials/quick-start) or [build a chain](/tutorials/wordle) tutorial, which covers installing the rollkit CLI, building your chain, and running your chain. | ||
|
||
## Setting Up a Local Local Sequencer | ||
|
||
To set up a local sequencer on your machine, run the following script to install and start the local sequencer: | ||
|
||
::: code-group | ||
|
||
```bash-vue [Quick Start] | ||
curl -sSL https://rollkit.dev/install-local-sequencer.sh | bash -s {{constants.goSequencingLatestTag}} my-rollup | ||
``` | ||
MSevey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```bash-vue [Build a Chain] | ||
curl -sSL https://rollkit.dev/install-local-sequencer.sh | bash -s {{constants.goSequencingLatestTag}} wordle | ||
``` | ||
|
||
::: | ||
|
||
This script will build and run the sequencer, which will then listen on port `50051` with the `rollup-id` of your chain. | ||
|
||
## Configuring your chain to connect to the local sequencer | ||
|
||
To connect your chain to the local sequencer, you need to pass the `--rollkit.sequencer_address` flag with the centralized sequencer address and the `--rollkit.sequencer_rollup_id` to ensure your rollup id matches what the sequencer is expecting. | ||
|
||
## Run your chain | ||
|
||
Start your chain with the following command, ensuring to include the sequencer flag: | ||
|
||
::: code-group | ||
|
||
```sh [Quick Start] | ||
rollkit start \ | ||
--rollkit.sequencer_address localhost:50051 \ | ||
--rollkit.sequencer_rollup_id my-rollup | ||
``` | ||
|
||
```sh [Wordle Chain] | ||
rollkit start \ | ||
--rollkit.aggregator \ | ||
--rollkit.sequencer_address localhost:50051 \ | ||
--rollkit.sequencer_rollup_id wordle | ||
``` | ||
|
||
::: | ||
|
||
You should see the following log messages indicating that your chain is connected to the local sequencer: | ||
|
||
```sh | ||
I[2024-11-15|15:22:33.636] sequencer already running module=main address=localhost:50051 | ||
I[2024-11-15|15:22:33.636] make sure your rollupID matches your sequencer module=main rollupID=my-rollup | ||
``` | ||
|
||
## Summary | ||
|
||
By following these steps, you will have successfully set up and connected your chain to the local sequencer. You can now start submitting transactions to your chain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.