Skip to content

Commit c86ecee

Browse files
committed
"feat: 更新应用配置和初始化脚本,优化查询功能 (cosmos#1534)"
1 parent 34fe852 commit c86ecee

30 files changed

+5992
-170
lines changed

tutorials/base/app/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ modules:
1717
- name: auth
1818
config:
1919
"@type": cosmos.auth.module.v1.Module
20-
bech32_prefix: tutorial
20+
bech32_prefix: example
2121
module_account_permissions:
2222
- account: fee_collector
2323
- account: distribution

tutorials/base/cmd/exampled/cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func ProvideClientContext(
135135
WithInput(os.Stdin).
136136
WithAccountRetriever(types.AccountRetriever{}).
137137
WithHomeDir(app.DefaultNodeHome).
138-
WithViper("TUTORIAL") // env variable prefix
138+
WithViper("example") // env variable prefix
139139

140140
// Read the config again to overwrite the default values with the values from the config file
141141
clientCtx, _ = config.ReadFromClientConfig(clientCtx)

tutorials/base/go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,16 @@ require (
141141
github.com/zondax/ledger-go v0.14.3 // indirect
142142
go.etcd.io/bbolt v1.3.8 // indirect
143143
golang.org/x/crypto v0.21.0 // indirect
144-
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
144+
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
145145
golang.org/x/net v0.23.0 // indirect
146-
golang.org/x/sync v0.5.0 // indirect
146+
golang.org/x/sync v0.6.0 // indirect
147147
golang.org/x/sys v0.18.0 // indirect
148148
golang.org/x/term v0.18.0 // indirect
149149
golang.org/x/text v0.14.0 // indirect
150150
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
151151
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect
152152
google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect
153153
google.golang.org/grpc v1.62.0 // indirect
154-
155154
google.golang.org/protobuf v1.33.0 // indirect
156155
gopkg.in/ini.v1 v1.67.0 // indirect
157156
gopkg.in/yaml.v3 v3.0.1 // indirect

tutorials/nameservice/base/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ all: lint test install
8787
### Build ###
8888
###############################################################################
8989

90-
install: enforce-go-version
90+
install:
9191
@echo "Installing exampled..."
9292
go install -mod=readonly $(BUILD_FLAGS) ./cmd/exampled
9393

94-
build: enforce-go-version
94+
build:
9595
@echo "Building exampled..."
9696
go build $(BUILD_FLAGS) -o $(BUILDDIR)/ ./cmd/exampled
9797

tutorials/nameservice/base/app/app.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ import (
8282

8383
const (
8484
Bech32Prefix = "cosmos"
85-
AppName = "tutorial"
86-
DefaultDenom = "uatom"
85+
AppName = "example"
8786
Bech32PrefixAccAddr = Bech32Prefix
8887
Bech32PrefixAccPub = Bech32Prefix + "pub"
8988
Bech32PrefixValAddr = Bech32Prefix + "valoper"
@@ -354,7 +353,6 @@ func NewExampleApp(
354353
runtime.NewKVStoreService(keys[auction.StoreKey]),
355354
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
356355
app.BankKeeper,
357-
DefaultDenom,
358356
)
359357

360358
app.mm = module.NewManager(

tutorials/nameservice/base/app/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ modules:
1717
- name: auth
1818
config:
1919
"@type": cosmos.auth.module.v1.Module
20-
bech32_prefix: tutorial
20+
bech32_prefix: cosmos
2121
module_account_permissions:
2222
- account: fee_collector
2323
- account: distribution

tutorials/nameservice/base/cmd/exampled/cmd/commands.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ func initAppConfig() (string, interface{}) {
4949
srvCfg.StateSync.SnapshotInterval = 1000
5050
srvCfg.StateSync.SnapshotKeepRecent = 10
5151

52+
srvCfg.BaseConfig.MinGasPrices = "0.0001uatom"
53+
5254
customAppConfig := CustomAppConfig{
5355
Config: *srvCfg,
5456
}
@@ -114,6 +116,7 @@ func queryCommand() *cobra.Command {
114116
authcmd.QueryTxCmd(),
115117
server.QueryBlockResultsCmd(),
116118
auctionmod.QueryWhoisCmd(),
119+
auctionmod.QueryWhoisListCmd(),
117120
)
118121

119122
return cmd
@@ -158,7 +161,7 @@ func newApp(
158161
}
159162

160163
valKey, ok := appOpts.Get(auction.FlagValKey).(string)
161-
if !ok {
164+
if ok {
162165
valKey = "val"
163166
}
164167

tutorials/nameservice/base/cmd/exampled/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88

99
"github.com/cosmos/sdk-tutorials/tutorials/nameservice/base/app"
1010
"github.com/cosmos/sdk-tutorials/tutorials/nameservice/base/cmd/exampled/cmd"
11+
12+
_ "github.com/cosmos/sdk-tutorials/tutorials/nameservice/base/app/params"
1113
)
1214

1315
func main() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNS0wNS0xNiAxMTo0MzoxOS42Nzc3MDQgKzA4MDAgQ1NUIG09KzAuMDM3NjAwOTYwIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiUUFuaFhqNjdNVERCd1JmUCJ9.WYRRuu22W4cqPUVqD46Bzr2chS9-emP9BZRbbP9MjRnxn_barvOHvQ.dXAQ-vvj3Y-T6gtu.lissYt_M5VH5_MCYS0FoyZRUNK4wb9LEZqHk3S2B0dxOpwiQL-ReCY74LKA27TfWTq989RTIOMcle3yPtVXkL7edQkNcb3QXB2rNvIoKpp8ZBRQoKXiy3eVXq_JD-w3zZUBzKNDZ-yc30bzntdsdhKxX_qn3jICWnUa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