func DefaultRPCConfig() *RPCConfig {
	return &RPCConfig{
		ListenAddress: "tcp://0.0.0.0:26657",
		GRPCListenAddress:      "",
		GRPCMaxOpenConnections: 900,  
		Unsafe: false,
		MaxOpenConnections: 900,
	}
}
DefaultRPCConfig returns a default configuration for the RPC server
package config
import (
	"fmt"
	"os"
	"path/filepath"
	"time"
)
const (
	FuzzModeDrop = iota
	FuzzModeDelay
)
var (
	DefaultTendermintDir = ".tendermint"
	defaultConfigDir     = "config"
	defaultDataDir       = "data"
	defaultConfigFileName  = "config.toml"
	defaultGenesisJSONName = "genesis.json"
	defaultPrivValName  = "priv_validator.json"
	defaultNodeKeyName  = "node_key.json"
	defaultAddrBookName = "addrbook.json"
	defaultConfigFilePath  = filepath.Join(defaultConfigDir, defaultConfigFileName)
	defaultGenesisJSONPath = filepath.Join(defaultConfigDir, defaultGenesisJSONName)
	defaultPrivValPath     = filepath.Join(defaultConfigDir, defaultPrivValName)
	defaultNodeKeyPath     = filepath.Join(defaultConfigDir, defaultNodeKeyName)
	defaultAddrBookPath    = filepath.Join(defaultConfigDir, defaultAddrBookName)
)
type Config struct {
	BaseConfig `mapstructure:",squash"`
	RPC             *RPCConfig             `mapstructure:"rpc"`
	P2P             *P2PConfig             `mapstructure:"p2p"`
	Mempool         *MempoolConfig         `mapstructure:"mempool"`
	Consensus       *ConsensusConfig       `mapstructure:"consensus"`
	TxIndex         *TxIndexConfig         `mapstructure:"tx_index"`
	Instrumentation *InstrumentationConfig `mapstructure:"instrumentation"`
}
func DefaultConfig() *Config {
	return &Config{
		BaseConfig:      DefaultBaseConfig(),
		RPC:             DefaultRPCConfig(),
		P2P:             DefaultP2PConfig(),
		Mempool:         DefaultMempoolConfig(),
		Consensus:       DefaultConsensusConfig(),
		TxIndex:         DefaultTxIndexConfig(),
		Instrumentation: DefaultInstrumentationConfig(),
	}
}
func TestConfig() *Config {
	return &Config{
		BaseConfig:      TestBaseConfig(),
		RPC:             TestRPCConfig(),
		P2P:             TestP2PConfig(),
		Mempool:         TestMempoolConfig(),
		Consensus:       TestConsensusConfig(),
		TxIndex:         TestTxIndexConfig(),
		Instrumentation: TestInstrumentationConfig(),
	}
}
func (cfg *Config) SetRoot(root string) *Config {
	cfg.BaseConfig.RootDir = root
	cfg.RPC.RootDir = root
	cfg.P2P.RootDir = root
	cfg.Mempool.RootDir = root
	cfg.Consensus.RootDir = root
	return cfg
}
type BaseConfig struct {
	chainID string
	RootDir string `mapstructure:"home"`
	Genesis string `mapstructure:"genesis_file"`
	PrivValidator string `mapstructure:"priv_validator_file"`
	NodeKey string `mapstructure:"node_key_file"`
	Moniker string `mapstructure:"moniker"`
	PrivValidatorListenAddr string `mapstructure:"priv_validator_laddr"`
	ProxyApp string `mapstructure:"proxy_app"`
	ABCI string `mapstructure:"abci"`
	LogLevel string `mapstructure:"log_level"`
	ProfListenAddress string `mapstructure:"prof_laddr"`
	FastSync bool `mapstructure:"fast_sync"`
	FilterPeers bool `mapstructure:"filter_peers"`  
	DBBackend string `mapstructure:"db_backend"`
	DBPath string `mapstructure:"db_dir"`
}
func DefaultBaseConfig() BaseConfig {
	return BaseConfig{
		Genesis:           defaultGenesisJSONPath,
		PrivValidator:     defaultPrivValPath,
		NodeKey:           defaultNodeKeyPath,
		Moniker:           defaultMoniker,
		ProxyApp:          "tcp://127.0.0.1:26658",
		ABCI:              "socket",
		LogLevel:          DefaultPackageLogLevels(),
		ProfListenAddress: "",
		FastSync:          true,
		FilterPeers:       false,
		DBBackend:         "leveldb",
		DBPath:            "data",
	}
}
func TestBaseConfig() BaseConfig {
	cfg := DefaultBaseConfig()
	cfg.chainID = "tendermint_test"
	cfg.ProxyApp = "kvstore"
	cfg.FastSync = false
	cfg.DBBackend = "memdb"
	return cfg
}
func (cfg BaseConfig) ChainID() string {
	return cfg.chainID
}
func (cfg BaseConfig) GenesisFile() string {
	return rootify(cfg.Genesis, cfg.RootDir)
}
func (cfg BaseConfig) PrivValidatorFile() string {
	return rootify(cfg.PrivValidator, cfg.RootDir)
}
func (cfg BaseConfig) NodeKeyFile() string {
	return rootify(cfg.NodeKey, cfg.RootDir)
}
func (cfg BaseConfig) DBDir() string {
	return rootify(cfg.DBPath, cfg.RootDir)
}
func DefaultLogLevel() string {
	return "error"
}
func DefaultPackageLogLevels() string {
	return fmt.Sprintf("main:info,state:info,*:%s", DefaultLogLevel())
}
type RPCConfig struct {
	RootDir string `mapstructure:"home"`
	ListenAddress string `mapstructure:"laddr"`
	GRPCListenAddress string `mapstructure:"grpc_laddr"`
	GRPCMaxOpenConnections int `mapstructure:"grpc_max_open_connections"`
	Unsafe bool `mapstructure:"unsafe"`
	MaxOpenConnections int `mapstructure:"max_open_connections"`
}