Skip to content

Commit

Permalink
Merge branch 'main' into feat/plugin-system-improvements-versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
jeronimoalbi committed Aug 22, 2023
2 parents e085ea8 + e4ef6df commit daf8f23
Show file tree
Hide file tree
Showing 149 changed files with 4,769 additions and 4,148 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gen-docs-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: '1.20'

- name: Generate CLI Docs
run: ./scripts/gen-cli-docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: '1.20'

- name: Run make format
run: make format
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: '1.20'

- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- uses: actions/setup-go@v4
if: env.GIT_DIFF
with:
go-version: "1.20"
go-version: '1.20'
- name: Run Integration Tests
if: env.GIT_DIFF
run: GOSUMDB=off go test -v -timeout 120m ./integration/${{ matrix.test-path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/setup-go@v4
if: env.GIT_DIFF
with:
go-version: "1.20"
go-version: '1.20'
cache: true
cache-dependency-path: go.sum

Expand Down
2 changes: 1 addition & 1 deletion .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM gitpod/workspace-full

# Go
ENV GO_VERSION=1.19.3
ENV GO_VERSION=1.20.5
ENV GOPATH=$HOME/go-packages
ENV GOROOT=$HOME/go
ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## prep the base image.
#
FROM golang:1.19 as base
FROM golang:1.20 as base

RUN apt update && \
apt-get install -y \
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
### Features

- [#3476](https://github.com/ignite/cli/pull/3476) Use `buf.build` binary to code generate from proto files
- [#3536](https://github.com/ignite/cli/pull/3536) Change app.go to v2 and add AppWiring feature

### Changes

- [#3559](https://github.com/ignite/cli/pull/3559) Bump network plugin version to `v0.1.1`

### Changes

- [#3581](https://github.com/ignite/cli/pull/3581) Bump cometbft and cometbft-db in the template
- [#3559](https://github.com/ignite/cli/pull/3559) Bump network plugin version to `v0.1.1`
- [#3522](https://github.com/ignite/cli/pull/3522) Remove indentation from `chain serve` output
- [#3601](https://github.com/ignite/cli/pull/3601) Update ts-relayer version to `0.10.0`

### Fixes

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/03-clients/01-go-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ To import dependencies for your package, you can add the following code to the
```text title="blogclient/go.mod"
module blogclient
go 1.19
go 1.20
require (
blog v0.0.0-00010101000000-000000000000
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/03-clients/03-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ properly interact with a Cosmos chain. The address prefix is used to identify
the chain that the app is connected to, and must match the prefix used by the
chain.

By default, Ignite creates a chain with the the `cosmos` prefix. If you have
By default, Ignite creates a chain with the `cosmos` prefix. If you have
created your chain with `ignite scaffold chain ... --adddress-prefix foo` or
manually changed the prefix in the source code of the chain, you need to set the
prefix in the Vue app.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/04-network/02-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ anyone can be a coordinator or a validator.

## Launching a chain on Ignite

Launching with the CLI can be as simple as a few short commands with the the CLI using `ignite network` command
Launching with the CLI can be as simple as a few short commands with the CLI using `ignite network` command
namespace.

> **NOTE:** `ignite n` can also be used as a shortcut for `ignite network`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ In the newly scaffolded `x/blog/keeper/msg_server_create_comment.go` file, you c
You need to do the following things:

* Create a variable of type `Comment` with title and body from the message
* Check if the the comment posted for the respective blog id exists and comment is not older than 100 blocks
* Check if the comment posted for the respective blog id exists and comment is not older than 100 blocks
* Append this `Comment` to the store

```go
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (k msgServer) RevealSolution(goCtx context.Context, msg *types.MsgRevealSol
// convert the hash to a string
var solutionScavengerHashString = hex.EncodeToString(solutionScavengerHash[:])

// try getting a commit using the the hash of solution and address
// try getting a commit using the hash of solution and address
_, isFound := k.GetCommit(ctx, solutionScavengerHashString)

// return an error if a commit doesn't exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To launch a Cosmos blockchain you need someone to be a coordinator and others to

## Launching a chain on Ignite

Launching with the CLI can be as simple as a few short commands with the the CLI using `ignite network` command namespace.
Launching with the CLI can be as simple as a few short commands with the CLI using `ignite network` command namespace.

> **NOTE:** `ignite n` can also be used as a shortcut for `ignite network`.
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-v0.26.1/03-clients/03-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ properly interact with a Cosmos chain. The address prefix is used to identify
the chain that the app is connected to, and must match the prefix used by the
chain.

By default, Ignite creates a chain with the the `cosmos` prefix. If you have
By default, Ignite creates a chain with the `cosmos` prefix. If you have
created your chain with `ignite scaffold chain ... --adddress-prefix foo` or
manually changed the prefix in the source code of the chain, you need to set the
prefix in the Vue app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ anyone can be a coordinator or a validator.

## Launching a chain on Ignite

Launching with the CLI can be as simple as a few short commands with the the CLI using `ignite network` command
Launching with the CLI can be as simple as a few short commands with the CLI using `ignite network` command
namespace.

> **NOTE:** `ignite n` can also be used as a shortcut for `ignite network`.
Expand Down
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-v0.27.1/03-clients/03-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ properly interact with a Cosmos chain. The address prefix is used to identify
the chain that the app is connected to, and must match the prefix used by the
chain.

By default, Ignite creates a chain with the the `cosmos` prefix. If you have
By default, Ignite creates a chain with the `cosmos` prefix. If you have
created your chain with `ignite scaffold chain ... --adddress-prefix foo` or
manually changed the prefix in the source code of the chain, you need to set the
prefix in the Vue app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ anyone can be a coordinator or a validator.

## Launching a chain on Ignite

Launching with the CLI can be as simple as a few short commands with the the CLI using `ignite network` command
Launching with the CLI can be as simple as a few short commands with the CLI using `ignite network` command
namespace.

> **NOTE:** `ignite n` can also be used as a shortcut for `ignite network`.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ignite/cli

go 1.19
go 1.20

require (
cosmossdk.io/math v1.0.1
Expand Down
1 change: 1 addition & 0 deletions ignite/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ meant to be edited by hand.
flagSetPath(c)
flagSetClearCache(c)
c.AddCommand(NewGenerateGo())
c.AddCommand(NewGeneratePulsar())
c.AddCommand(NewGenerateTSClient())
c.AddCommand(NewGenerateVuex())
c.AddCommand(NewGenerateComposables())
Expand Down
47 changes: 47 additions & 0 deletions ignite/cmd/generate_pulsar.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package ignitecmd

import (
"github.com/spf13/cobra"

"github.com/ignite/cli/ignite/pkg/cliui"
"github.com/ignite/cli/ignite/pkg/cliui/icons"
"github.com/ignite/cli/ignite/services/chain"
)

func NewGeneratePulsar() *cobra.Command {
c := &cobra.Command{
Use: "proto-pulsar",
Short: "Compile protocol buffer files to Go pulsar source code required by Cosmos SDK",
RunE: generatePulsarHandler,
}

c.Flags().AddFlagSet(flagSetYes())

return c
}

func generatePulsarHandler(cmd *cobra.Command, _ []string) error {
session := cliui.New(cliui.StartSpinnerWithText(statusGenerating))
defer session.End()

c, err := newChainWithHomeFlags(
cmd,
chain.WithOutputer(session),
chain.CollectEvents(session.EventBus()),
chain.CheckCosmosSDKVersion(),
)
if err != nil {
return err
}

cacheStorage, err := newCache(cmd)
if err != nil {
return err
}

if err := c.Generate(cmd.Context(), cacheStorage, chain.GeneratePulsar()); err != nil {
return err
}

return session.Println(icons.OK, "Generated Go pulsar code")
}
11 changes: 11 additions & 0 deletions ignite/cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import (
flag "github.com/spf13/pflag"

"github.com/ignite/cli/ignite/pkg/cliui"
"github.com/ignite/cli/ignite/pkg/cosmosver"
"github.com/ignite/cli/ignite/pkg/gomodulepath"
"github.com/ignite/cli/ignite/pkg/placeholder"
"github.com/ignite/cli/ignite/pkg/xgit"
"github.com/ignite/cli/ignite/services/scaffolder"
"github.com/ignite/cli/ignite/version"
)

// flags related to component scaffolding.
Expand Down Expand Up @@ -129,6 +131,15 @@ func migrationPreRunHandler(cmd *cobra.Command, args []string) error {
return err
}

ver, err := cosmosver.Detect(appPath)
if err != nil {
return err
}

if err := version.AssertSupportedCosmosSDKVersion(ver); err != nil {
return err
}

if err := toolsMigrationPreRunHandler(cmd, session, appPath); err != nil {
return err
}
Expand Down
12 changes: 12 additions & 0 deletions ignite/cmd/scaffold_chain.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ignitecmd

import (
"errors"

"github.com/spf13/cobra"

"github.com/ignite/cli/ignite/pkg/cliui"
Expand Down Expand Up @@ -77,6 +79,7 @@ about Cosmos SDK on https://docs.cosmos.network
c.Flags().AddFlagSet(flagSetAccountPrefixes())
c.Flags().StringP(flagPath, "p", "", "create a project in a specific path")
c.Flags().Bool(flagNoDefaultModule, false, "create a project without a default module")
c.Flags().StringSlice(flagParams, []string{}, "add default module parameters")
c.Flags().Bool(flagSkipGit, false, "skip Git repository initialization")

return c
Expand All @@ -94,6 +97,14 @@ func scaffoldChainHandler(cmd *cobra.Command, args []string) error {
skipGit, _ = cmd.Flags().GetBool(flagSkipGit)
)

params, err := cmd.Flags().GetStringSlice(flagParams)
if err != nil {
return err
}
if noDefaultModule && len(params) > 0 {
return errors.New("params flag is only supported if the default module is enabled")
}

cacheStorage, err := newCache(cmd)
if err != nil {
return err
Expand All @@ -108,6 +119,7 @@ func scaffoldChainHandler(cmd *cobra.Command, args []string) error {
addressPrefix,
noDefaultModule,
skipGit,
params,
)
if err != nil {
return err
Expand Down
56 changes: 0 additions & 56 deletions ignite/cmd/scaffold_mwasm.go

This file was deleted.

2 changes: 1 addition & 1 deletion ignite/config/plugins/testdata/localplugin/example/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/ignite/example

go 1.19
go 1.20
2 changes: 0 additions & 2 deletions ignite/pkg/availableport/availableport.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"math/rand"
"net"
"time"
)

// Find finds n number of unused ports.
Expand All @@ -16,7 +15,6 @@ func Find(n int) (ports []int, err error) {

for i := 0; i < n; i++ {
for {
rand.Seed(time.Now().UnixNano())
port := rand.Intn(max-min+1) + min

conn, err := net.Dial("tcp", fmt.Sprintf(":%d", port))
Expand Down
Loading

0 comments on commit daf8f23

Please sign in to comment.