From 67abfc1d2d168a177535d269e29c4bb452016960 Mon Sep 17 00:00:00 2001 From: Yarik Bratashchuk Date: Mon, 7 Oct 2024 11:46:18 +0000 Subject: [PATCH] Ingite-rollkit guides --- .vitepress/config.ts | 4 ++ .vitepress/constants/constants.js | 2 +- guides/cometbtf-to-rollkit.md | 61 ++++++++++++++++++++ guides/ignite-to-rollkit.md | 93 +++++++++++++++++++++++++++++++ guides/overview.md | 2 + 5 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 guides/cometbtf-to-rollkit.md create mode 100644 guides/ignite-to-rollkit.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 8133108f6..e1c56c36d 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -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, diff --git a/.vitepress/constants/constants.js b/.vitepress/constants/constants.js index d1043995c..8a0d6c439 100644 --- a/.vitepress/constants/constants.js +++ b/.vitepress/constants/constants.js @@ -11,6 +11,6 @@ const constants = Object.freeze({ localDALatestTag: "v0.3.1", - igniteVersionTag: "v28.4.0", + igniteVersionTag: "v28.5.3", }); export default constants; diff --git a/guides/cometbtf-to-rollkit.md b/guides/cometbtf-to-rollkit.md new file mode 100644 index 000000000..224b9e411 --- /dev/null +++ b/guides/cometbtf-to-rollkit.md @@ -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. + + + + +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. diff --git a/guides/ignite-to-rollkit.md b/guides/ignite-to-rollkit.md new file mode 100644 index 000000000..6827d2cde --- /dev/null +++ b/guides/ignite-to-rollkit.md @@ -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. + + + + +## 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. diff --git a/guides/overview.md b/guides/overview.md index bbe54be36..5529398dd 100644 --- a/guides/overview.md +++ b/guides/overview.md @@ -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)