From 534244224dc9ec8cf3ca2531ce6328e343ab61db Mon Sep 17 00:00:00 2001 From: Alex Johnson Date: Thu, 8 Dec 2022 13:04:31 -0500 Subject: [PATCH 1/2] chore: update `spn` (#3124) * update spn * import * fix * update mocks * rename test * feat(`network`): `param-change` (#3142) * utd * add command * typo * add test * changelog * format * Update ignite/cmd/network_request_param_change.go Co-authored-by: Lucas Bertrand * Update changelog.md Co-authored-by: Lucas Bertrand Co-authored-by: Lucas Bertrand * refactor: rename command `param-change` into `change-param` (#3169) * change name * rename file * chore: upgrade `spn` (#3177) * gomod * gosum * endpoints (#3196) * format * request list * feat: add `ParamChange` to `ignite n request list/show` (#3233) * chore: go formatting (#3232) Co-authored-by: aljo242 * request list * format * ascii Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: aljo242 * format * feat(`network`): param-change apply to genesis (#3208) * stub out * prepare logic * fix test * Update ignite/services/network/networkchain/prepare.go Co-authored-by: Lucas Bertrand * refactor WithKeyValueByte * add detail to error message * const format string * format * add integration test and fix * add check to command * format * finish check code * improve error msg * wip * fix * format * remove incorrect test * Update ignite/pkg/cosmosutil/genesis/genesis.go Co-authored-by: Danilo Pantani * rename according to review * optimize appylParamChanges * basic ModuleParamField test * format * revert errors Co-authored-by: Lucas Bertrand Co-authored-by: Danilo Pantani * add test * add test * flesh out genesis information tests * format Co-authored-by: Lucas Bertrand Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: aljo242 Co-authored-by: Danilo Pantani --- changelog.md | 1 + go.mod | 10 +- go.sum | 38 +-- ignite/cmd/network.go | 4 +- ignite/cmd/network_request.go | 1 + ignite/cmd/network_request_change_param.go | 81 +++++++ ignite/cmd/network_request_list.go | 9 + ignite/cmd/network_request_show.go | 1 + ignite/pkg/cosmosutil/genesis/genesis.go | 8 + ignite/pkg/cosmosutil/genesis/genesis_test.go | 38 +++ ignite/pkg/jsonfile/jsonfile.go | 11 +- ignite/pkg/jsonfile/jsonfile_test.go | 13 + .../services/network/mocks/launch_client.go | 30 +++ .../services/network/networkchain/prepare.go | 22 ++ .../services/network/networkchain/request.go | 62 +++++ .../network/networktypes/chainlaunch.go | 2 +- .../networktypes/genesisinformation.go | 89 +++++-- .../networktypes/genesisinformation_test.go | 84 +++++-- ignite/services/network/publish.go | 2 +- ignite/services/network/publish_test.go | 2 +- ignite/services/network/queries.go | 33 ++- ignite/services/network/request.go | 49 ++++ ignite/services/network/request_test.go | 53 ++++ ignite/services/network/reward_test.go | 30 +-- integration/network/genesis.json | 227 ++++++++++++++++++ integration/network/network_test.go | 2 +- integration/network/request_test.go | 86 +++++++ 27 files changed, 896 insertions(+), 92 deletions(-) create mode 100644 ignite/cmd/network_request_change_param.go create mode 100644 ignite/pkg/cosmosutil/genesis/genesis_test.go create mode 100644 ignite/services/network/networkchain/request.go create mode 100644 ignite/services/network/request_test.go create mode 100644 integration/network/genesis.json create mode 100644 integration/network/request_test.go diff --git a/changelog.md b/changelog.md index 996bc7e338..bdbc84b429 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ### Features +- [#3142](https://github.com/ignite/cli/pull/3142) Add `ignite network request param-change` command. - [#3181](https://github.com/ignite/cli/pull/3181) Addition of `add` `remove` commands for `plugins` - [#3184](https://github.com/ignite/cli/pull/3184) Separate `plugins.yml` config file. - [#3038](https://github.com/ignite/cli/pull/3038) Addition of Plugin Hooks in Plugin System diff --git a/go.mod b/go.mod index 2ba544f553..f14acd4afa 100644 --- a/go.mod +++ b/go.mod @@ -56,7 +56,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 github.com/tbruyelle/mdgofmt v0.1.2 - github.com/tendermint/spn v0.2.1-0.20220921200247-8bafad876bdd + github.com/tendermint/spn v0.2.1-0.20221125172725-052fbf576cb2 github.com/tendermint/tendermint v0.34.23 github.com/tendermint/tm-db v0.6.7 github.com/vektra/mockery/v2 v2.15.0 @@ -270,8 +270,8 @@ require ( github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.0.0 // indirect - github.com/moby/sys/mount v0.3.1 // indirect - github.com/moby/sys/mountinfo v0.6.0 // indirect + github.com/moby/sys/mount v0.3.3 // indirect + github.com/moby/sys/mountinfo v0.6.2 // indirect github.com/moricho/tparallel v0.2.1 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect @@ -368,8 +368,8 @@ require ( golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 // indirect golang.org/x/net v0.2.0 // indirect golang.org/x/sys v0.2.0 // indirect - golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect - google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index fc5a0942ee..8920173a71 100644 --- a/go.sum +++ b/go.sum @@ -22,7 +22,7 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.102.1 h1:vpK6iQWv/2uUeFJth4/cBHsQAGjn1iIE6AAlxipRaA0= +cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -30,11 +30,12 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= +cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= +cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v0.4.0 h1:YBYU00SCDzZJdHqVc4I5d6lsklcYIjQZa1YmEz4jlSE= +cloud.google.com/go/iam v0.7.0 h1:k4MuwOsS7zGJJ+QfZ5vBK8SgHBAvYN/23BWsiihJ1vs= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -45,7 +46,7 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.22.1 h1:F6IlQJZrZM++apn9V5/VfS3gbTUYg98PS3EMQAzqtfg= +cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= @@ -896,12 +897,11 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= +github.com/googleapis/enterprise-certificate-proxy v0.2.0 h1:y8Yozv7SZtlU//QXbezB6QkpuE6jMD2/gfzk4AftXjs= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= +github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gookit/color v1.5.2 h1:uLnfXcaFjlrDnQDT+NCBcfhrXqYTx/rcCa6xn01Y8yI= github.com/gookit/color v1.5.2/go.mod h1:w8h4bGiHeeBpvQVePTutdbERIUf3oJE5lZ8HM0UgXyg= @@ -1282,13 +1282,13 @@ github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8oh github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/moby v20.10.21+incompatible h1:LfdCNzNpDYtOTtlO5wxLcUEk0nyM3KqPyeIyXVdvl/U= github.com/moby/moby v20.10.21+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc= -github.com/moby/sys/mount v0.3.1 h1:RX1K0x95oR8j5P1YefKDt7tE1C2kCCixV0H8Aza3GaI= -github.com/moby/sys/mount v0.3.1/go.mod h1:6IZknFQiqjLpwuYJD5Zk0qYEuJiws36M88MIXnZHya0= +github.com/moby/sys/mount v0.3.3 h1:fX1SVkXFJ47XWDoeFW4Sq7PdQJnV2QIDZAqjNqgEjUs= +github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/mountinfo v0.6.0 h1:gUDhXQx58YNrpHlK4nSL+7y2pxFZkUcXqzFDKWdC0Oo= -github.com/moby/sys/mountinfo v0.6.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= +github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1727,8 +1727,8 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM github.com/tendermint/fundraising v0.3.1 h1:S4uOV/T7YNBqXhsCZnq/TUoHB0d2kM+6tKeTD4WhLN0= 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.20220921200247-8bafad876bdd h1:Sp1MgPWq73/a8WVJvE/B6/xOt7cXEzLFT/+KBtIiuk8= -github.com/tendermint/spn v0.2.1-0.20220921200247-8bafad876bdd/go.mod h1:p4b3ZAVTgLGxIpXZsXVeQuOxVUk1/kcwBIIlOMTZtsE= +github.com/tendermint/spn v0.2.1-0.20221125172725-052fbf576cb2 h1:3sf/j+p+XFSenqu1DNcjvW01dSPpvx06Xef3EiSvqhg= +github.com/tendermint/spn v0.2.1-0.20221125172725-052fbf576cb2/go.mod h1:GVDvxguSWgSsD5b0CQuWTLEOy41HR28OKXjAFpUNedQ= github.com/tendermint/tendermint v0.34.23 h1:JZYsdc59aOiT5efou+BHILJv8x6FlRyvlor84Xq9Tb0= github.com/tendermint/tendermint v0.34.23/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= @@ -2032,7 +2032,7 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8= +golang.org/x/oauth2 v0.2.0 h1:GtQkldQ9m7yvzCL1V+LrYow3Khe0eJH0w7RbX/VbaIU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2308,8 +2308,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -2337,7 +2337,7 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.93.0 h1:T2xt9gi0gHdxdnRkVQhT8mIvPaXKNsDNWz+L696M66M= +google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2396,8 +2396,8 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a h1:GH6UPn3ixhWcKDhpnEC55S75cerLPdpp3hrhfKYjZgw= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 h1:jCw9YRd2s40X9Vxi4zKsPRvSPlHWNqadVkpbMsCPzPQ= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= diff --git a/ignite/cmd/network.go b/ignite/cmd/network.go index 01dc459367..45238c7831 100644 --- a/ignite/cmd/network.go +++ b/ignite/cmd/network.go @@ -29,8 +29,8 @@ const ( flagSPNNodeAddress = "spn-node-address" flagSPNFaucetAddress = "spn-faucet-address" - spnNodeAddressNightly = "http://178.128.251.28:26657" - spnFaucetAddressNightly = "http://178.128.251.28:4500" + spnNodeAddressNightly = "https://rpc.devnet.ignite.com:443" + spnFaucetAddressNightly = "https://faucet.devnet.ignite.com:443" spnNodeAddressLocal = "http://0.0.0.0:26661" spnFaucetAddressLocal = "http://0.0.0.0:4502" diff --git a/ignite/cmd/network_request.go b/ignite/cmd/network_request.go index 57da021270..234e686a29 100644 --- a/ignite/cmd/network_request.go +++ b/ignite/cmd/network_request.go @@ -33,6 +33,7 @@ Each request has a status: NewNetworkRequestAddAccount(), NewNetworkRequestRemoveAccount(), NewNetworkRequestRemoveValidator(), + NewNetworkRequestChangeParam(), ) return c diff --git a/ignite/cmd/network_request_change_param.go b/ignite/cmd/network_request_change_param.go new file mode 100644 index 0000000000..445abc5cbd --- /dev/null +++ b/ignite/cmd/network_request_change_param.go @@ -0,0 +1,81 @@ +package ignitecmd + +import ( + "github.com/spf13/cobra" + + "github.com/ignite/cli/ignite/pkg/cliui" + "github.com/ignite/cli/ignite/services/network" + "github.com/ignite/cli/ignite/services/network/networkchain" +) + +// NewNetworkRequestChangeParam creates a new command to send param change request +func NewNetworkRequestChangeParam() *cobra.Command { + c := &cobra.Command{ + Use: "change-param [launch-id] [module-name] [param-name] [value (json, string, number)]", + Short: "Send request to change a module param", + RunE: networkRequestChangeParamHandler, + Args: cobra.ExactArgs(4), + } + + flagSetClearCache(c) + c.Flags().AddFlagSet(flagNetworkFrom()) + c.Flags().AddFlagSet(flagSetHome()) + c.Flags().AddFlagSet(flagSetKeyringBackend()) + c.Flags().AddFlagSet(flagSetKeyringDir()) + return c +} + +func networkRequestChangeParamHandler(cmd *cobra.Command, args []string) error { + session := cliui.New(cliui.StartSpinner()) + defer session.End() + + nb, err := newNetworkBuilder(cmd, CollectEvents(session.EventBus())) + if err != nil { + return err + } + + // parse launch ID + launchID, err := network.ParseID(args[0]) + if err != nil { + return err + } + + module := args[1] + param := args[2] + value := []byte(args[3]) + + n, err := nb.Network() + if err != nil { + return err + } + + // fetch chain information + chainLaunch, err := n.ChainLaunch(cmd.Context(), launchID) + if err != nil { + return err + } + + c, err := nb.Chain(networkchain.SourceLaunch(chainLaunch)) + if err != nil { + return err + } + + // check validity of request + err = c.CheckRequestChangeParam( + cmd.Context(), + module, + param, + value, + ) + if err != nil { + return err + } + + return n.SendParamChangeRequest( + cmd.Context(), + launchID, + module, + param, + value, + ) +} diff --git a/ignite/cmd/network_request_list.go b/ignite/cmd/network_request_list.go index a4c37290a0..e55fda3d1e 100644 --- a/ignite/cmd/network_request_list.go +++ b/ignite/cmd/network_request_list.go @@ -154,6 +154,15 @@ func renderRequestSummaries( } content = address + + case *launchtypes.RequestContent_ParamChange: + requestType = "Change Param" + content = fmt.Sprintf( + "module: %s param: %s, value: %s", + req.ParamChange.Module, + req.ParamChange.Param, + string(req.ParamChange.Value), + ) } requestEntries = append(requestEntries, []string{ diff --git a/ignite/cmd/network_request_show.go b/ignite/cmd/network_request_show.go index f767e3101f..e10506739f 100644 --- a/ignite/cmd/network_request_show.go +++ b/ignite/cmd/network_request_show.go @@ -59,6 +59,7 @@ func networkRequestShowHandler(cmd *cobra.Command, args []string) error { requestYaml, err := yaml.Marshal(cmd.Context(), request, "$.Content.content.genesisValidator.genTx", "$.Content.content.genesisValidator.consPubKey", + "$.Content.content.paramChange.value", ) if err != nil { return err diff --git a/ignite/pkg/cosmosutil/genesis/genesis.go b/ignite/pkg/cosmosutil/genesis/genesis.go index 450eb29c39..e82244e585 100644 --- a/ignite/pkg/cosmosutil/genesis/genesis.go +++ b/ignite/pkg/cosmosutil/genesis/genesis.go @@ -2,6 +2,7 @@ package genesis import ( "context" + "fmt" "os" "github.com/ignite/cli/ignite/pkg/jsonfile" @@ -24,6 +25,8 @@ const ( FieldConsensusRootHash = "app_state.monitoringp.params.consumerConsensusState.root.hash" FieldConsumerUnbondingPeriod = "app_state.monitoringp.params.consumerUnbondingPeriod" FieldConsumerRevisionHeight = "app_state.monitoringp.params.consumerRevisionHeight" + + fieldModuleParamFormatString = "app_state.%s.params.%s" ) type ( @@ -37,6 +40,11 @@ type ( gentxs []struct{} ) +// ModuleParamField returns the field name of a given module param pair +func ModuleParamField(module, param string) string { + return fmt.Sprintf(fieldModuleParamFormatString, module, param) +} + // FromPath parse genesis object from path func FromPath(path string) (*Genesis, error) { file, err := jsonfile.FromPath(path) diff --git a/ignite/pkg/cosmosutil/genesis/genesis_test.go b/ignite/pkg/cosmosutil/genesis/genesis_test.go new file mode 100644 index 0000000000..6fe0d3179c --- /dev/null +++ b/ignite/pkg/cosmosutil/genesis/genesis_test.go @@ -0,0 +1,38 @@ +package genesis_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + cosmosgenesis "github.com/ignite/cli/ignite/pkg/cosmosutil/genesis" +) + +func TestModuleParamField(t *testing.T) { + tests := []struct { + name string + module string + param string + want string + }{ + { + name: "valid 1", + module: "foo", + param: "bar", + want: "app_state.foo.params.bar", + }, + { + name: "valid 2", + module: "bar", + param: "foo", + want: "app_state.bar.params.foo", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + got := cosmosgenesis.ModuleParamField(tc.module, tc.param) + require.Equal(t, tc.want, got) + }) + } +} diff --git a/ignite/pkg/jsonfile/jsonfile.go b/ignite/pkg/jsonfile/jsonfile.go index 7ee20f658f..dfa511edfe 100644 --- a/ignite/pkg/jsonfile/jsonfile.go +++ b/ignite/pkg/jsonfile/jsonfile.go @@ -162,7 +162,7 @@ func (f *JSONFile) Bytes() ([]byte, error) { return file, nil } -// Field return the param by key and the position into byte slice from the file reader. +// Field returns the param by key and the position into byte slice from the file reader. // Key can be a path to a nested parameter eg: app_state.staking.accounts func (f *JSONFile) Field(key string, param interface{}) error { file, err := f.Bytes() @@ -201,12 +201,19 @@ func (f *JSONFile) Field(key string, param interface{}) error { } // WithKeyValue update a file value object by key -func WithKeyValue(key string, value string) UpdateFileOption { +func WithKeyValue(key, value string) UpdateFileOption { return func(update map[string][]byte) { update[key] = []byte(`"` + value + `"`) } } +// WithKeyValueByte update a file byte value object by key +func WithKeyValueByte(key string, value []byte) UpdateFileOption { + return func(update map[string][]byte) { + update[key] = value + } +} + // WithKeyValueTimestamp update a time value func WithKeyValueTimestamp(key string, t int64) UpdateFileOption { return func(update map[string][]byte) { diff --git a/ignite/pkg/jsonfile/jsonfile_test.go b/ignite/pkg/jsonfile/jsonfile_test.go index 740664019a..edb243b6ab 100644 --- a/ignite/pkg/jsonfile/jsonfile_test.go +++ b/ignite/pkg/jsonfile/jsonfile_test.go @@ -115,6 +115,9 @@ func TestJSONFile_Field(t *testing.T) { } func TestJSONFile_Update(t *testing.T) { + jsonCoins, err := json.Marshal(sdk.NewCoin("bar", sdk.NewInt(500))) + require.NoError(t, err) + tests := []struct { name string filepath string @@ -179,6 +182,16 @@ func TestJSONFile_Update(t *testing.T) { ), }, }, + { + name: "update bytes", + filepath: "testdata/jsonfile.json", + opts: []UpdateFileOption{ + WithKeyValueByte( + "app_state.crisis.params.constant_fee", + jsonCoins, + ), + }, + }, { name: "add non-existing field", filepath: "testdata/jsonfile.json", diff --git a/ignite/services/network/mocks/launch_client.go b/ignite/services/network/mocks/launch_client.go index 00573aa1a8..ddd36f3fe6 100644 --- a/ignite/services/network/mocks/launch_client.go +++ b/ignite/services/network/mocks/launch_client.go @@ -197,6 +197,36 @@ func (_m *LaunchClient) GenesisValidatorAll(ctx context.Context, in *types.Query return r0, r1 } +// ParamChangeAll provides a mock function with given fields: ctx, in, opts +func (_m *LaunchClient) ParamChangeAll(ctx context.Context, in *types.QueryAllParamChangeRequest, opts ...grpc.CallOption) (*types.QueryAllParamChangeResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *types.QueryAllParamChangeResponse + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryAllParamChangeRequest, ...grpc.CallOption) *types.QueryAllParamChangeResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.QueryAllParamChangeResponse) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *types.QueryAllParamChangeRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // Params provides a mock function with given fields: ctx, in, opts func (_m *LaunchClient) Params(ctx context.Context, in *types.QueryParamsRequest, opts ...grpc.CallOption) (*types.QueryParamsResponse, error) { _va := make([]interface{}, len(opts)) diff --git a/ignite/services/network/networkchain/prepare.go b/ignite/services/network/networkchain/prepare.go index d59aa3b7de..e94318c861 100644 --- a/ignite/services/network/networkchain/prepare.go +++ b/ignite/services/network/networkchain/prepare.go @@ -146,6 +146,10 @@ func (c Chain) buildGenesis( } } + if err := applyParamChanges(genesis, gi.ParamChanges); err != nil { + return fmt.Errorf("error applying param changes to genesis: %w", err) + } + c.ev.Send("Genesis built", events.ProgressFinish()) return nil @@ -253,6 +257,24 @@ func (c Chain) applyGenesisValidators(ctx context.Context, genesisVals []network return c.updateConfigFromGenesisValidators(genesisVals) } +// applyParamChanges applies the param changes into the genesis +func applyParamChanges( + genesis *cosmosgenesis.Genesis, + paramChanges []networktypes.ParamChange, +) error { + changes := make([]jsonfile.UpdateFileOption, len(paramChanges)) + + for i, pc := range paramChanges { + changes[i] = jsonfile.WithKeyValueByte(cosmosgenesis.ModuleParamField(pc.Module, pc.Param), pc.Value) + } + + if err := genesis.Update(changes...); err != nil { + return errors.Wrap(err, "failed to apply param change to genesis") + } + + return nil +} + // updateConfigFromGenesisValidators adds the peer addresses into the config.toml of the chain func (c Chain) updateConfigFromGenesisValidators(genesisVals []networktypes.GenesisValidator) error { var ( diff --git a/ignite/services/network/networkchain/request.go b/ignite/services/network/networkchain/request.go new file mode 100644 index 0000000000..9dd452e327 --- /dev/null +++ b/ignite/services/network/networkchain/request.go @@ -0,0 +1,62 @@ +package networkchain + +import ( + "context" + "fmt" + + "github.com/pkg/errors" + + cosmosgenesis "github.com/ignite/cli/ignite/pkg/cosmosutil/genesis" + "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/ignite/services/network/networktypes" +) + +// CheckRequestChangeParam builds the genesis for the chain from the launch approved requests +func (c Chain) CheckRequestChangeParam( + ctx context.Context, + module, + param string, + value []byte, +) error { + c.ev.Send("Checking the param change", events.ProgressStart()) + + if err := c.initGenesis(ctx); err != nil { + return err + } + + genesisPath, err := c.chain.GenesisPath() + if err != nil { + return errors.Wrap(err, "genesis of the blockchain can't be read") + } + + genesis, err := cosmosgenesis.FromPath(genesisPath) + if err != nil { + return errors.Wrap(err, "genesis of the blockchain can't be parsed") + } + + pc := []networktypes.ParamChange{ + { + Module: module, + Param: param, + Value: value, + }, + } + + if err := applyParamChanges(genesis, pc); err != nil { + return fmt.Errorf("error applying param changes to genesis: %w", err) + } + + cmd, err := c.chain.Commands(ctx) + if err != nil { + return err + } + + // ensure genesis has a valid format + if err := cmd.ValidateGenesis(ctx); err != nil { + return fmt.Errorf("invalid parameter change requested: %w", err) + } + + c.ev.Send("Param change verified", events.ProgressFinish()) + + return nil +} diff --git a/ignite/services/network/networktypes/chainlaunch.go b/ignite/services/network/networktypes/chainlaunch.go index 9153daa120..7b43a51093 100644 --- a/ignite/services/network/networktypes/chainlaunch.go +++ b/ignite/services/network/networktypes/chainlaunch.go @@ -79,7 +79,7 @@ func ToChainLaunch(chain launchtypes.Chain) ChainLaunch { } // check if custom config genesis if provided. - if customGenesisConfig := chain.InitialGenesis.GetConfigGenesis(); customGenesisConfig != nil { + if customGenesisConfig := chain.InitialGenesis.GetGenesisConfig(); customGenesisConfig != nil { launch.GenesisConfig = customGenesisConfig.File } diff --git a/ignite/services/network/networktypes/genesisinformation.go b/ignite/services/network/networktypes/genesisinformation.go index 4752dd1a04..55eb17d111 100644 --- a/ignite/services/network/networktypes/genesisinformation.go +++ b/ignite/services/network/networktypes/genesisinformation.go @@ -17,6 +17,7 @@ type GenesisInformation struct { GenesisAccounts []GenesisAccount VestingAccounts []VestingAccount GenesisValidators []GenesisValidator + ParamChanges []ParamChange } // GenesisAccount represents an account with initial coin allocation for the chain for the chain genesis @@ -42,6 +43,12 @@ type GenesisValidator struct { SelfDelegation sdk.Coin `json:"SelfDelegation,omitempty"` } +type ParamChange struct { + Module string `json:"Module,omitempty"` + Param string `json:"Param,omitempty"` + Value []byte `json:"Value,omitempty"` +} + // ToGenesisAccount converts genesis account from SPN func ToGenesisAccount(acc launchtypes.GenesisAccount) GenesisAccount { return GenesisAccount{ @@ -75,44 +82,72 @@ func ToGenesisValidator(val launchtypes.GenesisValidator) GenesisValidator { } } +// ToParamChange converts param change from SPN +func ToParamChange(pc launchtypes.ParamChange) ParamChange { + return ParamChange{ + Param: pc.Param, + Module: pc.Module, + Value: pc.Value, + } +} + // NewGenesisInformation initializes a new GenesisInformation func NewGenesisInformation( genAccs []GenesisAccount, vestingAccs []VestingAccount, genVals []GenesisValidator, + paramChanges []ParamChange, ) (gi GenesisInformation) { return GenesisInformation{ GenesisAccounts: genAccs, VestingAccounts: vestingAccs, GenesisValidators: genVals, + ParamChanges: paramChanges, } } -func (gi GenesisInformation) ContainsGenesisAccount(address string) bool { - for _, account := range gi.GenesisAccounts { +// ContainsGenesisAccount returns true if GenesisInformation contains given address. +// Returns index if true, -1 if false. +func (gi GenesisInformation) ContainsGenesisAccount(address string) (bool, int) { + for i, account := range gi.GenesisAccounts { if account.Address == address { - return true + return true, i } } - return false + return false, -1 } -func (gi GenesisInformation) ContainsVestingAccount(address string) bool { - for _, account := range gi.VestingAccounts { +// ContainsVestingAccount returns true if GenesisInformation contains given address. +// Returns index if true, -1 if false. +func (gi GenesisInformation) ContainsVestingAccount(address string) (bool, int) { + for i, account := range gi.VestingAccounts { if account.Address == address { - return true + return true, i } } - return false + return false, -1 } -func (gi GenesisInformation) ContainsGenesisValidator(address string) bool { - for _, account := range gi.GenesisValidators { +// ContainsGenesisValidator returns true if GenesisInformation contains given address. +// Returns index if true, -1 if false. +func (gi GenesisInformation) ContainsGenesisValidator(address string) (bool, int) { + for i, account := range gi.GenesisValidators { if account.Address == address { - return true + return true, i } } - return false + return false, -1 +} + +// ContainsParamChange returns true if GenesisInformation contains given module-param pair. +// Returns index if true, -1 if false. +func (gi GenesisInformation) ContainsParamChange(module, param string) (bool, int) { + for i, paramChange := range gi.ParamChanges { + if paramChange.Module == module && paramChange.Param == param { + return true, i + } + } + return false, -1 } func (gi *GenesisInformation) AddGenesisAccount(acc GenesisAccount) { @@ -151,14 +186,23 @@ func (gi *GenesisInformation) RemoveGenesisValidator(address string) { } } +func (gi *GenesisInformation) AddParamChange(pc ParamChange) { + contains, index := gi.ContainsParamChange(pc.Module, pc.Param) + if contains { + gi.ParamChanges[index] = pc + return + } + gi.ParamChanges = append(gi.ParamChanges, pc) +} + // ApplyRequest applies to the genesisInformation the changes implied by the approval of a request func (gi GenesisInformation) ApplyRequest(request Request) (GenesisInformation, error) { switch requestContent := request.Content.Content.(type) { case *launchtypes.RequestContent_GenesisAccount: // new genesis account in the genesis ga := ToGenesisAccount(*requestContent.GenesisAccount) - genExist := gi.ContainsGenesisAccount(ga.Address) - vestingExist := gi.ContainsVestingAccount(ga.Address) + genExist, _ := gi.ContainsGenesisAccount(ga.Address) + vestingExist, _ := gi.ContainsVestingAccount(ga.Address) if genExist || vestingExist { return gi, NewWrappedErrInvalidRequest(request.RequestID, "genesis account already in genesis") } @@ -174,8 +218,8 @@ func (gi GenesisInformation) ApplyRequest(request Request) (GenesisInformation, return gi, err } - genExist := gi.ContainsGenesisAccount(va.Address) - vestingExist := gi.ContainsVestingAccount(va.Address) + genExist, _ := gi.ContainsGenesisAccount(va.Address) + vestingExist, _ := gi.ContainsVestingAccount(va.Address) if genExist || vestingExist { return gi, NewWrappedErrInvalidRequest(request.RequestID, "vesting account already in genesis") } @@ -184,8 +228,8 @@ func (gi GenesisInformation) ApplyRequest(request Request) (GenesisInformation, case *launchtypes.RequestContent_AccountRemoval: // account removed from the genesis ar := requestContent.AccountRemoval - genExist := gi.ContainsGenesisAccount(ar.Address) - vestingExist := gi.ContainsVestingAccount(ar.Address) + genExist, _ := gi.ContainsGenesisAccount(ar.Address) + vestingExist, _ := gi.ContainsVestingAccount(ar.Address) if !genExist && !vestingExist { return gi, NewWrappedErrInvalidRequest(request.RequestID, "account can't be removed because it doesn't exist") } @@ -195,7 +239,7 @@ func (gi GenesisInformation) ApplyRequest(request Request) (GenesisInformation, case *launchtypes.RequestContent_GenesisValidator: // new genesis validator in the genesis gv := ToGenesisValidator(*requestContent.GenesisValidator) - if gi.ContainsGenesisValidator(gv.Address) { + if contains, _ := gi.ContainsGenesisValidator(gv.Address); contains { return gi, NewWrappedErrInvalidRequest(request.RequestID, "genesis validator already in genesis") } gi.AddGenesisValidator(gv) @@ -203,9 +247,14 @@ func (gi GenesisInformation) ApplyRequest(request Request) (GenesisInformation, case *launchtypes.RequestContent_ValidatorRemoval: // validator removed from the genesis vr := requestContent.ValidatorRemoval - if !gi.ContainsGenesisValidator(vr.ValAddress) { + if contains, _ := gi.ContainsGenesisValidator(vr.ValAddress); !contains { return gi, NewWrappedErrInvalidRequest(request.RequestID, "genesis validator can't be removed because it doesn't exist") } + + case *launchtypes.RequestContent_ParamChange: + // param changed in genesis file + pc := ToParamChange(*requestContent.ParamChange) + gi.AddParamChange(pc) } return gi, nil diff --git a/ignite/services/network/networktypes/genesisinformation_test.go b/ignite/services/network/networktypes/genesisinformation_test.go index ffde285121..5223b13058 100644 --- a/ignite/services/network/networktypes/genesisinformation_test.go +++ b/ignite/services/network/networktypes/genesisinformation_test.go @@ -108,6 +108,34 @@ func TestToGenesisValidator(t *testing.T) { } } +func TestToParamChange(t *testing.T) { + tests := []struct { + name string + fetched launchtypes.ParamChange + expected networktypes.ParamChange + }{ + { + name: "param change", + fetched: launchtypes.ParamChange{ + LaunchID: 0, + Module: "foo", + Param: "bar", + Value: []byte("value"), + }, + expected: networktypes.ParamChange{ + Module: "foo", + Param: "bar", + Value: []byte("value"), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.EqualValues(t, tt.expected, networktypes.ToParamChange(tt.fetched)) + }) + } +} + func TestGenesisInformation_ApplyRequest(t *testing.T) { newCoin := func(str string) sdk.Coin { c, err := sdk.ParseCoinNormalized(str) @@ -143,6 +171,13 @@ func TestGenesisInformation_ApplyRequest(t *testing.T) { Peer: launchtypes.NewPeerConn("foo", "foo"), }, }, + []networktypes.ParamChange{ + { + Module: "mint", + Param: "mint_denom", + Value: []byte("\"bar\""), + }, + }, ) tests := []struct { @@ -299,6 +334,13 @@ func TestGenesisInformation_ApplyRequest(t *testing.T) { }, invalidRequest: true, }, + { + name: "change param", + gi: genesisInformation, + r: networktypes.Request{ + Content: launchtypes.NewParamChange(0, "mint", "mint_denom", []byte("\"foo\"")), + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -312,38 +354,38 @@ func TestGenesisInformation_ApplyRequest(t *testing.T) { switch rc := tt.r.Content.Content.(type) { case *launchtypes.RequestContent_GenesisAccount: ga := networktypes.ToGenesisAccount(*rc.GenesisAccount) - require.True(t, newGi.ContainsGenesisAccount(ga.Address)) - for _, account := range newGi.GenesisAccounts { - if account.Address == ga.Address { - require.EqualValues(t, ga, account) - } - } + contains, index := newGi.ContainsGenesisAccount(ga.Address) + require.True(t, contains) + require.EqualValues(t, ga, newGi.GenesisAccounts[index]) case *launchtypes.RequestContent_VestingAccount: va, err := networktypes.ToVestingAccount(*rc.VestingAccount) require.NoError(t, err) - require.True(t, newGi.ContainsVestingAccount(va.Address)) - for _, account := range newGi.VestingAccounts { - if account.Address == va.Address { - require.EqualValues(t, va, account) - } - } + contains, index := newGi.ContainsVestingAccount(va.Address) + require.True(t, contains) + require.EqualValues(t, va, newGi.VestingAccounts[index]) case *launchtypes.RequestContent_AccountRemoval: - require.False(t, newGi.ContainsGenesisAccount(rc.AccountRemoval.Address)) - require.False(t, newGi.ContainsVestingAccount(rc.AccountRemoval.Address)) + contains, _ := newGi.ContainsGenesisAccount(rc.AccountRemoval.Address) + require.False(t, contains) + contains, _ = newGi.ContainsVestingAccount(rc.AccountRemoval.Address) + require.False(t, contains) case *launchtypes.RequestContent_GenesisValidator: gv := networktypes.ToGenesisValidator(*rc.GenesisValidator) - require.True(t, newGi.ContainsGenesisValidator(gv.Address)) - for _, val := range newGi.GenesisValidators { - if val.Address == gv.Address { - require.EqualValues(t, gv, val) - } - } + contains, index := newGi.ContainsGenesisValidator(gv.Address) + require.True(t, contains) + require.EqualValues(t, gv, newGi.GenesisValidators[index]) case *launchtypes.RequestContent_ValidatorRemoval: - require.False(t, newGi.ContainsGenesisAccount(rc.ValidatorRemoval.ValAddress)) + contains, _ := newGi.ContainsGenesisAccount(rc.ValidatorRemoval.ValAddress) + require.False(t, contains) + + case *launchtypes.RequestContent_ParamChange: + pc := networktypes.ToParamChange(*rc.ParamChange) + contains, index := newGi.ContainsParamChange(pc.Module, pc.Param) + require.True(t, contains) + require.EqualValues(t, pc, newGi.ParamChanges[index]) } }) } diff --git a/ignite/services/network/publish.go b/ignite/services/network/publish.go index 77e3c30d84..df0d76c52f 100644 --- a/ignite/services/network/publish.go +++ b/ignite/services/network/publish.go @@ -234,7 +234,7 @@ func (n Network) Publish(ctx context.Context, c Chain, options ...PublishOption) genesisHash, ) case o.genesisConfig != "": - initialGenesis = launchtypes.NewConfigGenesis( + initialGenesis = launchtypes.NewGenesisConfig( o.genesisConfig, ) } diff --git a/ignite/services/network/publish_test.go b/ignite/services/network/publish_test.go index a7efd089da..024a0efb8e 100644 --- a/ignite/services/network/publish_test.go +++ b/ignite/services/network/publish_test.go @@ -468,7 +468,7 @@ func TestPublish(t *testing.T) { GenesisChainID: testutil.ChainID, SourceURL: testutil.ChainSourceURL, SourceHash: testutil.ChainSourceHash, - InitialGenesis: launchtypes.NewConfigGenesis( + InitialGenesis: launchtypes.NewGenesisConfig( testutil.ChainConfigYML, ), HasCampaign: false, diff --git a/ignite/services/network/queries.go b/ignite/services/network/queries.go index 73580734b9..752ba40c09 100644 --- a/ignite/services/network/queries.go +++ b/ignite/services/network/queries.go @@ -86,20 +86,25 @@ func (n Network) ChainLaunchesWithReward(ctx context.Context, pagination *query. func (n Network) GenesisInformation(ctx context.Context, launchID uint64) (gi networktypes.GenesisInformation, err error) { genAccs, err := n.GenesisAccounts(ctx, launchID) if err != nil { - return gi, errors.Wrap(err, "error querying genesis accounts") + return gi, fmt.Errorf("error querying genesis accounts: %w", err) } vestingAccs, err := n.VestingAccounts(ctx, launchID) if err != nil { - return gi, errors.Wrap(err, "error querying vesting accounts") + return gi, fmt.Errorf("error querying vesting accounts: %w", err) } genVals, err := n.GenesisValidators(ctx, launchID) if err != nil { - return gi, errors.Wrap(err, "error querying genesis validators") + return gi, fmt.Errorf("error querying genesis validators: %w", err) } - return networktypes.NewGenesisInformation(genAccs, vestingAccs, genVals), nil + paramChanges, err := n.ParamChanges(ctx, launchID) + if err != nil { + return gi, fmt.Errorf("error querying param changes: %w", err) + } + + return networktypes.NewGenesisInformation(genAccs, vestingAccs, genVals, paramChanges), nil } // GenesisAccounts returns the list of approved genesis accounts for a launch from SPN @@ -167,6 +172,26 @@ func (n Network) GenesisValidators(ctx context.Context, launchID uint64) (genVal return genVals, nil } +// ParamChanges returns the list of approved param changes for a launch from SPN +func (n Network) ParamChanges(ctx context.Context, launchID uint64) (paramChanges []networktypes.ParamChange, err error) { + n.ev.Send("Fetching param changes", events.ProgressStart()) + res, err := n.launchQuery. + ParamChangeAll(ctx, + &launchtypes.QueryAllParamChangeRequest{ + LaunchID: launchID, + }, + ) + if err != nil { + return paramChanges, err + } + + for _, pc := range res.ParamChanges { + paramChanges = append(paramChanges, networktypes.ToParamChange(pc)) + } + + return paramChanges, nil +} + // MainnetAccount returns the project mainnet account for a launch from SPN func (n Network) MainnetAccount( ctx context.Context, diff --git a/ignite/services/network/request.go b/ignite/services/network/request.go index 88c3f1fe5a..b3f3416177 100644 --- a/ignite/services/network/request.go +++ b/ignite/services/network/request.go @@ -291,3 +291,52 @@ func (n Network) SendAccountRemoveRequest( } return nil } + +// SendParamChangeRequest creates the RequestParamChange message to SPN +func (n Network) SendParamChangeRequest( + ctx context.Context, + launchID uint64, + module, + param string, + value []byte, +) error { + addr, err := n.account.Address(networktypes.SPN) + if err != nil { + return err + } + + msg := launchtypes.NewMsgSendRequest( + addr, + launchID, + launchtypes.NewParamChange( + launchID, + module, + param, + value, + ), + ) + + n.ev.Send("Broadcasting transaction", events.ProgressStart()) + + res, err := n.cosmos.BroadcastTx(ctx, n.account, msg) + if err != nil { + return err + } + + var requestRes launchtypes.MsgSendRequestResponse + if err := res.Decode(&requestRes); err != nil { + return err + } + + if requestRes.AutoApproved { + n.ev.Send("Param changed on network by the coordinator!", events.ProgressFinish()) + } else { + n.ev.Send( + fmt.Sprintf( + "Request %d to change param on the network has been submitted!", requestRes.RequestID, + ), + events.ProgressFinish(), + ) + } + return nil +} diff --git a/ignite/services/network/request_test.go b/ignite/services/network/request_test.go new file mode 100644 index 0000000000..3c6a134c04 --- /dev/null +++ b/ignite/services/network/request_test.go @@ -0,0 +1,53 @@ +package network + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + launchtypes "github.com/tendermint/spn/x/launch/types" + + "github.com/ignite/cli/ignite/services/network/networktypes" + "github.com/ignite/cli/ignite/services/network/testutil" +) + +func TestRequestParamChange(t *testing.T) { + t.Run("successfully send request", func(t *testing.T) { + var ( + account = testutil.NewTestAccount(t, testutil.TestAccountName) + suite, network = newSuite(account) + module = "module" + param = "param" + value = []byte("value") + ) + + addr, err := account.Address(networktypes.SPN) + require.NoError(t, err) + + suite.CosmosClientMock. + On( + "BroadcastTx", + context.Background(), + account, + launchtypes.NewMsgSendRequest( + addr, + testutil.LaunchID, + launchtypes.NewParamChange( + testutil.LaunchID, + module, + param, + value, + ), + ), + ). + Return(testutil.NewResponse(&launchtypes.MsgSendRequestResponse{ + RequestID: 0, + AutoApproved: false, + }), nil). + Once() + + sendRequestError := network.SendParamChangeRequest(context.Background(), testutil.LaunchID, module, param, value) + require.NoError(t, sendRequestError) + suite.AssertAllMocks(t) + }) +} diff --git a/ignite/services/network/reward_test.go b/ignite/services/network/reward_test.go index 3bbb168ac7..c9d02c4838 100644 --- a/ignite/services/network/reward_test.go +++ b/ignite/services/network/reward_test.go @@ -17,10 +17,10 @@ import ( func TestSetReward(t *testing.T) { t.Run("successfully set reward", func(t *testing.T) { var ( - account = testutil.NewTestAccount(t, testutil.TestAccountName) - suite, network = newSuite(account) - coins = sdk.NewCoins(sdk.NewCoin(TestDenom, sdkmath.NewInt(TestAmountInt))) - lastRewarHeight = int64(10) + account = testutil.NewTestAccount(t, testutil.TestAccountName) + suite, network = newSuite(account) + coins = sdk.NewCoins(sdk.NewCoin(TestDenom, sdkmath.NewInt(TestAmountInt))) + lastRewardHeight = int64(10) ) addr, err := account.Address(networktypes.SPN) @@ -35,28 +35,28 @@ func TestSetReward(t *testing.T) { Provider: addr, LaunchID: testutil.LaunchID, Coins: coins, - LastRewardHeight: lastRewarHeight, + LastRewardHeight: lastRewardHeight, }, ). Return(testutil.NewResponse(&rewardtypes.MsgSetRewardsResponse{ PreviousCoins: nil, - PreviousLastRewardHeight: lastRewarHeight - 1, + PreviousLastRewardHeight: lastRewardHeight - 1, NewCoins: coins, - NewLastRewardHeight: lastRewarHeight, + NewLastRewardHeight: lastRewardHeight, }), nil). Once() - setRewardError := network.SetReward(context.Background(), testutil.LaunchID, lastRewarHeight, coins) + setRewardError := network.SetReward(context.Background(), testutil.LaunchID, lastRewardHeight, coins) require.NoError(t, setRewardError) suite.AssertAllMocks(t) }) t.Run("failed to set reward, failed to broadcast set reward tx", func(t *testing.T) { var ( - account = testutil.NewTestAccount(t, testutil.TestAccountName) - suite, network = newSuite(account) - coins = sdk.NewCoins(sdk.NewCoin(TestDenom, sdkmath.NewInt(TestAmountInt))) - lastRewarHeight = int64(10) - expectedErr = errors.New("failed to set reward") + account = testutil.NewTestAccount(t, testutil.TestAccountName) + suite, network = newSuite(account) + coins = sdk.NewCoins(sdk.NewCoin(TestDenom, sdkmath.NewInt(TestAmountInt))) + lastRewardHeight = int64(10) + expectedErr = errors.New("failed to set reward") ) addr, err := account.Address(networktypes.SPN) @@ -71,12 +71,12 @@ func TestSetReward(t *testing.T) { Provider: addr, LaunchID: testutil.LaunchID, Coins: coins, - LastRewardHeight: lastRewarHeight, + LastRewardHeight: lastRewardHeight, }, ). Return(testutil.NewResponse(&rewardtypes.MsgSetRewardsResponse{}), expectedErr). Once() - setRewardError := network.SetReward(context.Background(), testutil.LaunchID, lastRewarHeight, coins) + setRewardError := network.SetReward(context.Background(), testutil.LaunchID, lastRewardHeight, coins) require.Error(t, setRewardError) require.Equal(t, expectedErr, setRewardError) suite.AssertAllMocks(t) diff --git a/integration/network/genesis.json b/integration/network/genesis.json new file mode 100644 index 0000000000..09b0c6938a --- /dev/null +++ b/integration/network/genesis.json @@ -0,0 +1,227 @@ +{ + "genesis_time": "0001-01-01T00:00:00Z", + "chain_id": "example-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "22020096", + "max_gas": "-1", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [], + "supply": [], + "denom_metadata": [] + }, + "capability": { + "index": "1", + "owners": [] + }, + "crisis": { + "constant_fee": { + "denom": "stake", + "amount": "1000" + } + }, + "distribution": { + "params": { + "community_tax": "0.020000000000000000", + "base_proposer_reward": "0.010000000000000000", + "bonus_proposer_reward": "0.040000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "evidence": { + "evidence": [] + }, + "example": { + "params": {} + }, + "feegrant": { + "allowances": [] + }, + "genutil": { + "gen_txs": [] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "stake", + "amount": "10000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "172800s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "group": { + "group_seq": "0", + "groups": [], + "group_members": [], + "group_policy_seq": "0", + "group_policies": [], + "proposal_seq": "0", + "proposals": [], + "votes": [] + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "interchainaccounts": { + "controller_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "ports": [], + "params": { + "controller_enabled": true + } + }, + "host_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "port": "icahost", + "params": { + "host_enabled": true, + "allow_messages": [] + } + } + }, + "mint": { + "minter": { + "inflation": "0.130000000000000000", + "annual_provisions": "0.000000000000000000" + }, + "params": { + "mint_denom": "bar", + "inflation_rate_change": "0.130000000000000000", + "inflation_max": "0.200000000000000000", + "inflation_min": "0.070000000000000000", + "goal_bonded": "0.670000000000000000", + "blocks_per_year": "6311520" + } + }, + "params": null, + "slashing": { + "params": { + "signed_blocks_window": "100", + "min_signed_per_window": "0.500000000000000000", + "downtime_jail_duration": "600s", + "slash_fraction_double_sign": "0.050000000000000000", + "slash_fraction_downtime": "0.010000000000000000" + }, + "signing_infos": [], + "missed_blocks": [] + }, + "staking": { + "params": { + "unbonding_time": "1814400s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "stake", + "min_commission_rate": "0.000000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} \ No newline at end of file diff --git a/integration/network/network_test.go b/integration/network/network_test.go index 4c94615f42..23e5a5523d 100644 --- a/integration/network/network_test.go +++ b/integration/network/network_test.go @@ -143,7 +143,7 @@ func TestNetworkPublish(t *testing.T) { require.NoError(t, isBackendAliveErr, "spn cannot get online in time") } -func TestNetworkPublishConfigGenesis(t *testing.T) { +func TestNetworkPublishGenesisConfig(t *testing.T) { var ( spnPath = cloneSPN(t) env = envtest.New(t) diff --git a/integration/network/request_test.go b/integration/network/request_test.go new file mode 100644 index 0000000000..b1057fd91c --- /dev/null +++ b/integration/network/request_test.go @@ -0,0 +1,86 @@ +package network_test + +import ( + "bytes" + "context" + "path" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ignite/cli/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/integration" +) + +func TestNetworkRequestParam(t *testing.T) { + var ( + spnPath = cloneSPN(t) + env = envtest.New(t) + spn = env.App( + spnPath, + envtest.AppHomePath(t.TempDir()), + envtest.AppConfigPath(path.Join(spnPath, spnConfigFile)), + ) + ) + + var ( + ctx, cancel = context.WithTimeout(env.Ctx(), envtest.ServeTimeout) + isBackendAliveErr error + ) + + // Make sure that the SPN config file is at the latest version + migrateSPNConfig(t, spnPath) + + validator := spn.Config().Validators[0] + servers, err := validator.GetServers() + require.NoError(t, err) + + go func() { + defer cancel() + + if isBackendAliveErr = env.IsAppServed(ctx, servers.API.Address); isBackendAliveErr != nil { + return + } + var b bytes.Buffer + env.Exec("publish planet chain to spn", + step.NewSteps(step.New( + step.Exec( + envtest.IgniteApp, + "network", "chain", "publish", + "https://github.com/ignite/example", + "--local", + // The hash is used to be sure the test uses the right config + // version. Hash value must be updated to the latest when the + // config version in the repository is updated to a new version. + "--hash", "b8b2cc2876c982dd4a049ed16b9a6099eca000aa", + ), + step.Stdout(&b), + ), + step.New( + step.Exec( + envtest.IgniteApp, + "network", "request", "change-param", + "1", "mint", "mint_denom", "\"bar\"", + "--local", + ), + step.Stdout(&b), + ), + step.New( + step.Exec( + envtest.IgniteApp, + "network", "chain", "show", "genesis", + "1", + "--local", + ), + step.Stdout(&b), + ), + ), + ) + require.False(t, env.HasFailed(), b.String()) + t.Log(b.String()) + }() + + env.Must(spn.Serve("serve spn chain", envtest.ExecCtx(ctx))) + + require.NoError(t, isBackendAliveErr, "spn cannot get online in time") +} From a645f1ef1789579cc5fb91c4da41a416343664b8 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Thu, 8 Dec 2022 20:59:48 +0100 Subject: [PATCH 2/2] chore(CI): not check local urls for the md files (#3260) * not check local urls for the md lint checker and use local urls instead full url * remove quiet mode * replace base url for local files * fix base url for local links * fix base url * test a break link * test a break link * fix some broken links * fix bounty link * fix patterns * fix youtube link * remove unuseless / in the end of the url --- .github/workflows/md-link-checker-config.json | 11 ++++++++ .github/workflows/md-link-checker.yml | 3 +- .gitpod/readme.md | 8 +++--- contributing.md | 4 +-- docs/docs/clients/01-typescript.md | 4 +-- docs/docs/contributing/02-technical-setup.md | 4 +-- .../templates/02-tutorial-template.md | 4 +-- docs/docs/guide/02-getting-started.md | 4 +-- docs/docs/guide/05-nameservice/00-tutorial.md | 4 +-- docs/docs/guide/05-nameservice/01-init.md | 4 +-- docs/docs/guide/05-nameservice/02-messages.md | 2 +- docs/docs/guide/05-nameservice/03-types.md | 4 +-- docs/docs/guide/08-loan.md | 2 +- docs/docs/kb/07-frontend.md | 2 +- docs/readme.md | 2 +- .../version-v0.25.2/clients/01-typescript.md | 4 +-- .../contributing/02-technical-setup.md | 4 +-- .../templates/02-tutorial-template.md | 4 +-- .../guide/04-nameservice/00-tutorial.md | 8 +++--- .../guide/04-nameservice/01-init.md | 2 +- .../guide/04-nameservice/02-messages.md | 2 +- .../guide/04-nameservice/03-types.md | 2 +- .../version-v0.25.2/guide/06-loan.md | 2 +- docs/versioned_docs/version-v0.25.2/index.md | 2 +- .../version-v0.25.2/kb/00-kb.md | 2 +- .../version-v0.25.2/kb/07-frontend.md | 2 +- ignite/cmd/cmd.go | 2 +- readme.md | 28 +++++++++---------- 28 files changed, 68 insertions(+), 58 deletions(-) diff --git a/.github/workflows/md-link-checker-config.json b/.github/workflows/md-link-checker-config.json index 1299f33f48..1c5ff6e428 100644 --- a/.github/workflows/md-link-checker-config.json +++ b/.github/workflows/md-link-checker-config.json @@ -6,6 +6,9 @@ { "pattern": "^https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax" }, + { + "pattern": "^https://docs.starport.network" + }, { "pattern": "^http://localhost" }, @@ -13,6 +16,14 @@ "pattern": "^index.md" } ], + "replacementPatterns": [ + { + "pattern": "^/", + "replacement": "https://docs.ignite.com/" + } + ], + "baseUrl": "https://docs.ignite.com", + "projectBaseUrl": "https://docs.ignite.com", "timeout": "20s", "retryOn429": true, "retryCount": 5, diff --git a/.github/workflows/md-link-checker.yml b/.github/workflows/md-link-checker.yml index 3721c3988e..5e716d8311 100644 --- a/.github/workflows/md-link-checker.yml +++ b/.github/workflows/md-link-checker.yml @@ -7,7 +7,6 @@ jobs: - uses: actions/checkout@v3.1.0 - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 with: - folder-path: "docs" - use-quiet-mode: 'yes' + folder-path: "." use-verbose-mode: 'yes' config-file: '.github/workflows/md-link-checker-config.json' \ No newline at end of file diff --git a/.gitpod/readme.md b/.gitpod/readme.md index 7408b309a1..3503c1fd98 100644 --- a/.gitpod/readme.md +++ b/.gitpod/readme.md @@ -42,7 +42,7 @@ ignite chain serve curl https://get.ignite.com/cli | bash ``` -The latest `ignite` binary is downloaded from the project repo and installed in `/usr/local/bin`. Learn more about [installing Ignite CLI](https://docs.ignite.com/guide/install.html). +The latest `ignite` binary is downloaded from the project repo and installed in `/usr/local/bin`. Learn more about [installing Ignite CLI](https://docs.ignite.com/guide/install). ## Stay in touch @@ -54,8 +54,8 @@ Ignite CLI is a free and open source product maintained by [Ignite](https://igni * [ignite.com website](https://ignite.com) * [@ignite_dev on Twitter](https://twitter.com/ignite_dev) -* [ignite.com/blog](https://ignite.com/blog/) +* [ignite.com/blog](https://ignite.com/blog) * [Ignite Discord](https://discord.gg/ignite) -* [Ignite YouTube](https://www.youtube.com/channel/ignitehq) -* [Ignite docs](https://docs.ignite.com/) +* [Ignite YouTube](https://www.youtube.com/@ignitehq) +* [Ignite docs](https://docs.ignite.com) * [Ignite jobs](https://ignite.com/careers) diff --git a/contributing.md b/contributing.md index 9488ec4598..6cf2d02139 100644 --- a/contributing.md +++ b/contributing.md @@ -40,7 +40,7 @@ Review the issues and discussions before you open a PR. Avoid long names in your PR titles. Make sure your title has fewer than 60 characters. -Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines and keywords to find the best +Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) guidelines and keywords to find the best title. Use parentheses to identify the package or feature that you worked on. For example: `feat(services/chain)` @@ -69,7 +69,7 @@ used as the commit message. When you open a PR for the Ignite CLI codebase, you must also update the relevant documentation. For changes to: * [Developer Guide](https://docs.ignite.com/guide) tutorials, update content in the `/docs/guide` folder. -* [Knowledge Base](https://docs.ignite.com/kb/), update content in the `/docs/kb` folder. +* [Knowledge Base](https://docs.ignite.com/kb), update content in the `/docs/kb` folder. * [Ignite CLI reference](https://docs.ignite.com/cli), navigate to the `./ignite/cmd` package and update the documentation of the related command from its `cobra.Command` struct. The CLI docs are automatically generated, so do not make changes to `docs/cli/index.md`. diff --git a/docs/docs/clients/01-typescript.md b/docs/docs/clients/01-typescript.md index f21a0aaded..d40055774e 100644 --- a/docs/docs/clients/01-typescript.md +++ b/docs/docs/clients/01-typescript.md @@ -32,9 +32,9 @@ ignite generate ts-client ## Setup -The best way to get started building with the TypeScript client is by using a [Vite](https://vitejs.dev/) boilerplate. +The best way to get started building with the TypeScript client is by using a [Vite](https://vitejs.dev) boilerplate. Vite provides boilerplate code for vanilla TS projects as well as react, vue, lit, svelte and preact frameworks. -You can find additional information at the [Vite Getting Started guide](https://vitejs.dev/guide/). +You can find additional information at the [Vite Getting Started guide](https://vitejs.dev/guide). You will also need to polyfill the client's dependencies. The following is an example of setting up a vanilla TS project with the necessary polyfills. diff --git a/docs/docs/contributing/02-technical-setup.md b/docs/docs/contributing/02-technical-setup.md index 4a8ecd6be2..06318465d5 100644 --- a/docs/docs/contributing/02-technical-setup.md +++ b/docs/docs/contributing/02-technical-setup.md @@ -9,7 +9,7 @@ technical setup. ## Setting up Visual Studio Code -1. Install [Visual Studio Code](https://vscode-docs.readthedocs.io/en/latest/editor/setup/). +1. Install [Visual Studio Code](https://vscode-docs.readthedocs.io/en/latest/editor/setup). 2. Click **Extensions** in the sidebar. 3. Install this extension: - Go for VS Code The official Go extension for Visual Studio Code @@ -39,7 +39,7 @@ Master your terminal to be happy. ### iTerm2 terminal emulator -On macOS, install the [iTerm2](https://iterm2.com/) OSS terminal emulator as a replacement for the default Terminal app. +On macOS, install the [iTerm2](https://iterm2.com) OSS terminal emulator as a replacement for the default Terminal app. Installing iTerm2 as a replacement for Terminal provides an updated version of the Bash shell that supports useful features like programmable completion. diff --git a/docs/docs/contributing/templates/02-tutorial-template.md b/docs/docs/contributing/templates/02-tutorial-template.md index 15ac0ea367..682380047f 100644 --- a/docs/docs/contributing/templates/02-tutorial-template.md +++ b/docs/docs/contributing/templates/02-tutorial-template.md @@ -71,9 +71,9 @@ To complete this tutorial, you will need: diff --git a/docs/docs/guide/02-getting-started.md b/docs/docs/guide/02-getting-started.md index 1cb760ca71..a9c979ef45 100644 --- a/docs/docs/guide/02-getting-started.md +++ b/docs/docs/guide/02-getting-started.md @@ -29,7 +29,7 @@ following command: ignite scaffold chain example ``` -The [`ignite scaffold chain`](https://docs.ignite.com/cli#ignite-scaffold-chain) command will create a +The [`ignite scaffold chain`](/cli#ignite-scaffold-chain) command will create a new blockchain in a new directory `example`. The new blockchain is built using the Cosmos SDK framework and imports several @@ -132,7 +132,7 @@ To start a blockchain node in development, you can run the following command: ignite chain serve ``` -The [`ignite chain serve`](https://docs.ignite.com/cli#ignite-scaffold-chain) command is used to start +The [`ignite chain serve`](/cli#ignite-scaffold-chain) command is used to start a blockchain node in development mode. It first compiles and installs the binary using the `ignite chain build` command, then initializes the blockchain's data directory for a single validator using the `ignite chain init` command. After diff --git a/docs/docs/guide/05-nameservice/00-tutorial.md b/docs/docs/guide/05-nameservice/00-tutorial.md index 25ace16bf3..3ead5a324a 100644 --- a/docs/docs/guide/05-nameservice/00-tutorial.md +++ b/docs/docs/guide/05-nameservice/00-tutorial.md @@ -49,9 +49,9 @@ blockchain app developer, you have to define the state machine with a starting state and messages that trigger state transitions. These software components make it all possible! -- [Ignite CLI](https://docs.ignite.com/) is built on top of Cosmos SDK and +- [Ignite CLI](/) is built on top of Cosmos SDK and accelerates chain development by scaffolding everything you need. -- The [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/) modular framework +- The [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) modular framework allows developers like you to create custom blockchains that can natively interact with other blockchains. - [Tendermint](https://docs.tendermint.com/main/introduction/what-is-tendermint.html) diff --git a/docs/docs/guide/05-nameservice/01-init.md b/docs/docs/guide/05-nameservice/01-init.md index 2e61414b64..902d00f3f2 100644 --- a/docs/docs/guide/05-nameservice/01-init.md +++ b/docs/docs/guide/05-nameservice/01-init.md @@ -12,7 +12,7 @@ so that end users can buy names and set a value to the names. ## Create a Blockchain Scaffold a new Cosmos SDK blockchain using the `ignite scaffold chain` command. -The [`ignite scaffold chain`](https://docs.ignite.com/cli#ignite-scaffold-chain) +The [`ignite scaffold chain`](/cli#ignite-scaffold-chain) command accepts one argument: the Go module path that is used for the project. By default, a chain is scaffolded with a new empty Cosmos SDK module. You want @@ -52,7 +52,7 @@ ignite scaffold module nameservice --dep bank ## Results -The [`ignite scaffold module`](https://docs.ignite.com/cli#ignite-scaffold-module) command has done all the work for you! +The [`ignite scaffold module`](/cli#ignite-scaffold-module) command has done all the work for you! - The `nameservice` module was created in the `x/nameservice` directory. - The `nameservice` module was imported into the blockchain in the `app/app.go` diff --git a/docs/docs/guide/05-nameservice/02-messages.md b/docs/docs/guide/05-nameservice/02-messages.md index 43492e10bd..243fb644ca 100644 --- a/docs/docs/guide/05-nameservice/02-messages.md +++ b/docs/docs/guide/05-nameservice/02-messages.md @@ -81,7 +81,7 @@ Use the `ignite scaffold message` command to scaffold new messages for your module. - The [`ignite scaffold - message`](https://docs.ignite.com/#ignite-scaffold-message) command accepts + message`](/cli#ignite-scaffold-message) command accepts the message name as the first argument and a list of fields for the message. - By default, a message is scaffolded in a module with a name that matches the name of the project, in this case `nameservice`. diff --git a/docs/docs/guide/05-nameservice/03-types.md b/docs/docs/guide/05-nameservice/03-types.md index b463fd8bf9..5bbdc215ab 100644 --- a/docs/docs/guide/05-nameservice/03-types.md +++ b/docs/docs/guide/05-nameservice/03-types.md @@ -16,7 +16,7 @@ For the nameservice blockchain, define a `whois` type and the create and delete methods. Because Ignite CLI does the heavy lifting for you, choose from several [ignite -scaffold](https://docs.ignite.com/cli#ignite-scaffold) commands to create CRUD +scaffold](/cli#ignite-scaffold) commands to create CRUD functionality code for data stored in different ways: - Array, a list-like data structure @@ -25,7 +25,7 @@ functionality code for data stored in different ways: ## Add the whois Type -Use the [`ignite scaffold map`](https://docs.ignite.com/cli#ignite-scaffold-map) +Use the [`ignite scaffold map`](/cli#ignite-scaffold-map) command to scaffold the `whois` type and create the code that implements CRUD functionality to create, read, update, and delete information about names. diff --git a/docs/docs/guide/08-loan.md b/docs/docs/guide/08-loan.md index 330d351129..54d0ab31f5 100644 --- a/docs/docs/guide/08-loan.md +++ b/docs/docs/guide/08-loan.md @@ -105,7 +105,7 @@ Use the `--dep` flag to specify that this module depends on and is going to inte ## Scaffold a list -Use the [scaffold list](https://docs.ignite.com/cli#ignite-scaffold-list) command to scaffold code necessary to store +Use the [scaffold list](/cli#ignite-scaffold-list) command to scaffold code necessary to store loans in an array-like data structure: ```bash diff --git a/docs/docs/kb/07-frontend.md b/docs/docs/kb/07-frontend.md index 016f60cd01..cf3db4c4c3 100644 --- a/docs/docs/kb/07-frontend.md +++ b/docs/docs/kb/07-frontend.md @@ -24,7 +24,7 @@ client: path: vue/src/store ``` -When using this configuration a TS client is generated in the `ts-client` directory (see: [TypeScript client information](https://docs.ignite.com/clients/typescript)) +When using this configuration a TS client is generated in the `ts-client` directory (see: [TypeScript client information](/clients/typescript)) and Vuex store modules making use of this client are generated in the `vue/src/store` directory. ## Client code generation diff --git a/docs/readme.md b/docs/readme.md index 53284bac9d..257147aea0 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,6 +1,6 @@ # Website -This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. +This website is built using [Docusaurus 2](https://docusaurus.io), a modern static website generator. ### Installation diff --git a/docs/versioned_docs/version-v0.25.2/clients/01-typescript.md b/docs/versioned_docs/version-v0.25.2/clients/01-typescript.md index 6b60708786..4dd8e148e3 100644 --- a/docs/versioned_docs/version-v0.25.2/clients/01-typescript.md +++ b/docs/versioned_docs/version-v0.25.2/clients/01-typescript.md @@ -37,8 +37,8 @@ To prevent regenerating the client, remove the `client:typescript` property from ## Setup -The best way to get started building with the TypeScript client is by using a [Vite](https://vitejs.dev/) boilerplate. Vite provides boilerplates for vanilla TS projects as well as react, vue, lit, svelte and preact frameworks. -You can find additional information at the [Vite Getting Started guide](https://vitejs.dev/guide/). +The best way to get started building with the TypeScript client is by using a [Vite](https://vitejs.dev) boilerplate. Vite provides boilerplates for vanilla TS projects as well as react, vue, lit, svelte and preact frameworks. +You can find additional information at the [Vite Getting Started guide](https://vitejs.dev/guide). You will also need to polyfill the client's dependencies. The following is an example of setting up a vanilla TS project with the necessary polyfills. diff --git a/docs/versioned_docs/version-v0.25.2/contributing/02-technical-setup.md b/docs/versioned_docs/version-v0.25.2/contributing/02-technical-setup.md index 9d1d9a8001..d295f14b76 100644 --- a/docs/versioned_docs/version-v0.25.2/contributing/02-technical-setup.md +++ b/docs/versioned_docs/version-v0.25.2/contributing/02-technical-setup.md @@ -7,7 +7,7 @@ To ensure you have a successful experience working with our Developer Tutorials ## Setting up Visual Studio Code -1. Install [Visual Studio Code](https://vscode-docs.readthedocs.io/en/latest/editor/setup/). +1. Install [Visual Studio Code](https://vscode-docs.readthedocs.io/en/latest/editor/setup). 1. Click **Extensions** in the sidebar. 1. Install this extension: - Go for VS Code The official Go extension for Visual Studio Code @@ -35,7 +35,7 @@ Master your terminal to be happy. ### iTerm2 terminal emulator -On macOS, install the [iTerm2](https://iterm2.com/) OSS terminal emulator as a replacement for the default Terminal app. Installing iTerm2 as a replacement for Terminal provides an updated version of the Bash shell that supports useful features like programmable completion. +On macOS, install the [iTerm2](https://iterm2.com) OSS terminal emulator as a replacement for the default Terminal app. Installing iTerm2 as a replacement for Terminal provides an updated version of the Bash shell that supports useful features like programmable completion. ### Using ZSH as your default shell diff --git a/docs/versioned_docs/version-v0.25.2/contributing/templates/02-tutorial-template.md b/docs/versioned_docs/version-v0.25.2/contributing/templates/02-tutorial-template.md index 9db57f9b38..111cead287 100644 --- a/docs/versioned_docs/version-v0.25.2/contributing/templates/02-tutorial-template.md +++ b/docs/versioned_docs/version-v0.25.2/contributing/templates/02-tutorial-template.md @@ -62,9 +62,9 @@ To complete this tutorial, you will need: diff --git a/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/00-tutorial.md b/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/00-tutorial.md index 526f8749ce..fb6f993bcb 100644 --- a/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/00-tutorial.md +++ b/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/00-tutorial.md @@ -26,9 +26,9 @@ This tutorial guides you through these steps to build a blockchain for a nameser ## Prerequisites -- A supported version of [Ignite CLI](https://docs.ignite.com/). To install Ignite CLI, see [Install Ignite CLI](../01-install.md). +- A supported version of [Ignite CLI](/). To install Ignite CLI, see [Install Ignite CLI](../01-install.md). * A text editor like [Visual Studio Code](https://code.visualstudio.com/download). -* A web browser like [Chrome](https://www.google.com/chrome/) or [Firefox](https://www.mozilla.org/en-US/firefox/new/). +* A web browser like [Chrome](https://www.google.com/chrome) or [Firefox](https://www.mozilla.org/en-US/firefox/new). - Familiarity with [Cosmos SDK modules](https://docs.cosmos.network/main/building-modules/intro.html) ## Nameservice App Goals @@ -41,8 +41,8 @@ First, see how these simple requirements translate to app design. A blockchain app is a [replicated deterministic state machine](https://en.wikipedia.org/wiki/State_machine_replication). As a blockchain app developer, you have to define the state machine with a starting state and messages that trigger state transitions. These software components make it all possible! -- [Ignite CLI](https://docs.ignite.com/) is built on top of Cosmos SDK and accelerates chain development by scaffolding everything you need. -- The [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/) modular framework allows developers like you to create custom blockchains that can natively interact with other blockchains. +- [Ignite CLI](/) is built on top of Cosmos SDK and accelerates chain development by scaffolding everything you need. +- The [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) modular framework allows developers like you to create custom blockchains that can natively interact with other blockchains. - [Tendermint](https://docs.tendermint.com/main/introduction/what-is-tendermint.html) software securely and consistently replicates an app on many machines. The Tendermint app-agnostic engine handles the networking and consensus layers of your blockchain. ## Cosmos SDK Modules diff --git a/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/01-init.md b/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/01-init.md index b03814ce7a..f44a918f8a 100644 --- a/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/01-init.md +++ b/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/01-init.md @@ -9,7 +9,7 @@ Scaffold a blockchain and create a `nameservice` module for the nameservice app. ## Create a Blockchain -Scaffold a new Cosmos SDK blockchain using the `ignite scaffold chain` command. The [ignite scaffold chain](https://docs.ignite.com/cli#ignite-scaffold-chain) command accepts one argument: the Go module path that is used for the project. +Scaffold a new Cosmos SDK blockchain using the `ignite scaffold chain` command. The [ignite scaffold chain](/cli#ignite-scaffold-chain) command accepts one argument: the Go module path that is used for the project. By default, a chain is scaffolded with a new empty Cosmos SDK module. You want to create the nameservice module without scaffolding a module, so use the `--no-module` flag: diff --git a/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/02-messages.md b/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/02-messages.md index b5b3616613..add5059651 100644 --- a/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/02-messages.md +++ b/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/02-messages.md @@ -70,7 +70,7 @@ Now, you are ready to implement these Cosmos SDK messages to achieve the desired Use the `ignite scaffold message` command to scaffold new messages for your module. -- The [`ignite scaffold message`](https://docs.ignite.com/#ignite-scaffold-message) command accepts the message name as the first argument and a list of fields for the message. +- The [`ignite scaffold message`](/cli#ignite-scaffold-message) command accepts the message name as the first argument and a list of fields for the message. - By default, a message is scaffolded in a module with a name that matches the name of the project, in this case `nameservice`. ### Add the MsgBuyName Message diff --git a/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/03-types.md b/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/03-types.md index be3c71c9c7..f76215e56f 100644 --- a/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/03-types.md +++ b/docs/versioned_docs/version-v0.25.2/guide/04-nameservice/03-types.md @@ -11,7 +11,7 @@ Now that you've defined messages that trigger state transitions, it's time to im For the nameservice blockchain, define a `whois` type and the create and delete methods. -Because Ignite CLI does the heavy lifting for you, choose from several [ignite scaffold](https://docs.ignite.com/cli#ignite-scaffold) commands to create CRUD functionality code for data stored in different ways: +Because Ignite CLI does the heavy lifting for you, choose from several [ignite scaffold](/cli#ignite-scaffold) commands to create CRUD functionality code for data stored in different ways: - Array, a list-like data structure - Map (key-value pairs) diff --git a/docs/versioned_docs/version-v0.25.2/guide/06-loan.md b/docs/versioned_docs/version-v0.25.2/guide/06-loan.md index ff8c8d3068..1172deb67e 100644 --- a/docs/versioned_docs/version-v0.25.2/guide/06-loan.md +++ b/docs/versioned_docs/version-v0.25.2/guide/06-loan.md @@ -100,7 +100,7 @@ Use the `--dep` flag to specify that this module depends on and is going to inte ## Scaffold a list -Use the [scaffold list](https://docs.ignite.com/cli#ignite-scaffold-list) command to scaffold code necessary to store loans in an array-like data structure: +Use the [scaffold list](/cli#ignite-scaffold-list) command to scaffold code necessary to store loans in an array-like data structure: ```bash ignite scaffold list loan amount fee collateral deadline state borrower lender --no-message diff --git a/docs/versioned_docs/version-v0.25.2/index.md b/docs/versioned_docs/version-v0.25.2/index.md index df2c7853b0..7fbbd2cb6b 100644 --- a/docs/versioned_docs/version-v0.25.2/index.md +++ b/docs/versioned_docs/version-v0.25.2/index.md @@ -39,7 +39,7 @@ Many projects already showcase the Tendermint BFT consensus engine and the Cosmo ## Projects building with Ignite CLI * [Sifchain: omni-chain solution for DEXs](https://github.com/Sifchain/sifnode) -* [Kyve](https://www.kyve.network/) +* [Kyve](https://www.kyve.network) * [crypto.org chain](https://github.com/crypto-org-chain/chain-main) ([initialized with Ignite CLI](https://github.com/crypto-org-chain/chain-main/commit/37b2ecb49a9aae7c581270a4f2dbecfcd8e8a6e9)) * [Cronos](https://github.com/crypto-org-chain/cronos) * [Plugchain](https://github.com/oracleNetworkProtocol/plugchain) diff --git a/docs/versioned_docs/version-v0.25.2/kb/00-kb.md b/docs/versioned_docs/version-v0.25.2/kb/00-kb.md index 2950174eeb..a411d8e2d3 100644 --- a/docs/versioned_docs/version-v0.25.2/kb/00-kb.md +++ b/docs/versioned_docs/version-v0.25.2/kb/00-kb.md @@ -7,4 +7,4 @@ slug: /kb Knowledge base articles cover different aspects of Ignite CLI. This online library includes reference content on supported types, protocol buffer files, chain simulation as well as an overview of scaffolding a chain all the way to starting an IBC relayer. -If you're new to Ignite CLI or want to go through a series of tutorials, visit the [Developer Tutorials](https://docs.ignite.com/guide). +If you're new to Ignite CLI or want to go through a series of tutorials, visit the [Developer Tutorials](/guide). diff --git a/docs/versioned_docs/version-v0.25.2/kb/07-frontend.md b/docs/versioned_docs/version-v0.25.2/kb/07-frontend.md index cdc5a6921d..81eaa15870 100644 --- a/docs/versioned_docs/version-v0.25.2/kb/07-frontend.md +++ b/docs/versioned_docs/version-v0.25.2/kb/07-frontend.md @@ -23,7 +23,7 @@ client: path: "vue/src/store" ``` -A TS client is generated in the `ts-client` directory (see: [TypeScript client information](https://docs.ignite.com/clients/typescript)) and Vuex store modules making use of this client are generated in the `vue/src/store` directory. +A TS client is generated in the `ts-client` directory (see: [TypeScript client information](/clients/typescript)) and Vuex store modules making use of this client are generated in the `vue/src/store` directory. ## Client code regeneration diff --git a/ignite/cmd/cmd.go b/ignite/cmd/cmd.go index fa3345a763..3dfe95b2b8 100644 --- a/ignite/cmd/cmd.go +++ b/ignite/cmd/cmd.go @@ -265,7 +265,7 @@ func checkNewVersion(ctx context.Context) { fmt.Printf(`路 路 馃浉 Ignite CLI %s is available! 路 -路 To upgrade your Ignite CLI version, see the upgrade doc: https://docs.ignite.com/guide/install.html#upgrading-your-ignite-cli-installation +路 To upgrade your Ignite CLI version, see the upgrade doc: https://docs.ignite.com/guide/install#upgrading-your-ignite-cli-installation 路 路路 diff --git a/readme.md b/readme.md index 2e879fdb94..61a3ec8c65 100644 --- a/readme.md +++ b/readme.md @@ -10,8 +10,8 @@ Ignite CLI generates boilerplate code for you, so you can focus on writing busin ## Quick start Open Ignite CLI [in your web browser](https://gitpod.io/#https://github.com/ignite/cli/tree/master) (or -open [nightly version](https://gitpod.io/#https://github.com/ignite/cli/)), -or [install the latest release](https://docs.ignite.com/guide/install.html). +open [nightly version](https://gitpod.io/#https://github.com/ignite/cli)), +or [install the latest release](https://docs.ignite.com/guide/install). To create and start a blockchain: @@ -29,7 +29,7 @@ To learn how to use Ignite CLI, check out the [Ignite CLI docs](https://docs.ign build blockchain apps with Ignite CLI, see the [Ignite CLI Developer Tutorials](https://docs.ignite.com/guide). To install Ignite CLI locally on GNU, Linux, or macOS, -see [Install Ignite CLI](https://docs.ignite.com/guide/install.html). +see [Install Ignite CLI](https://docs.ignite.com/guide/install). To learn more about building a JavaScript frontend for your Cosmos SDK blockchain, see [ignite/web](https://github.com/ignite/web). @@ -41,7 +41,7 @@ repo is exclusively for bug reports and feature requests. ## Cosmos SDK compatibility -Blockchains created with Ignite CLI use the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/) framework. To ensure the +Blockchains created with Ignite CLI use the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) framework. To ensure the best possible experience, use the version of Ignite CLI that corresponds to the version of Cosmos SDK that your blockchain is built with. Unless noted otherwise, a row refers to a minor version and all associated patch versions. @@ -59,7 +59,7 @@ blockchain is built with. Unless noted otherwise, a row refers to a minor versio | v0.17 | v0.42 | Same with Cosmos SDK | | To upgrade your blockchain to the newer version of Cosmos SDK, see -the [Migration guide](https://docs.ignite.com/migration/). +the [Migration guide](https://docs.ignite.com/migration/v0.18). ## Plugin system @@ -76,10 +76,10 @@ plugins: // the directory must contain go code under a main package. // For repositories you can specify a suffix @branch or @tag to target a // specific git reference. -- path: github.com/org/repo/my-plugin - // Additional parameters can be passed to the plugin - with: - key: value + - path: github.com/org/repo/my-plugin + // Additional parameters can be passed to the plugin + with: + key: value ``` Once declared, the next time the ignite binary will be executed under this @@ -111,7 +111,7 @@ instance: ```yaml plugins: -- path: /home/user/src/bar + - path: /home/user/src/bar ``` Then run `ignite`, the plugin will compile and should be listed among the @@ -126,7 +126,7 @@ We welcome contributions from everyone. The `develop` branch contains the develo create a branch from `develop` and create a pull request, or maintain your own fork and submit a cross-repository pull request. -Our [Ignite CLI bounty program](docs/bounty/index.md) provides incentives for your participation and pays rewards. Track +Our [Ignite CLI bounty program](https://docs.ignite.com/bounty) provides incentives for your participation and pays rewards. Track new, in-progress, and completed bounties on the [Bounty board](https://github.com/ignite/cli/projects/5) in GitHub. **Important** Before you start implementing a new Ignite CLI feature, the first step is to create an issue on GitHub @@ -142,8 +142,8 @@ Stay in touch. * [ignite.com website](https://ignite.com) * [@ignite\_dev on Twitter](https://twitter.com/ignite_dev) -* [ignite.com/blog](https://ignite.com/blog/) +* [ignite.com/blog](https://ignite.com/blog) * [Ignite Discord](https://discord.com/invite/ignite) -* [Ignite YouTube](https://www.youtube.com/ignitehq) -* [Ignite docs](https://docs.ignite.com/) +* [Ignite YouTube](https://www.youtube.com/@ignitehq) +* [Ignite docs](https://docs.ignite.com) * [Ignite jobs](https://ignite.com/careers)