server: sync start command with cosmos-sdk v0.43-rc2 (#341)

* sync start command with cosmos-sdk 0.43

Closes #340

- add grpc web and rosetta server
- add tx/tm services
- add standalone mode
- update cosmos-sdk to 0.43.0-rc2, which fixed a bug in service startup
- add EnableUnsafeCORS option to evm rpc server

* set keyring options in root cmd and use viper prefix

* fix linter and pr suggestions

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
yihuang
2021-07-23 12:31:59 +00:00
committed by GitHub
co-authored by Federico Kunze Küllmer
parent 3f136bf5d6
commit e61594e10a
6 changed files with 309 additions and 156 deletions
+6 -4
View File
@@ -68,12 +68,14 @@ func DefaultEVMConfig() *EVMRPCConfig {
// EVMRPCConfig defines configuration for the EVM RPC server.
type EVMRPCConfig struct {
// RPCAddress defines the HTTP server to listen on
RPCAddress string `mapstructure:"address"`
// WsAddress defines the WebSocket server to listen on
WsAddress string `mapstructure:"ws-address"`
// Enable defines if the EVM RPC server should be enabled.
Enable bool `mapstructure:"enable"`
// Address defines the HTTP server to listen on
RPCAddress string `mapstructure:"address"`
// Address defines the WebSocket server to listen on
WsAddress string `mapstructure:"ws-address"`
// EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk)
EnableUnsafeCORS bool `mapstructure:"enable-unsafe-cors"`
}
// Config defines the server's top level configuration. It includes the default app config
+5 -1
View File
@@ -35,10 +35,13 @@ import (
"github.com/tharsis/ethermint/app"
ethermintclient "github.com/tharsis/ethermint/client"
ethermintconfig "github.com/tharsis/ethermint/cmd/ethermintd/config"
"github.com/tharsis/ethermint/crypto/hd"
"github.com/tharsis/ethermint/encoding"
"github.com/tharsis/ethermint/server"
)
const EnvPrefix = "ETHERMINT"
// NewRootCmd creates a new root command for simd. It is called once in the
// main function.
func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
@@ -52,7 +55,8 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
WithAccountRetriever(types.AccountRetriever{}).
WithBroadcastMode(flags.BroadcastBlock).
WithHomeDir(app.DefaultNodeHome).
WithViper("") // In simapp, we don't use any prefix for env variables.
WithKeyringOptions(hd.EthSecp256k1Option()).
WithViper(EnvPrefix)
rootCmd := &cobra.Command{
Use: "ethermintd",