Skip to content

Commit ca040da

Browse files
committed
Integrate wasmcli into wasmd
1 parent 93761ea commit ca040da

16 files changed

+118
-237
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ docs/node_modules
2222
# Data - ideally these don't exist
2323
baseapp/data/*
2424
client/lcd/keys/*
25-
cmd/wasmcli/statik/statik.go
2625
mytestnet
2726

2827
# Testing

Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,9 @@ RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build-gaiaflex
3939
FROM alpine:3.12
4040

4141
COPY --from=go-builder /code/build/wasmd /usr/bin/wasmd
42-
COPY --from=go-builder /code/build/wasmcli /usr/bin/wasmcli
4342

4443
# testnet
45-
COPY --from=go-builder /code/build/coral /usr/bin/coral
4644
COPY --from=go-builder /code/build/corald /usr/bin/corald
47-
COPY --from=go-builder /code/build/gaiaflex /usr/bin/gaiaflex
4845
COPY --from=go-builder /code/build/gaiaflexd /usr/bin/gaiaflexd
4946

5047
COPY docker/* /opt/

Makefile

+3-15
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags))
5454

5555
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=wasm \
5656
-X github.com/cosmos/cosmos-sdk/version.AppName=wasmd \
57-
-X github.com/CosmWasm/wasmd/cmd/wasmcli/version.ClientName=wasmcli \
5857
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
5958
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
6059
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
@@ -67,10 +66,8 @@ ldflags := $(strip $(ldflags))
6766

6867
coral_ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=coral \
6968
-X github.com/cosmos/cosmos-sdk/version.AppName=corald \
70-
-X github.com/CosmWasm/wasmd/cmd/wasmcli/version.ClientName=coral \
7169
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
7270
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
73-
-X github.com/CosmWasm/wasmd/app.CLIDir=.coral \
7471
-X github.com/CosmWasm/wasmd/app.NodeDir=.corald \
7572
-X github.com/CosmWasm/wasmd/app.Bech32Prefix=coral \
7673
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
@@ -82,11 +79,9 @@ coral_ldflags := $(strip $(coral_ldflags))
8279

8380
flex_ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=gaiaflex \
8481
-X github.com/cosmos/cosmos-sdk/version.AppName=gaiaflexd \
85-
-X github.com/CosmWasm/wasmd/cmd/wasmcli/version.ClientName=gaiaflex \
8682
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
8783
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
8884
-X github.com/CosmWasm/wasmd/app.ProposalsEnabled=true \
89-
-X github.com/CosmWasm/wasmd/app.CLIDir=.gaiaflex \
9085
-X github.com/CosmWasm/wasmd/app.NodeDir=.gaiaflexd \
9186
-X github.com/CosmWasm/wasmd/app.Bech32Prefix=cosmos \
9287
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
@@ -102,29 +97,23 @@ all: install lint test
10297

10398
build: go.sum
10499
ifeq ($(OS),Windows_NT)
105-
# wasmd nodes not supported on windows, maybe the cli?
106-
go build -mod=readonly $(BUILD_FLAGS) -o build/wasmcli.exe ./cmd/wasmcli
100+
exit 1
107101
else
108102
go build -mod=readonly $(BUILD_FLAGS) -o build/wasmd ./cmd/wasmd
109-
go build -mod=readonly $(BUILD_FLAGS) -o build/wasmcli ./cmd/wasmcli
110103
endif
111104

112105
build-coral: go.sum
113106
ifeq ($(OS),Windows_NT)
114-
# wasmd nodes not supported on windows, maybe the cli?
115-
go build -mod=readonly $(CORAL_BUILD_FLAGS) -o build/coral.exe ./cmd/wasmcli
107+
exit 1
116108
else
117109
go build -mod=readonly $(CORAL_BUILD_FLAGS) -o build/corald ./cmd/wasmd
118-
go build -mod=readonly $(CORAL_BUILD_FLAGS) -o build/coral ./cmd/wasmcli
119110
endif
120111

121112
build-gaiaflex: go.sum
122113
ifeq ($(OS),Windows_NT)
123-
# wasmd nodes not supported on windows, maybe the cli?
124-
go build -mod=readonly $(FLEX_BUILD_FLAGS) -o build/gaiaflex.exe ./cmd/wasmcli
114+
exit 1
125115
else
126116
go build -mod=readonly $(FLEX_BUILD_FLAGS) -o build/gaiaflexd ./cmd/wasmd
127-
go build -mod=readonly $(FLEX_BUILD_FLAGS) -o build/gaiaflex ./cmd/wasmcli
128117
endif
129118

130119
build-linux: go.sum
@@ -139,7 +128,6 @@ endif
139128

140129
install: go.sum
141130
go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmd
142-
go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmcli
143131

144132
########################################
145133
### Tools & dependencies

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ docker run --rm -it \
9797
--mount type=volume,source=wasmd_data,target=/root \
9898
cosmwasm/wasmd:latest ./setup_wasmd.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6
9999

100-
# This will start both wasmd and wasmcli rest-server, only wasmcli output is shown on the screen
100+
# This will start both wasmd and rest-server, only rest-serve output is shown on the screen
101101
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
102102
--mount type=volume,source=wasmd_data,target=/root \
103103
cosmwasm/wasmd:latest ./run_all.sh
@@ -126,7 +126,7 @@ sudo chown -R $(id -u):$(id -g) ./template
126126
# bind to non-/root and pass an argument to run.sh to copy the template into /root
127127
# we need wasmd_data volume mount not just for restart, but also to view logs
128128
docker volume rm -f wasmd_data
129-
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
129+
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 9090:9090 \
130130
--mount type=bind,source=$(pwd)/template,target=/template \
131131
--mount type=volume,source=wasmd_data,target=/root \
132132
cosmwasm/wasmd:latest ./run_all.sh /template
@@ -150,7 +150,7 @@ to the configuration.
150150

151151
Available flags:
152152

153-
* `-X github.com/CosmWasm/wasmd/app.CLIDir=.coral` - set the config directory for the cli (default `~/.wasmcli`)
153+
154154
* `-X github.com/CosmWasm/wasmd/app.NodeDir=.corald` - set the config/data directory for the node (default `~/.wasmd`)
155155
* `-X github.com/CosmWasm/wasmd/app.Bech32Prefix=coral` - set the bech32 prefix for all accounts (default `cosmos`)
156156
* `-X github.com/CosmWasm/wasmd/app.ProposalsEnabled=true` - enable all x/wasm governance proposals (default `false`)

api_migration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ A list of ContractCodeHistoryEntries with following fields:
1717
* 404 - for an unknown contract
1818

1919
### CLI
20-
`wasmcli query wasm contract-history [bech32_address] to print all the code changes.`
20+
`wasmd query wasm contract-history [bech32_address] to print all the code changes.`
2121
Example:
22-
`wasmcli query wasm contract-history cosmos18r5szma8hm93pvx6lwpjwyxruw27e0k5uw835c`
22+
`wasmd query wasm contract-history cosmos18r5szma8hm93pvx6lwpjwyxruw27e0k5uw835c`
2323
```json
2424
[
2525
{

app/app.go

-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ const appName = "WasmApp"
9595

9696
// We pull these out so we can set them with LDFLAGS in the Makefile
9797
var (
98-
CLIDir = ".wasmcli"
9998
NodeDir = ".wasmd"
10099
Bech32Prefix = sdk.Bech32MainPrefix
101100

@@ -129,8 +128,6 @@ func GetEnabledProposals() []wasm.ProposalType {
129128
// These are the ones we will want to use in the code, based on
130129
// any overrides above
131130
var (
132-
// DefaultCLIHome default home directories for wasmcli
133-
DefaultCLIHome = os.ExpandEnv("$HOME/") + CLIDir
134131
// DefaultNodeHome default home directories for wasmd
135132
DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir
136133

cmd/wasmcli/main.go

-164
This file was deleted.

0 commit comments

Comments
 (0)