From 2901feb425fa7914319cd335cbfc6d82d7d1b80a Mon Sep 17 00:00:00 2001 From: Vritra4 Date: Mon, 29 Apr 2024 18:44:42 +0900 Subject: [PATCH] update some configs to let them enabled by default --- cmd/minitiad/config.go | 8 ++++++++ cmd/minitiad/init.go | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/cmd/minitiad/config.go b/cmd/minitiad/config.go index 1f11830..f6e0fdd 100644 --- a/cmd/minitiad/config.go +++ b/cmd/minitiad/config.go @@ -39,6 +39,14 @@ func initAppConfig() (string, interface{}) { // In simapp, we set the min gas prices to 0. srvCfg.MinGasPrices = fmt.Sprintf("0%s", types.BaseDenom) + // Enable API and unsafe CORS (CORS allowed from any host) + srvCfg.API.Enable = true + srvCfg.API.EnableUnsafeCORS = true + srvCfg.API.Address = "tcp://0.0.0.0:1317" + + srvCfg.GRPC.Enable = true + srvCfg.GRPC.Address = "tcp://0.0.0.0:9090" + minitiaAppConfig := minitiaAppConfig{ Config: *srvCfg, EVMConfig: evmconfig.DefaultEVMConfig(), diff --git a/cmd/minitiad/init.go b/cmd/minitiad/init.go index 14f559b..6fd99b3 100644 --- a/cmd/minitiad/init.go +++ b/cmd/minitiad/init.go @@ -86,6 +86,10 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { config := serverCtx.Config config.SetRoot(clientCtx.HomeDir) + // Configure the server to open RPC port to everyone and allow every origins + config.RPC.ListenAddress = "tcp://0.0.0.0:26657" + config.RPC.CORSAllowedOrigins = []string{"*"} + chainID, _ := cmd.Flags().GetString(flags.FlagChainID) if chainID == "" { chainID = fmt.Sprintf("test-chain-%v", cometrand.Str(6))