Skip to content

Commit

Permalink
Merge branch 'main' into julien/collections
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Nov 25, 2023
2 parents ef4a0cd + b9d9dda commit b82c99f
Show file tree
Hide file tree
Showing 54 changed files with 532 additions and 2,422 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ format:

## lint: Run Golang CI Lint.
lint:
@echo Running gocilint...
@echo Running golangci-lint...
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --out-format=tab --issues-exit-code=0

lint-fix:
@echo Running golangci-lint...
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --fix --out-format=tab --issues-exit-code=0

.PHONY: govet format lint

## proto-all: Format, lint and generate code from proto files using buf.
Expand Down
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Features

- [#3694](https://github.com/ignite/cli/pull/3694) Query and Tx AutoCLI support
- [#3544](https://github.com/ignite/cli/pull/3544) Add bidirectional communication to plugin system
- [#3561](https://github.com/ignite/cli/pull/3561) Add GetChainInfo method to plugin system API
- [#3626](https://github.com/ignite/cli/pull/3626) Add logging levels to relayer
Expand Down Expand Up @@ -52,6 +53,7 @@
- [#3726](https://github.com/ignite/cli/pull/3726) Update TS client dependencies. Bump vue/react template versions
- [#3728](https://github.com/ignite/cli/pull/3728) Fix wrong parser for proto package names
- [#3729](https://github.com/ignite/cli/pull/3729) Fix broken generator due to caching /tmp include folders
- [#3767](https://github.com/ignite/cli/pull/3767) Fix `v0.50` ibc genesis issue

## [`v0.27.2`](https://github.com/ignite/cli/releases/tag/v0.27.2)

Expand Down Expand Up @@ -787,4 +789,4 @@ Our new name is **Ignite CLI**!

## `v0.0.9`

Initial release.
Initial release.
37 changes: 17 additions & 20 deletions docs/docs/01-welcome/01-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,34 @@ slug: /

import ProjectsTable from '@site/src/components/ProjectsTable';

# Introduction to Ignite
# Introduction to Ignite CLI: Your Gateway to Blockchain Innovation

[Ignite CLI](https://github.com/ignite/cli) offers everything you need to build, test, and launch your blockchain with a
decentralized worldwide community. Ignite CLI is built on top of [Cosmos SDK](https://docs.cosmos.network), the world’s
most popular blockchain framework. Ignite CLI accelerates chain development by scaffolding everything you need so you
can focus on business logic.
[Ignite CLI](https://github.com/ignite/cli) is a powerful tool that simplifies the journey of building, testing, and launching diverse blockchain applications. Developed on top of the [Cosmos SDK](https://docs.cosmos.network), the leading framework for blockchain technology, Ignite CLI is pivotal in streamlining the development process. It enables developers to focus on the unique aspects of their projects, from DeFi and NFTs to supply chain solutions and smart contracts.
Beyond these, Ignite has been instrumental in a wide array of blockchain applications, ranging from VPNs and gaming platforms to blogs, oracle systems, and innovative consensus mechanisms. This demonstrates its versatility in supporting a broad spectrum of blockchain-based solutions.

## What is Ignite CLI?
## Key Features of Ignite CLI

Ignite CLI is an easy-to-use CLI tool for creating and maintaining sovereign application-specific blockchains.
Blockchains created with Ignite CLI use Cosmos SDK and Tendermint. Ignite CLI and the Cosmos SDK modules are written in
the Go programming language. The scaffolded blockchain that is created with Ignite CLI includes a command line interface
that lets you manage keys, create validators, and send tokens.

With just a few commands, you can use Ignite CLI to:

- Create a modular blockchain written in Go
- Scaffold modules, messages, types with CRUD operations, IBC packets, and more
- Start a blockchain node in development with live reloading
- Connect to other blockchains with a built-in IBC relayer
- Use generated TypeScript/Vuex clients to interact with your blockchain
- Use the Vue.js web app template with a set of components and Vuex modules
- **Simplified Blockchain Development:** Ignite CLI, leveraging Cosmos SDK, makes building sovereign application-specific blockchains intuitive and efficient.
- **Comprehensive Scaffolding:** Easily scaffold modules, messages, CRUD operations, IBC packets, and more, expediting the development of complex functionalities.
- **Development with Live Reloading:** Start and test your blockchain node with real-time updates, enhancing your development workflow.
- **Frontend Flexibility:** Utilize pre-built templates for Vue.js, React, Typescript or Go, catering to diverse frontend development needs.
- **Inter-Blockchain Communication (IBC):** Seamlessly connect and interact with other blockchains using an integrated IBC relayer, a key feature of the Cosmos SDK.
- **CometBFT Integration:** Built with the CometBFT consensus engine (formerly Tendermint), ensuring robust consensus mechanisms in your blockchain solutions.
- **Cross-Domain Applications:** Ignite is perfectly suited for developing a diverse array of use cases across various sectors. These include DeFi, NFTs, supply chain management, smart contracts (both EVM and WASM), and decentralized exchanges (DEXes).

## Install Ignite CLI

To install the `ignite` binary in `/usr/local/bin` run the following command:
Get started with Ignite CLI by running this simple installation command:

```
curl https://get.ignite.com/cli! | bash
```

## Embracing the Cosmos Ecosystem

Ignite CLI is your entry point into the vibrant Cosmos ecosystem, a hub of innovation where you can explore a range of applications, from wallets and explorers to smart contracts and DEXes, all powered by CometBFT and the Cosmos SDK.
This ecosystem is home to over [$50 billion worth of blockchain projects](https://cosmos.network/ecosystem/tokens/), showcasing the scalability and versatility of the technologies at play.

## Projects using Tendermint and Cosmos SDK

Many projects already showcase the Tendermint BFT consensus engine and the Cosmos SDK. Explore
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/01-welcome/02-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Ignite CLI is supported for the following operating systems:

Ignite CLI is written in the Go programming language. To use Ignite CLI on a local system:

- Install [Go](https://golang.org/doc/install) (**version 1.19** or higher)
- Install [Go](https://golang.org/doc/install) (**version 1.21.1** or higher)
- Ensure the Go environment variables are [set properly](https://golang.org/doc/gopath_code#GOPATH) on your system

## Verify your Ignite CLI version
Expand Down
101 changes: 101 additions & 0 deletions docs/docs/02-guide/03-hello-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
description: Build your first blockchain and your first Cosmos SDK query.
title: Hello World
---

# "Hello world!" Blockchain Tutorial with Ignite CLI

**Introduction**

In this tutorial, you'll build a simple blockchain using Ignite CLI that responds to a custom query with "Hello %s!", where "%s" is a name passed in the query.
This will enhance your understanding of creating custom queries in a Cosmos SDK blockchain.

## Setup and Scaffold

1. **Create a New Blockchain:**

```bash
ignite scaffold chain hello
```

2. **Navigate to the Blockchain Directory:**

```bash
cd hello
```

## Adding a Custom Query

- **Scaffold the Query:**

```bash
ignite scaffold query say-hello name --response name
```

This command generates code for a new query, `say-hello`, which accepts a name, an input, and returns it in the response.

- **Understanding the Scaffolded Code:**

- `proto/hello/hello/query.proto`: Defines the request and response structure.
- `x/hello/client/cli/query_say_hello.go`: Contains the CLI commands for the query.
- `x/hello/keeper/query_say_hello.go`: Houses the logic for the query response.


## Customizing the Query Response

In the Cosmos SDK, queries are requests for information from the blockchain, used to access data like the ledger's current state or transaction details. While the SDK offers several built-in query methods, developers can also craft custom queries for specific data retrieval or complex operations.

- **Modify `query_say_hello.go`:**

Update the `SayHello` function in `x/hello/keeper/query_say_hello.go` to return a personalized greeting query.

```go title="x/hello/keeper/query_say_hello.go"
package keeper

import (
"context"
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"hello/x/hello/types"
)

func (k Keeper) SayHello(goCtx context.Context, req *types.QuerySayHelloRequest) (*types.QuerySayHelloResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "invalid request")
}

// Validation and Context unwrapping
ctx := sdk.UnwrapSDKContext(goCtx)

_ = ctx
// Custom Response
// highlight-next-line
return &types.QuerySayHelloResponse{Name: fmt.Sprintf("Hello %s!", req.Name)}, nil
}
```

## Running the Blockchain

1. **Start the Blockchain:**

```bash
ignite chain serve
```

2. **Test the Query:**

Use the command-line interface to submit a query.

```
hellod q hello say-hello world
```

Expect a response: `Hello world!`

## Conclusion

Congratulations! 🎉 You've successfully created a blockchain module with a custom query using Ignite CLI. Through this tutorial, you've learned how to scaffold a chain, add a custom query, and modify the logic for personalized responses. This experience illustrates the power of Ignite CLI in streamlining blockchain development and the importance of understanding the underlying code for customization.
141 changes: 0 additions & 141 deletions docs/docs/02-guide/03-hello/00-express.md

This file was deleted.

Loading

0 comments on commit b82c99f

Please sign in to comment.