Skip to content

Commit

Permalink
chore: release v0.21.1 (#2486)
Browse files Browse the repository at this point in the history
chore: release v0.21.1
  • Loading branch information
ilgooz authored May 16, 2022
2 parents 6009368 + db74990 commit f6f726d
Show file tree
Hide file tree
Showing 45 changed files with 1,089 additions and 193 deletions.
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

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

### Features

- Add compatibility to run chains built with Cosmos-SDK `v0.46.0-alpha1` and above
- Scaffold chains now will have `auth` module enabled by default

### Fixes

- Fixed shell completion generation
- Make sure proto package names are valid when using simple app names

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

### Features
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require (
github.com/stretchr/testify v1.7.1
github.com/takuoki/gocase v1.0.0
github.com/tendermint/flutter/v2 v2.0.3
github.com/tendermint/spn v0.2.1-0.20220427143342-de7398284030
github.com/tendermint/spn v0.2.1-0.20220511154430-aeab7a5b2bc0
github.com/tendermint/tendermint v0.34.19
github.com/tendermint/tm-db v0.6.7
github.com/tendermint/vue v0.3.5
Expand Down Expand Up @@ -84,7 +84,7 @@ require (
github.com/chris-ramon/douceur v0.2.0 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect
github.com/confio/ics23/go v0.6.6 // indirect
github.com/confio/ics23/go v0.7.0 // indirect
github.com/containerd/cgroups v1.0.3 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/containerd/containerd v1.6.2 // indirect
Expand Down Expand Up @@ -215,6 +215,7 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect
github.com/tendermint/btcd v0.1.1 // indirect
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect
github.com/tendermint/fundraising v0.3.0 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
Expand Down
17 changes: 8 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE
github.com/coinbase/rosetta-sdk-go v0.6.10/go.mod h1:J/JFMsfcePrjJZkwQFLh+hJErkAmdm9Iyy3D5Y0LfXo=
github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg=
github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE=
github.com/confio/ics23/go v0.6.6 h1:pkOy18YxxJ/r0XFDCnrl4Bjv6h4LkBSpLS6F38mrKL8=
github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
github.com/confio/ics23/go v0.7.0 h1:00d2kukk7sPoHWL4zZBZwzxnpA2pec1NPdwbSokJ5w8=
github.com/confio/ics23/go v0.7.0/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE=
github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU=
github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU=
Expand Down Expand Up @@ -422,8 +423,6 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc
github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44=
github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU=
github.com/cosmos/cosmos-sdk v0.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiOWU5t1HEGaY=
github.com/cosmos/cosmos-sdk v0.45.3 h1:PiVSU3IkNEDPhoxOZHk2lPnhwBBJgEYAtAR0jGXRN4g=
github.com/cosmos/cosmos-sdk v0.45.3/go.mod h1:qYm5JEr0ZlbnmoP/Q3b+dYMOliHf4ddHirpILiwZzqg=
github.com/cosmos/cosmos-sdk v0.45.4 h1:eStDAhJdMY8n5arbBRe+OwpNeBSunxSBHp1g55ulfdA=
github.com/cosmos/cosmos-sdk v0.45.4/go.mod h1:WOqtDxN3eCCmnYLVla10xG7lEXkFjpTaqm2a2WasgCc=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
Expand Down Expand Up @@ -567,8 +566,8 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
Expand Down Expand Up @@ -735,8 +734,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0=
github.com/google/go-github/v37 v37.0.0 h1:rCspN8/6kB1BAJWZfuafvHhyfIo5fkAulaP/3bOQ/tM=
github.com/google/go-github/v37 v37.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4=
Expand Down Expand Up @@ -1484,11 +1483,12 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk=
github.com/tendermint/flutter/v2 v2.0.3 h1:+J3Q6FRdcDTLkrcPQHY306J7wRPEKxfU2K2xCVFJGqs=
github.com/tendermint/flutter/v2 v2.0.3/go.mod h1:hnaVhWhzv2Od1LqZFWrRKwiOHeMonsB9EIWP0AGMPw0=
github.com/tendermint/fundraising v0.2.0 h1:V6N7u/oWXjQZEbXXk34uAfijYnYQFZrZGA39e03UFz8=
github.com/tendermint/fundraising v0.3.0 h1:VtHfmVlAS93MUDlt6Em21l3taw6s9kLY/w8Cd1FB9fM=
github.com/tendermint/fundraising v0.3.0/go.mod h1:oJFZUZ/GsACtkYeWScKpHLdqMUThNWpMAi/G47LJUi4=
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/tendermint/spn v0.2.1-0.20220427143342-de7398284030 h1:1S5urE/lHktsawx/I4r6iHiV1Ylfhp8mQZ5eQKbY1bA=
github.com/tendermint/spn v0.2.1-0.20220427143342-de7398284030/go.mod h1:9wXyogMDn9fK85s+bSADy+wvZ27DjLEByByMM+0O6NU=
github.com/tendermint/spn v0.2.1-0.20220511154430-aeab7a5b2bc0 h1:kIjnfHO472W2WSzul3ek3p07yKVYxSFUNng4YJmVex4=
github.com/tendermint/spn v0.2.1-0.20220511154430-aeab7a5b2bc0/go.mod h1:xNtBc/jmB1pvb+EJYQtyJdcTZM9dOhJeW3C4Qj9n7tg=
github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0=
github.com/tendermint/tendermint v0.34.19 h1:y0P1qI5wSa9IRuhKnTDA6IUcOrLi1hXJuALR+R7HFEk=
github.com/tendermint/tendermint v0.34.19/go.mod h1:R5+wgIwSxMdKQcmOaeudL0Cjkr3HDkhpcdum6VeU3R4=
Expand Down Expand Up @@ -2155,7 +2155,6 @@ google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ6
google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e h1:fNKDNuUyC4WH+inqDMpfXDdfvwfYILbsX+oskGZ8hxg=
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
Expand Down
10 changes: 7 additions & 3 deletions ignite/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ const (
)

// New creates a new root command for `Ignite CLI` with its sub commands.
func New(ctx context.Context) *cobra.Command {
func New() *cobra.Command {
cobra.EnableCommandSorting = false

checkNewVersion(ctx)

c := &cobra.Command{
Use: "ignite",
Short: "Ignite CLI offers everything you need to scaffold, test, build, and launch your blockchain",
Expand All @@ -53,6 +51,12 @@ ignite scaffold chain github.com/username/mars`,
SilenceUsage: true,
SilenceErrors: true,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
// Check for new versions only when shell completion scripts are not being
// generated to avoid invalid output to stdout when a new version is available
if cmd.Use != "completions" {
checkNewVersion(cmd.Context())
}

return goenv.ConfigurePath()
},
}
Expand Down
2 changes: 1 addition & 1 deletion ignite/cmd/ignite/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func main() {
ctx := clictx.From(context.Background())

err := ignitecmd.New(ctx).ExecuteContext(ctx)
err := ignitecmd.New().ExecuteContext(ctx)

if ctx.Err() == context.Canceled || err == context.Canceled {
fmt.Println("aborted")
Expand Down
1 change: 1 addition & 0 deletions ignite/cmd/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func NewNetwork() *cobra.Command {
NewNetworkCampaign(),
NewNetworkRequest(),
NewNetworkReward(),
NewNetworkClient(),
)

return c
Expand Down
20 changes: 20 additions & 0 deletions ignite/cmd/network_client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package ignitecmd

import (
"github.com/spf13/cobra"
)

// NewNetworkClient creates a new client command that holds some other
// sub commands related to connect client to the network.
func NewNetworkClient() *cobra.Command {
c := &cobra.Command{
Use: "client",
Short: "Connect your network with SPN",
}

c.AddCommand(
NewNetworkClientCreate(),
)

return c
}
67 changes: 67 additions & 0 deletions ignite/cmd/network_client_create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package ignitecmd

import (
"github.com/spf13/cobra"

"github.com/ignite-hq/cli/ignite/pkg/cliui"
"github.com/ignite-hq/cli/ignite/pkg/cliui/icons"
"github.com/ignite-hq/cli/ignite/pkg/cosmosclient"
"github.com/ignite-hq/cli/ignite/services/network"
)

// NewNetworkClientCreate connects the monitoring modules of launched chains with SPN
func NewNetworkClientCreate() *cobra.Command {
c := &cobra.Command{
Use: "create [launch-id] [node-api-url]",
Short: "Connect the monitoring modules of launched chains with SPN",
Args: cobra.ExactArgs(2),
RunE: networkClientCreateHandler,
}
c.Flags().AddFlagSet(flagNetworkFrom())
c.Flags().AddFlagSet(flagSetKeyringBackend())
return c
}

func networkClientCreateHandler(cmd *cobra.Command, args []string) error {
session := cliui.New()
defer session.Cleanup()

launchID, err := network.ParseID(args[0])
if err != nil {
return err
}
nodeAPI := args[1]

nb, err := newNetworkBuilder(cmd)
if err != nil {
return err
}

nodeClient, err := cosmosclient.New(cmd.Context(), cosmosclient.WithNodeAddress(nodeAPI))
if err != nil {
return err
}
node, err := network.NewNodeClient(nodeClient)
if err != nil {
return err
}

ibcInfo, err := node.IBCInfo(cmd.Context())
if err != nil {
return err
}

n, err := nb.Network()
if err != nil {
return err
}

clientID, err := n.CreateClient(launchID, ibcInfo)
if err != nil {
return err
}

session.StopSpinner()
session.Printf("%s Client created: %s\n", icons.Info, clientID)
return nil
}
5 changes: 3 additions & 2 deletions ignite/cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"fmt"

"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"

"github.com/ignite-hq/cli/ignite/pkg/cliui/clispinner"
"github.com/ignite-hq/cli/ignite/pkg/placeholder"
"github.com/ignite-hq/cli/ignite/pkg/xgit"
"github.com/ignite-hq/cli/ignite/services/scaffolder"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
)

// flags related to component scaffolding
Expand Down
3 changes: 1 addition & 2 deletions ignite/internal/tools/gen-cli-docs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package main
import (
"bufio"
"bytes"
"context"
"flag"
"fmt"
"io"
Expand Down Expand Up @@ -37,7 +36,7 @@ func main() {
outPath := flag.String("out", ".", ".md file path to place Ignite CLI docs inside")
flag.Parse()

if err := generate(ignitecmd.New(context.Background()), *outPath); err != nil {
if err := generate(ignitecmd.New(), *outPath); err != nil {
log.Fatal(err)
}
}
Expand Down
65 changes: 65 additions & 0 deletions ignite/pkg/cosmosclient/cosmosclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cosmosclient

import (
"context"
"encoding/base64"
"encoding/hex"
"fmt"
"io"
Expand All @@ -26,10 +27,15 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
staking "github.com/cosmos/cosmos-sdk/x/staking/types"
commitmenttypes "github.com/cosmos/ibc-go/v2/modules/core/23-commitment/types"
"github.com/gogo/protobuf/proto"
prototypes "github.com/gogo/protobuf/types"
"github.com/pkg/errors"
"github.com/tendermint/tendermint/libs/bytes"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
rpchttp "github.com/tendermint/tendermint/rpc/client/http"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
tmtypes "github.com/tendermint/tendermint/types"

"github.com/ignite-hq/cli/ignite/pkg/cosmosaccount"
"github.com/ignite-hq/cli/ignite/pkg/cosmosfaucet"
Expand Down Expand Up @@ -245,6 +251,65 @@ func (r Response) Decode(message proto.Message) error {
}, message)
}

// ConsensusInfo is the validator consensus info
type ConsensusInfo struct {
Timestamp string `json:"Timestamp"`
Root string `json:"Root"`
NextValidatorsHash string `json:"NextValidatorsHash"`
ValidatorSet *tmproto.ValidatorSet `json:"ValidatorSet"`
}

// ConsensusInfo returns the appropriate tendermint consensus state by given height
// and the validator set for the next height
func (c Client) ConsensusInfo(ctx context.Context, height int64) (ConsensusInfo, error) {
node, err := c.Context().GetNode()
if err != nil {
return ConsensusInfo{}, err
}

commit, err := node.Commit(ctx, &height)
if err != nil {
return ConsensusInfo{}, err
}

var (
page = 1
count = 10_000
)
validators, err := node.Validators(ctx, &height, &page, &count)
if err != nil {
return ConsensusInfo{}, err
}

protoValset, err := tmtypes.NewValidatorSet(validators.Validators).ToProto()
if err != nil {
return ConsensusInfo{}, err
}

heightNext := height + 1
validatorsNext, err := node.Validators(ctx, &heightNext, &page, &count)
if err != nil {
return ConsensusInfo{}, err
}

var (
hash = tmtypes.NewValidatorSet(validatorsNext.Validators).Hash()
root = commitmenttypes.NewMerkleRoot(commit.AppHash)
)

return ConsensusInfo{
Timestamp: commit.Time.Format(time.RFC3339Nano),
NextValidatorsHash: bytes.HexBytes(hash).String(),
Root: base64.StdEncoding.EncodeToString(root.Hash),
ValidatorSet: protoValset,
}, nil
}

// Status returns the node status
func (c Client) Status(ctx context.Context) (*ctypes.ResultStatus, error) {
return c.RPC.Status(ctx)
}

// BroadcastTx creates and broadcasts a tx with given messages for account.
func (c Client) BroadcastTx(accountName string, msgs ...sdktypes.Msg) (Response, error) {
_, broadcast, err := c.BroadcastTxWithProvision(accountName, msgs...)
Expand Down
3 changes: 2 additions & 1 deletion ignite/pkg/cosmosgen/cosmosgen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package cosmosgen
import (
"testing"

"github.com/stretchr/testify/require"

"github.com/ignite-hq/cli/ignite/pkg/cosmosanalysis/module"
"github.com/ignite-hq/cli/ignite/pkg/protoanalysis"
"github.com/stretchr/testify/require"
)

func TestVuexStoreModulePath(t *testing.T) {
Expand Down
Loading

0 comments on commit f6f726d

Please sign in to comment.