Skip to content
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

fix: clean up the genesis guide and bring up to date #527

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

MSevey
Copy link
Contributor

@MSevey MSevey commented Dec 4, 2024

Overview

Closes #518

Summary by CodeRabbit

  • Documentation
    • Updated the "create-genesis" guide to include a new "0. Pre-requisites" section with essential setup steps.
    • Renamed and clarified existing sections for improved understanding, including the change from "rollup-chain" to "gm" for CHAIN_ID.
    • Removed the section on creating a restart script and updated commands for starting the chain.
    • Minor grammatical adjustments made for better readability.

Copy link
Contributor

coderabbitai bot commented Dec 4, 2024

Walkthrough

The document guides/create-genesis.md has been revised to enhance clarity and usability for users setting up a chain directory. Key changes include the addition of a "0. Pre-requisites" section, an updated CHAIN_ID, and renaming of existing sections for better organization. Specific commands for initializing the chain and resetting data have been clarified, while the section on creating a restart script has been removed. Minor grammatical improvements were also made throughout the document.

Changes

File Change Summary
guides/create-genesis.md - Added "0. Pre-requisites" section with commands for chain setup.
- Updated CHAIN_ID from rollup-chain to gm.
- Renamed section "2. Ensuring rollkit.toml is present..." to "2. Rebuild your chain" with new instructions.
- Clarified commands for resetting genesis and chain data.
- Removed section "10. Creating a restart script" and renumbered following sections.
- Updated command to start the chain with new flag format.
- Made minor grammatical adjustments for improved readability.

Assessment against linked issues

Objective Addressed Explanation
Make it clear that first step is setting terminal variables (518)
Add chain id variable to all bash commands and not rollupd (518)
Update to be wordle based for chain id (518) The changes do not reflect a wordle-based chain ID.
Need to figure out connection with build flow from wordle tutorial (518) The connection with the build flow is not explicitly addressed.

Suggested reviewers

  • tzdybal
  • Manav-Aggarwal
  • gupadhyaya

Poem

In the garden where ideas bloom,
A guide was crafted to dispel the gloom.
With chains now set and paths made clear,
Hop along, dear friends, the time is near!
Variables updated, commands refined,
A brighter genesis for all to find! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Dec 4, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://rollkit.github.io/docs-preview/./pr-527/
on branch main at 2024-12-04 15:44 UTC

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
guides/create-genesis.md (4)

5-6: Fix typo in section heading

The word "Pre-requisities" should be "Prerequisites"

-## 0. Pre-requisities 
+## 0. Prerequisites 
🧰 Tools
🪛 LanguageTool

[typographical] ~6-~6: Use a comma after an introductory phrase.
Context: ...art the chain. ## 0. Pre-requisities For this guide you need to have a chain directory wher...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


27-37: Add explanations for environment variables

The variables are well-structured, but adding explanations would help users understand their purpose.

 ```sh
+# Name of your validator node
 VALIDATOR_NAME=validator1
+# Unique identifier for your chain
 CHAIN_ID=gm
+# Name for the key in your keyring
 KEY_NAME=rollup-key
+# Chain ID flag used in commands
 CHAINFLAG="--chain-id ${CHAIN_ID}"
+# Initial token amount for genesis account
 TOKEN_AMOUNT="10000000000000000000000000stake"
+# Amount of tokens to stake for validator
 STAKING_AMOUNT="1000000000stake"

---

`52-55`: **Use platform-agnostic path examples**

The current example uses a macOS-style path. Consider using a more generic example and mentioning platform differences.

```diff
 ```sh
 [chain]
-  config_dir = "/Users/you/.gm"
+  # On Unix-like systems (Linux/macOS): $HOME/.gm
+  # On Windows: %USERPROFILE%\.gm
+  config_dir = "/path/to/your/.gm"

---

Line range hint `1-142`: **Consider adding section prerequisites and expected outcomes**

While the guide is well-structured, each major section could benefit from:
1. Brief explanation of why the step is necessary
2. What the expected outcome is
3. How to verify the step was successful

This would help users better understand the process and troubleshoot issues.

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[typographical] ~6-~6: Use a comma after an introductory phrase.
Context: ...art the chain.  ## 0. Pre-requisities   For this guide you need to have a chain directory wher...

(COMMA_INTRODUCTORY_WORDS_PHRASES)

</details>

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0ea3d02d39b8cd824da879f0c2f9f17ed7c4eece and 60c6d1b3c86283d78f7bf712a556eb5b47d95166.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `guides/create-genesis.md` (2 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>guides/create-genesis.md</summary>

[typographical] ~6-~6: Use a comma after an introductory phrase.
Context: ...art the chain.  ## 0. Pre-requisities   For this guide you need to have a chain directory wher...

(COMMA_INTRODUCTORY_WORDS_PHRASES)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (2)</summary>

<details>
<summary>guides/create-genesis.md (2)</summary>

`12-19`: **Verify the Ignite CLI commands and add explanatory comments**

While the commands are correct, it would be helpful to add brief explanations for what each command does. Also, we should verify the rollkit version being used.



Consider adding comments to explain each command:
```diff
 ```sh
+# Initialize a new chain named 'gm' with minimal configuration
 ignite scaffold chain gm --address-prefix gm --minimal --skip-proto
 cd gm
+# Install rollkit from the Ignite apps repository
 ignite app install github.com/ignite/apps/rollkit@rollkit/v0.2.1
+# Add rollkit support to your chain
 ignite rollkit add
 ignite chain build
+# Initialize rollkit configuration
 ignite rollkit init
 rollkit toml init

<details>
<summary>✅ Verification successful</summary>

**Update documentation with command explanations, rollkit version is current**

The rollkit version v0.2.1 used in the documentation is the latest available version, so no version update is needed. The suggested explanatory comments will help users better understand the purpose of each command.

```diff
 ```sh
+# Initialize a new chain named 'gm' with minimal configuration
 ignite scaffold chain gm --address-prefix gm --minimal --skip-proto
 cd gm
+# Install rollkit from the Ignite apps repository
 ignite app install github.com/ignite/apps/rollkit@rollkit/v0.2.1
+# Add rollkit support to your chain
 ignite rollkit add
+# Build the blockchain application
 ignite chain build
+# Initialize rollkit configuration
 ignite rollkit init
+# Create initial rollkit TOML configuration file
 rollkit toml init



</details>

<details>
<summary>🏁 Scripts executed</summary>

The following scripts were executed for the analysis:

Script:

```shell
#!/bin/bash
# Check if there's a newer compatible version of rollkit
gh api graphql -f query='
{
  repository(owner: "ignite", name: "apps") {
    refs(refPrefix: "refs/tags/rollkit/", first: 5, orderBy: {field: TAG_COMMIT_DATE, direction: DESC}) {
      nodes {
        name
      }
    }
  }
}'

Length of output: 328


137-137: Verify the start command flags

The command has been simplified to use only essential flags. Let's verify if any important flags were removed.

✅ Verification successful

Based on the search results, I can now generate the final response:

The simplified command retains the essential flags for basic functionality

The command in create-genesis.md uses the fundamental flags --rollkit.aggregator and --rollkit.sequencer_rollup_id which are consistent with other basic examples in the codebase. Additional optional flags exist for specific use cases:

  • --rollkit.da_address - for custom DA endpoint configuration
  • --rollkit.block_time - for custom block time settings
  • --rollkit.max_pending_blocks - for pending block limit
  • --rollkit.lazy_aggregator - for lazy sequencing mode
  • --rollkit.da_gas_price - for custom gas pricing
  • --minimum-gas-prices - for minimum gas price requirements

The simplified command is appropriate for the basic setup in the genesis guide, while other guides demonstrate how to use additional flags for specific features.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any other start command variations in the codebase
rg --type md "rollkit start.*--rollkit\." -g '!{guides/create-genesis.md}'

Length of output: 1318

guides/create-genesis.md Show resolved Hide resolved
@MSevey MSevey enabled auto-merge (squash) December 4, 2024 15:46
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (5)
guides/create-genesis.md (5)

5-13: Grammar and clarity improvements needed in prerequisites section

A few suggestions to improve clarity:

  • Line 7: Add a comma after "For this guide"
  • Line 12: Add "the" before "linked guide"
-For this guide you need to have a chain directory where you have created and built your chain. 
+For this guide, you need to have a chain directory where you have created and built your chain. 

-This guide will use the simple ignite chain created in linked guide.
+This guide will use the simple ignite chain created in the linked guide.
🧰 Tools
🪛 LanguageTool

[typographical] ~6-~6: Use a comma after an introductory phrase.
Context: ...art the chain. ## 0. Pre-requisities For this guide you need to have a chain directory wher...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[uncategorized] ~12-~12: You might be missing the article “the” here.
Context: ... use the simple ignite chain created in linked guide. Make sure to update any relevant...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


17-27: Add explanations for configuration variables

Consider adding brief explanations for each variable to help users understand their purpose and expected values. This is especially important for values like 10000000000000000000000000stake which might not be self-explanatory.

First, set the necessary variables for your chain in the terminal, here is an example:

```sh
+# Name of your validator node
VALIDATOR_NAME=validator1
+# Unique identifier for your chain
CHAIN_ID=gm
+# Name for the key that will be created
KEY_NAME=rollup-key
CHAINFLAG="--chain-id ${CHAIN_ID}"
+# Initial token amount for the genesis account (100M tokens)
TOKEN_AMOUNT="10000000000000000000000000stake"
+# Amount to stake for the validator
STAKING_AMOUNT="1000000000stake"

---

`124-127`: **Add explanations for rollkit flags**

The start command uses flags that should be explained to help users understand their purpose.

```diff
For example, start the simple ignite chain with the following command:

```sh
+# Start the chain with the following flags:
+# --rollkit.aggregator: Enable aggregator mode
+# --rollkit.sequencer_rollup_id: Set the rollup ID to match chain ID
rollkit start --rollkit.aggregator --rollkit.sequencer_rollup_id $CHAIN_ID

---

`132-132`: **Fix grammar in summary**

The verb tense in the summary needs correction.

```diff
-By following these steps, you will set up the genesis for your rollup, initialize the validator, add a genesis account, and started the chain.
+By following these steps, you will set up the genesis for your rollup, initialize the validator, add a genesis account, and start the chain.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~132-~132: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...e validator, add a genesis account, and started the chain. This guide provides a basic ...

(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)


Line range hint 1-132: Consider adding validation steps throughout the guide

To improve reliability, consider adding validation steps after key operations. For example:

  • After initializing the validator, verify the config directory structure
  • After adding genesis account, verify the account exists
  • After collecting gentxs, verify the genesis file structure

This would help users confirm each step completed successfully before proceeding.

🧰 Tools
🪛 LanguageTool

[typographical] ~6-~6: Use a comma after an introductory phrase.
Context: ...art the chain. ## 0. Pre-requisities For this guide you need to have a chain directory wher...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[uncategorized] ~12-~12: You might be missing the article “the” here.
Context: ... use the simple ignite chain created in linked guide. Make sure to update any relevant...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 60c6d1b and ed4bde7.

📒 Files selected for processing (1)
  • guides/create-genesis.md (2 hunks)
🧰 Additional context used
🪛 LanguageTool
guides/create-genesis.md

[typographical] ~6-~6: Use a comma after an introductory phrase.
Context: ...art the chain. ## 0. Pre-requisities For this guide you need to have a chain directory wher...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[uncategorized] ~12-~12: You might be missing the article “the” here.
Context: ... use the simple ignite chain created in linked guide. Make sure to update any relevant...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~132-~132: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...e validator, add a genesis account, and started the chain. This guide provides a basic ...

(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)

🔇 Additional comments (1)
guides/create-genesis.md (1)

57-68: Add warning about permanent data loss

These commands will permanently delete chain data. A warning should be added to prevent accidental data loss.

+:::warning
+These commands will permanently delete all chain data and genesis configuration. Make sure you have backups if needed.
+:::
+
Reset any existing chain data:

guides/create-genesis.md Show resolved Hide resolved
Copy link
Contributor

@tuxcanfly tuxcanfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

guides/create-genesis.md Show resolved Hide resolved
@MSevey MSevey merged commit 148a9ad into main Dec 5, 2024
6 checks passed
@MSevey MSevey deleted the genesis-guide-cleanup branch December 5, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Review and Update Genesis How to Guide
3 participants