-
Notifications
You must be signed in to change notification settings - Fork 57
feat: add DA overview and bring local-da into tutorials #509
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 1 commit
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Deploying a rollup to Avail | ||
# Using Avail as DA | ||
|
||
## 🌞 Introduction {#introduction} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Using Local DA | ||
|
||
<!-- 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-da](https://github.com/rollkit/local-da) 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 DA Network | ||
|
||
To set up a local DA network node on your machine, run the following script to install and start the local DA node: | ||
|
||
```bash-vue | ||
curl -sSL https://rollkit.dev/install-local-da.sh | bash -s {{constants.localDALatestTag}} | ||
``` | ||
|
||
This script will build and run the node, which will then listen on port `7980`. | ||
|
||
## Configuring your rollup to connect to the local DA network | ||
|
||
To connect your rollup to the local DA network, you need to pass the `--rollkit.da_address` flag with the local DA node address. | ||
|
||
## Run your rollup | ||
|
||
Start your rollup node with the following command, ensuring to include the DA address flag: | ||
|
||
::: code-group | ||
|
||
```sh [Quick Start] | ||
rollkit start --rollkit.da_address http://localhost:7980 | ||
``` | ||
|
||
```sh [Wordle Chain] | ||
rollkit start \ | ||
--rollkit.aggregator \ | ||
--rollkit.da_address http://localhost:7980 \ | ||
--rollkit.sequencer_rollup_id wordle | ||
``` | ||
|
||
::: | ||
|
||
You should see the following log message indicating that your rollup is connected to the local DA network: | ||
|
||
```shell | ||
I[2024-11-15|14:54:19.842] DA server is already running module=main address=http://localhost:7980 | ||
``` | ||
|
||
## Summary | ||
|
||
By following these steps, you will set up a local DA network node and configure your rollup to post data to it. This setup is useful for testing and development in a controlled environment. |
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,50 @@ | ||
--- | ||
description: This page provides an overview of how rollkit integrates with DA. | ||
--- | ||
|
||
<!-- markdownlint-disable MD033 --> | ||
|
||
# DA | ||
|
||
Now that you have the foundations of running and building a rollup with Rollkit, it is time to start customizing it to fit your needs. | ||
|
||
The first choice you need to make is which data availability (DA) layer to use. The DA layer is a critical component of a blockchain, as it provides the data availability and finality guarantees that your chain needs to operate securely. | ||
|
||
Rollkit uses the [go-da interface](https://github.com/rollkit/go-da) to communicate to DA layers. Any DA layer that implements this interface can be used with Rollkit. | ||
|
||
## Go DA {#go-da} | ||
|
||
The [go-da interface](https://github.com/rollkit/go-da) defines the core functions required to interact with a DA layer. Probably the two most important functions being `Get` and `Submit`. | ||
|
||
```go | ||
// DA defines very generic interface for interaction with Data Availability layers. | ||
type DA interface { | ||
// Get returns Blob for each given ID, or an error. | ||
Get(ctx context.Context, ids []ID, namespace Namespace) ([]Blob, error) | ||
|
||
// Submit submits the Blobs to Data Availability layer. | ||
Submit(ctx context.Context, blobs []Blob, gasPrice float64, namespace Namespace) ([]ID, error) | ||
} | ||
``` | ||
|
||
DA layers can integrate the `go-da` interface directly into their node like [Celestia](celestia-da), or they can define a middleware service like [Avail](avail-da). | ||
|
||
## Mock DA {#mock-da} | ||
|
||
You might have noticed that we did not define any DA layer during the [quick start](../quick-start.md) or [build a chain](../wordle.md) tutorials. This is because we used a mock DA layer that is built into Rollkit. | ||
|
||
If you revisit the logs from those tutorials, you will see one of the first lines being: | ||
|
||
```shell | ||
I[2024-11-15|14:09:41.735] Starting mock DA server module=main address=http://localhost:26658 | ||
``` | ||
|
||
The mock DA layer is a simple in-memory DA layer that is great for testing and development. It is not suitable for production use, as it does not provide the data availability and finality guarantees that a real DA layer would. | ||
|
||
## DA Layers {#da-layers} | ||
|
||
Now that you have a better understanding of what a DA layer is, you can start to explore the different DA layers that are available to use with Rollkit. | ||
|
||
* [Local DA](local-da.md) | ||
* [Celestia DA](celestia-da.md) | ||
* [Avail DA](avail-da.md) |
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.