cosmos / gaia

Cosmos Hub
https://hub.cosmos.network
Apache License 2.0
467 stars 683 forks source link

How can I enable REST API in cmd? #804

Closed kimurayu45z closed 3 years ago

kimurayu45z commented 3 years ago

Summary

gaiad start --api.enable=true

It doesn't work. Furthermore, auto-generated config.toml doesn't include the lines like [api], enable = false. How can I enable it?

gaiad version --long
name: gaia
server_name: gaiad
version: v4.2.0
commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c
build_tags: netgo,ledger
go: go version go1.16.2 linux/amd64
build_deps:
- github.com/99designs/keyring@v1.1.6
- github.com/ChainSafe/go-schnorrkel@v0.0.0-20200405005733-88cbf1b4c40d
- github.com/Workiva/go-datastructures@v1.0.52
- github.com/armon/go-metrics@v0.3.6
- github.com/beorn7/perks@v1.0.1
- github.com/bgentry/speakeasy@v0.1.0
- github.com/btcsuite/btcd@v0.21.0-beta
- github.com/cespare/xxhash/v2@v2.1.1
- github.com/confio/ics23/go@v0.6.3
- github.com/cosmos/cosmos-sdk@v0.42.3
- github.com/cosmos/go-bip39@v1.0.0
- github.com/cosmos/iavl@v0.15.3
- github.com/cosmos/ledger-cosmos-go@v0.11.1
- github.com/cosmos/ledger-go@v0.9.2
- github.com/davecgh/go-spew@v1.1.1
- github.com/dvsekhvalnov/jose2go@v0.0.0-20200901110807-248326c1351b
- github.com/enigmampc/btcutil@v1.0.3-0.20200723161021-e2fb6adb2a25
- github.com/felixge/httpsnoop@v1.0.1
- github.com/fsnotify/fsnotify@v1.4.9
- github.com/go-kit/kit@v0.10.0
- github.com/go-logfmt/logfmt@v0.5.0
- github.com/godbus/dbus@v0.0.0-20190726142602-4481cbc300e2
- github.com/gogo/gateway@v1.1.0
- github.com/gogo/protobuf@v1.3.3 => github.com/regen-network/protobuf@v1.3.3-alpha.regen.1
- github.com/golang/protobuf@v1.4.3
- github.com/golang/snappy@v0.0.2
- github.com/google/btree@v1.0.0
- github.com/gorilla/handlers@v1.5.1
- github.com/gorilla/mux@v1.8.0
- github.com/gorilla/websocket@v1.4.2
- github.com/grpc-ecosystem/go-grpc-middleware@v1.2.2
- github.com/grpc-ecosystem/grpc-gateway@v1.16.0
- github.com/gsterjov/go-libsecret@v0.0.0-20161001094733-a6f4afe4910c
- github.com/gtank/merlin@v0.1.1
- github.com/gtank/ristretto255@v0.1.2
- github.com/hashicorp/go-immutable-radix@v1.0.0
- github.com/hashicorp/golang-lru@v0.5.4
- github.com/hashicorp/hcl@v1.0.0
- github.com/libp2p/go-buffer-pool@v0.0.2
- github.com/magiconair/properties@v1.8.4
- github.com/mattn/go-isatty@v0.0.12
- github.com/matttproud/golang_protobuf_extensions@v1.0.1
- github.com/mimoo/StrobeGo@v0.0.0-20181016162300-f8f6d4d2b643
- github.com/minio/highwayhash@v1.0.1
- github.com/mitchellh/go-homedir@v1.1.0
- github.com/mitchellh/mapstructure@v1.1.2
- github.com/mtibben/percent@v0.2.1
- github.com/pelletier/go-toml@v1.8.0
- github.com/pkg/errors@v0.9.1
- github.com/pmezard/go-difflib@v1.0.0
- github.com/prometheus/client_golang@v1.8.0
- github.com/prometheus/client_model@v0.2.0
- github.com/prometheus/common@v0.15.0
- github.com/prometheus/procfs@v0.2.0
- github.com/rakyll/statik@v0.1.7
- github.com/rcrowley/go-metrics@v0.0.0-20200313005456-10cdbea86bc0
- github.com/regen-network/cosmos-proto@v0.3.1
- github.com/rs/cors@v1.7.0
- github.com/rs/zerolog@v1.20.0
- github.com/spf13/afero@v1.3.4
- github.com/spf13/cast@v1.3.1
- github.com/spf13/cobra@v1.1.3
- github.com/spf13/jwalterweatherman@v1.1.0
- github.com/spf13/pflag@v1.0.5
- github.com/spf13/viper@v1.7.1
- github.com/stretchr/testify@v1.7.0
- github.com/subosito/gotenv@v1.2.0
- github.com/syndtr/goleveldb@v1.0.1-0.20200815110645-5c35d600f0ca
- github.com/tendermint/btcd@v0.1.1
- github.com/tendermint/crypto@v0.0.0-20191022145703-50d29ede1e15
- github.com/tendermint/go-amino@v0.16.0
- github.com/tendermint/tendermint@v0.34.8
- github.com/tendermint/tm-db@v0.6.4
- github.com/zondax/hid@v0.9.0
- golang.org/x/crypto@v0.0.0-20201221181555-eec23a3978ad
- golang.org/x/net@v0.0.0-20201021035429-f5854403a974
- golang.org/x/sys@v0.0.0-20201015000850-e3ed0017c211
- golang.org/x/term@v0.0.0-20201117132131-f5c789dd3221
- golang.org/x/text@v0.3.3
- google.golang.org/genproto@v0.0.0-20210114201628-6edceaf6022f
- google.golang.org/grpc@v1.35.0 => google.golang.org/grpc@v1.33.2
- google.golang.org/protobuf@v1.25.0
- gopkg.in/ini.v1@v1.51.0
- gopkg.in/yaml.v2@v2.4.0
- gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c

Problem Definition

Proposal


For Admin Use

cmwaters commented 3 years ago

Hey @KimuraYu45z, --api.enable isn't a registered flag at the moment. Perhaps it's something that might be added in the future. I know that simd has a config command you can use to change some configuration parameters. Maybe this will get ported across.

I would enable the api by just running vim .gaia/config/app.toml (or wherever you keep your app.toml file and manually changing [api] enable to true

kimurayu45z commented 3 years ago

Thanks!