Skip to content

Commit

Permalink
Ingite-rollkit guides
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikbratashchuk committed Oct 7, 2024
1 parent c5f856f commit 67abfc1
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ function sidebarHome() {
text: "Run a rollup full node",
link: "/guides/full-node",
},
{
text: "Turn your CometBFT app into a Rollkit app",
link: "/guides/cometbft-to-rollkit",
},
{
text: "Configuration",
collapsed: true,
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ const constants = Object.freeze({

localDALatestTag: "v0.3.1",

igniteVersionTag: "v28.4.0",
igniteVersionTag: "v28.5.3",
});
export default constants;
61 changes: 61 additions & 0 deletions guides/cometbtf-to-rollkit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# How to Turn Your CometBFT App into a Rollkit App

This guide will walk you through the process of turning your existing CometBFT app into a Rollkit app. By integrating Rollkit into your CometBFT-based blockchain, you can leverage enhanced modularity and data availability features.

<!-- markdownlint-disable MD033 -->
<script setup>
import Callout from '../.vitepress/components/callout.vue'
import constants from '../.vitepress/constants/constants.js'
</script>

This guide assumes you have a CometBFT app set up and [Ignite CLI](https://docs.ignite.com) installed.

## Install Rollkit {#install-rollkit}

You need to install Rollkit in your CometBFT app. Open a terminal in the directory where your app is located and run the following command:

```bash
ignite app install github.com/ignite/apps/rollkit@rollkit/v0.2.0
```

## Add Rollkit Features to Your CometBFT App {#add-rollkit-features}

Now that Rollkit is installed, you can add Rollkit features to your existing blockchain app. Run the following command to integrate Rollkit:

```bash
ignite rollkit add
```

## Initialize Rollkit with Local DA {#initialize-rollkit-local-da}

To prepare your app for Rollkit, you'll need to initialize it with Local Data Availability (Local DA). This allows your app to interact with a lightweight, testable DA layer.

Run the following command to initialize Rollkit with Local DA:

```bash
ignite rollkit init --local-da
```

## Initialize Rollkit CLI Configuration {#initialize-rollkit-cli-configuration}

Next, you'll need to initialize the Rollkit CLI configuration by generating the `rollkit.toml` file. This file is crucial for Rollkit to understand the structure of your rollup.

To create the `rollkit.toml` configuration, use this command:

```bash
rollkit toml init
```

This command sets up the `rollkit.toml` file, where you can further customize configuration parameters as needed.

## Start Your Rollkit App {#start-rollkit-app}

Once everything is configured, you can start your Rollkit-enabled CometBFT app or (simply rollkit app). Use the following command to start your blockchain:

```bash
rollkit start --rollkit.aggregator --rollkit.da_address http://localhost:7980
```

## Summary

By following this guide, you've successfully converted your CometBFT app into a Rollkit app.
93 changes: 93 additions & 0 deletions guides/ignite-to-rollkit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# How to Use Ignite to Create a Rollkit App

This guide will walk you through the process of using Ignite to create a Rollkit app.

<!-- markdownlint-disable MD033 -->
<script setup>
import Callout from '../.vitepress/components/callout.vue'
import constants from '../.vitepress/constants/constants.js'
</script>

## Install Ignite {#install-ignite}

You can read more about Ignite [here](https://docs.ignite.com).

To install Ignite, you can run this command in your terminal:

```bash-vue
curl https://get.ignite.com/cli@{{constants.igniteVersionTag}}! | bash
```

Once Ignite is installed, scaffold a new blockchain with the following command:

```bash
ignite scaffold chain gm --address-prefix gm --minimal --skip-proto
```

This will create the `gm` blockchain. Navigate to the blockchain directory:

```bash
cd gm
```

## Run a local Data Availability (DA) node {#run-local-da-node}

First, set up a local data availability network node:

```bash-vue
cd $HOME && curl -sSL https://rollkit.dev/install-local-da.sh | sh -s {{constants.localDALatestTag}}
```

This script builds and runs a DA node, which will listen on port `7980`.

## Install Ignite App Rollkit {#install-ignite-app-rollkit}

In a new terminal window, you'll now install and run the Ignite App Rollkit.

Run the following command to install the Rollkit App:

```bash
ignite app install github.com/ignite/apps/rollkit@rollkit/v0.2.0
```

This installs the Rollkit application, which will be integrated into your blockchain.

## Add Rollkit Features {#add-rollkit-features}

Enhance your blockchain by adding Rollkit features. Use the following command:

```bash
ignite rollkit add
```

## Initialize Your Blockchain {#initialize-your-blockchain}

Before starting your blockchain, you need to initialize it with Rollkit support. Initialize the blockchain with Local DA as follows:

```bash
ignite rollkit init --local-da
```

### Initialize Rollkit CLI Configuration {#initialize-rollkit-cli-configuration}

To initialize the Rollkit CLI configuration, generate the `rollkit.toml` file by running the following command:

```bash
rollkit toml init
```

This will set up the Rollkit configuration file rollkit.toml, allowing you to use the Rollkit CLI for managing and running your blockchain.

## Start Your Rollup {#start-your-blockchain}

Finally, start your rollup (blockchain) using the following command:

```bash
rollkit start --rollkit.aggregator --rollkit.da_address http://localhost:7980
```

Your rollkit app is now up and running.

## Summary

By following these steps, you've successfully installed Ignite, set up Local DA, integrated Rollkit features into your blockchain, and configured the Rollkit CLI.
2 changes: 2 additions & 0 deletions guides/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ In this section, you'll find:
* [Create genesis for your rollup](/guides/create-genesis)
* [Restart your rollup](/guides/restart-rollup)
* [Run a rollup full node](/guides/full-node)
* [Turn your CometBFT app into a Rollkit app](/guides/cometbft-to-rollkit)
* [Use ignite to create a rollkit app](/guides/ignite-to-rollkit)
* Configuration
* [Configure gas price](/guides/gas-price)
* [Configure max pending blocks](/guides/max-pending-blocks)
Expand Down

0 comments on commit 67abfc1

Please sign in to comment.