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

Build an oapp #790

Merged
merged 26 commits into from
Sep 6, 2024
Merged

Build an oapp #790

merged 26 commits into from
Sep 6, 2024

Conversation

alijnmerchant21
Copy link
Collaborator

@alijnmerchant21 alijnmerchant21 commented Sep 5, 2024

This PR is aimed to demonstrate how to deploy a simple Hello World smart contract using cosmwasm.

Summary by CodeRabbit

  • Documentation
    • Enhanced the guide for creating and deploying a "Hello World" smart contract, providing detailed instructions and prerequisites.
    • Improved clarity and accessibility of the WardenJS documentation with a concise introduction and navigation adjustments.
    • Streamlined the introduction to Omnichain Applications (OApps) and reorganized content for better readability.
    • Adjusted sidebar positions for various documents to improve navigation structure.
    • Removed a dropdown menu in the documentation configuration for a cleaner sidebar layout.

Copy link
Contributor

coderabbitai bot commented Sep 5, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

Walkthrough

The documentation has been significantly restructured and expanded to improve clarity and usability for developers. Key changes include detailed guides for creating smart contracts, adjustments to sidebar positions for better navigation, and the removal of outdated content. The configuration file has been updated to ensure consistent labeling and streamline navigation by removing a dropdown menu.

Changes

Files Change Summary
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md Restructured with detailed sections, prerequisites, step-by-step instructions, and Rust code snippets for smart contract development.
docs/developer-docs/docs/build-an-app/build-with-wardenjs.md Adjusted sidebar position and replaced placeholder text with an introduction to WardenJS.
docs/developer-docs/docs/build-an-app/examples-of-oapps.md Changed sidebar position from 2 to 4, affecting navigation order.
docs/developer-docs/docs/build-an-app/introduction.md Removed overview section, streamlined introduction, and restructured "Get started" section into a bulleted list.
docs/developer-docs/docs/build-an-app/useful-links.md Changed sidebar position from 7 to 3, altering the order in the navigation structure.
docs/developer-docs/docusaurus.config.ts Changed sidebar item label for consistency and removed a dropdown menu for a streamlined navigation.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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

vercel bot commented Sep 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
warden-help-center ⬜️ Ignored (Inspect) Visit Preview Sep 6, 2024 7:52am

ijonele
ijonele previously approved these changes Sep 5, 2024
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: 5

Outside diff range, codebase verification and nitpick comments (2)
docs/developer-docs/docs/build-an-app/build-with-wardenjs.md (1)

7-7: Suggest a minor stylistic improvement.

Consider revising the phrase to enhance conciseness:

  • Original: "...with all of the proto and amino encoding handled for you."
  • Suggested: "...with all proto and amino encoding handled for you."
Tools
LanguageTool

[style] ~7-~7: Consider removing “of” to be more concise
Context: ...to compose and broadcast messages, with all of the proto and amino encoding handled for yo...

(ALL_OF_THE)

docs/developer-docs/docs/build-an-app/introduction.md (1)

15-25: Links in the "Get started" section are broken.

All the links in the "Get started" section of the documentation return a 404 status code, indicating that the resources are not available at the specified URLs. Please verify and update the links to ensure they point to the correct resources.

Analysis chain

Verify the links and approve the new format.

The restructuring into a bulleted list format enhances readability and navigability. Please verify that all links are correct and functional.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the links in the "Get started" section are functional.

# Test: Check if the URLs are reachable. Expect: HTTP status code 200 for each.
curl -o /dev/null --silent --head --write-out '%{http_code}' https://help.wardenprotocol.org/build-a-custom-smart-contract
curl -o /dev/null --silent --head --write-out '%{http_code}' https://help.wardenprotocol.org/build-with-wardenjs
curl -o /dev/null --silent --head --write-out '%{http_code}' https://help.wardenprotocol.org/useful-links
curl -o /dev/null --silent --head --write-out '%{http_code}' https://help.wardenprotocol.org/examples-of-oapps

Length of output: 473

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dc5c494 and 86a1baf.

Files selected for processing (6)
  • docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (1 hunks)
  • docs/developer-docs/docs/build-an-app/build-with-wardenjs.md (1 hunks)
  • docs/developer-docs/docs/build-an-app/examples-of-oapps.md (1 hunks)
  • docs/developer-docs/docs/build-an-app/introduction.md (1 hunks)
  • docs/developer-docs/docs/build-an-app/useful-links.md (1 hunks)
  • docs/developer-docs/docusaurus.config.ts (2 hunks)
Files skipped from review due to trivial changes (3)
  • docs/developer-docs/docs/build-an-app/examples-of-oapps.md
  • docs/developer-docs/docs/build-an-app/useful-links.md
  • docs/developer-docs/docusaurus.config.ts
Additional context used
Path-based instructions (3)
docs/developer-docs/docs/build-an-app/build-with-wardenjs.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

docs/developer-docs/docs/build-an-app/introduction.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

LanguageTool
docs/developer-docs/docs/build-an-app/build-with-wardenjs.md

[style] ~7-~7: Consider removing “of” to be more concise
Context: ...to compose and broadcast messages, with all of the proto and amino encoding handled for yo...

(ALL_OF_THE)

docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md

[uncategorized] ~13-~13: Possible missing article found.
Context: ...erequisites Before you start, complete following prerequisites: - Install Rust by runni...

(AI_HYDRA_LEO_MISSING_THE)


[uncategorized] ~46-~46: Loose punctuation mark.
Context: ... is preconfigured and ready for use. ::: ## 1. Create a new CosmWasm project ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~179-~179: Possible missing comma found.
Context: ...e contract by using the command below. Before you should replace replace 1 with the...

(AI_HYDRA_LEO_MISSING_COMMA)


[duplication] ~180-~180: Possible typo: you repeated a word
Context: ...g the command below. Before you should replace replace 1 with the actual code ID you retriev...

(ENGLISH_WORD_REPEAT_RULE)

Markdownlint
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md

23-23: Expected: 2; Actual: 3
Unordered list indentation

(MD007, ul-indent)


25-25: Expected: 2; Actual: 3
Unordered list indentation

(MD007, ul-indent)


27-27: Expected: 2; Actual: 3
Unordered list indentation

(MD007, ul-indent)


41-41: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


151-151: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Additional comments not posted (10)
docs/developer-docs/docs/build-an-app/build-with-wardenjs.md (2)

2-2: Sidebar position adjustment approved.

The change in sidebar position from 4 to 3 is noted and aligns with the PR's objective to improve navigation.


9-9: Documentation link addition approved.

The inclusion of a direct link to the WardenJS documentation is a useful addition for users seeking more detailed information.

docs/developer-docs/docs/build-an-app/introduction.md (2)

13-13: Approve the structural change.

The introduction of the "Section overview" header enhances document navigation and clarity.


Line range hint 1-11: Verify the link and approve the introduction's clarity.

The introduction provides a clear overview of Omnichain Applications. Please verify that the link to SpaceWard is correct and functional.

Verification successful

Link to SpaceWard is functional and introduction is clear.

The link to SpaceWard is verified to be functional with an HTTP status code of 200. The introduction provides a clear overview of Omnichain Applications. No issues found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the link to SpaceWard is functional.

# Test: Check if the URL is reachable. Expect: HTTP status code 200.
curl -o /dev/null --silent --head --write-out '%{http_code}' https://help.wardenprotocol.org

Length of output: 98

docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (6)

2-2: Sidebar Positioning

The sidebar position is set correctly to ensure this document appears in the intended order within the documentation.


9-9: Clear Introduction

The introduction clearly states the purpose of the guide, which is to demonstrate the creation and deployment of a "Hello World" smart contract on the Warden chain.


17-19: Correct Installation Command

The Rust installation command using curl is correctly formatted and uses secure protocols, which is good practice.


59-105: Detailed Contract Code Explanation

The provided Rust code snippets for the smart contract are well-detailed, showing the use of various CosmWasm functionalities. This section effectively demonstrates how to modify the contract code, which is crucial for understanding smart contract development.


219-221: Support Channels Mentioned

The document concludes with links to support channels, which is helpful for users who may encounter issues. This inclusion enhances the document's utility by providing direct assistance options.


45-46: Loose Punctuation Mark

The loose punctuation mark ::: is likely a formatting error. It should be corrected or removed to maintain the document's professionalism.

-   :::

Likely invalid or redundant comment.

Tools
LanguageTool

[uncategorized] ~46-~46: Loose punctuation mark.
Context: ... is preconfigured and ready for use. ::: ## 1. Create a new CosmWasm project ...

(UNLIKELY_OPENING_PUNCTUATION)

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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 86a1baf and d8cb9ee.

Files selected for processing (1)
  • docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (1 hunks)
Additional context used
Path-based instructions (1)
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

LanguageTool
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md

[uncategorized] ~46-~46: Loose punctuation mark.
Context: ... is preconfigured and ready for use. ::: ## 1. Create a new CosmWasm project ...

(UNLIKELY_OPENING_PUNCTUATION)


[duplication] ~180-~180: Possible typo: you repeated a word
Context: ...g the command below. Before you should replace replace 1 with the actual code ID you retriev...

(ENGLISH_WORD_REPEAT_RULE)

Markdownlint
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md

151-151: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Additional comments not posted (5)
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (5)

13-13: Grammatical Error: Missing Article

The sentence "Before you start, complete following prerequisites:" is missing the article "the" before "following prerequisites." This issue has been previously flagged, and the correction remains relevant.

- Before you start, complete following prerequisites:
+ Before you start, complete the following prerequisites:

151-153: Missing Language Specification in Code Block

The fenced code block starting at line 151 should specify the language for better syntax highlighting and readability. This issue has been previously flagged, and the correction remains relevant.

- ```
+ ```bash
  wardend start
Tools
Markdownlint

151-151: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


179-180: Grammatical and Typographical Errors

The sentence "Before you should replace replace 1 with the actual code ID you retrieved in previous step and replace my-key-name with your key name." contains a repeated word "replace" and lacks a comma after "below." This issue has been previously flagged, and the correction remains relevant.

- Before you should replace replace `1` with the actual code ID you retrieved in previous step and replace `my-key-name` with your key name.
+ Before you proceed, replace `1` with the actual code ID you retrieved in the previous step and replace `my-key-name` with your key name.
Tools
LanguageTool

[duplication] ~180-~180: Possible typo: you repeated a word
Context: ...g the command below. Before you should replace replace 1 with the actual code ID you retriev...

(ENGLISH_WORD_REPEAT_RULE)


23-27: Indentation Issue in Unordered Lists

The indentation levels for the unordered list items from lines 23 to 27 are inconsistent with markdown best practices. Adjusting the indentation will improve the readability and maintain the structure of the document. This issue has been previously flagged, and the correction remains relevant.

-   - [CosmWasm](https://book.cosmwasm.com/setting-up-env.html): The CosmWasm binary and its dependencies.
-   - [cargo-generate](https://cargo-generate.github.io/cargo-generate/installation.html): A tool to help you get up and running quickly with a new Rust project by leveraging a pre-existing git repository as a template.
-   - [wasm-opt](https://docs.rs/wasm-opt/latest/wasm_opt/index.html): A tool for optimizing the compiled WebAssembly (Wasm) code.
+ - [CosmWasm](https://book.cosmwasm.com/setting-up-env.html): The CosmWasm binary and its dependencies.
+ - [cargo-generate](https://cargo-generate.github.io/cargo-generate/installation.html): A tool to help you get up and running quickly with a new Rust project by leveraging a pre-existing git repository as a template.
+ - [wasm-opt](https://docs.rs/wasm-opt/latest/wasm_opt/index.html): A tool for optimizing the compiled WebAssembly (Wasm) code.

46-46: Loose Punctuation Mark

The punctuation mark at the end of line 46 seems misplaced due to the markdown syntax for tips. Consider revising the markdown to ensure proper rendering.

-   :::tip
+   :::tip

Likely invalid or redundant comment.

Tools
LanguageTool

[uncategorized] ~46-~46: Loose punctuation mark.
Context: ... is preconfigured and ready for use. ::: ## 1. Create a new CosmWasm project ...

(UNLIKELY_OPENING_PUNCTUATION)

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d8cb9ee and 035d69b.

Files selected for processing (1)
  • docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (1 hunks)
Additional context used
Path-based instructions (1)
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

LanguageTool
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md

[uncategorized] ~46-~46: Loose punctuation mark.
Context: ... is preconfigured and ready for use. ::: ## 1. Create a new CosmWasm project ...

(UNLIKELY_OPENING_PUNCTUATION)


[duplication] ~180-~180: Possible typo: you repeated a word
Context: ...mand below. Before you proceed, should replace replace 1 with the actual code ID you retriev...

(ENGLISH_WORD_REPEAT_RULE)

Markdownlint
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md

151-151: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Additional comments not posted (16)
docs/developer-docs/docs/build-an-app/build-a-custom-smart-contract.md (16)

13-13: Grammatical Improvement Suggested

The phrase "complete the following prerequisites" is correctly structured and clear. This addresses a previous comment about missing articles, which has been resolved in this version.


17-19: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, which is good for syntax highlighting and readability.


23-27: Indentation Consistency in Unordered Lists

The indentation levels for the unordered list items are consistent and follow markdown best practices. This resolves a previous issue regarding inconsistent indentation.


31-35: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, enhancing readability and syntax highlighting.


41-43: Correct Language Specification in Code Block

The code block correctly specifies bash as the language. This is consistent with previous corrections and enhances the document's quality.


52-55: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, which is essential for proper syntax highlighting and readability.


61-105: Review of Rust Code Block

The Rust code block is well-formatted and includes appropriate language specification. It provides a clear example of how to set up a smart contract, including instantiation, execution, and query functionalities.


109-126: Review of Rust Code Block

This Rust code block is correctly formatted and specifies the language. It defines messages for instantiation, execution, and queries, which are crucial for the smart contract's functionality.


132-134: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, ensuring clarity and proper syntax highlighting.


142-145: Correct Language Specification in Code Block

The code block correctly specifies bash as the language. This is crucial for readability and understanding the optimization process for the Wasm code.


159-162: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, which is essential for proper syntax highlighting and readability during the contract storage process.


170-172: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, ensuring clarity and proper syntax highlighting for querying the Wasm code list.


192-194: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, which is essential for proper syntax highlighting and readability when querying the contract address.


202-205: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, ensuring clarity and proper syntax highlighting for executing the contract.


213-215: Correct Language Specification in Code Block

The code block correctly specifies bash as the language, which is crucial for querying the contract state in a readable and understandable manner.


182-186: Typographical Error: Repeated Word

There is a repeated word "replace" in the instruction. This should be corrected to improve clarity and correctness.

Consider the following correction:

- Before you proceed, should replace replace `1` with the actual code ID you retrieved in previous step and replace `my-key-name` with your key name.
+ Before you proceed, replace `1` with the actual code ID you retrieved in the previous step and replace `my-key-name` with your key name.

Likely invalid or redundant comment.

@alijnmerchant21 alijnmerchant21 merged commit adbcd1d into main Sep 6, 2024
9 of 11 checks passed
@alijnmerchant21 alijnmerchant21 deleted the build-an-oapp branch September 6, 2024 07:51
- [Run a local chain](test/run-a-local-chain) and make sure you have `wardend` correctly installed. You can stop the chain for now if you wish.

The next steps require your local account name, or key name, which is referenced as `my-key-name` in the provided command-line examples. You can check the list of available keys by executing this command (while the node is running):
Copy link
Contributor

Choose a reason for hiding this comment

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

it doesn't require the node to be running

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it doesn't require the node to be running

The chain needs to be running only while deploying a contract. We can either do it at the beginning or middle of the tutorial. I think in the start looks clean. But I'm open to moving it to later part of the tutorial too.

```

- [Run a local chain](test/run-a-local-chain) and make sure you have `wardend` correctly installed. You can stop the chain for now if you wish.
Copy link
Contributor

Choose a reason for hiding this comment

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

You can stop the chain for now if you wish.

I'd rather either explain the benefit of stopping the chain, or avoid suggesting it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ijonele please take note.

Copy link
Collaborator

@ijonele ijonele Sep 6, 2024

Choose a reason for hiding this comment

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

But In Step 6 the node has to be running? I guess in this case we can just say - Run a local chain and not mention stopping it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants