config

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultGRPCAddress is the default address the gRPC server binds to.
	DefaultGRPCAddress = "0.0.0.0:9900"

	// DefaultEVMAddress is the default address the EVM JSON-RPC server binds to.
	DefaultEVMAddress = "0.0.0.0:8545"

	// DefaultEVMWSAddress is the default address the EVM WebSocket server binds to.
	DefaultEVMWSAddress = "0.0.0.0:8546"
)
View Source
const DefaultConfigTemplate = `` /* 541-byte string literal not displayed */

DefaultConfigTemplate defines the configuration template for the EVM RPC configuration

Variables

This section is empty.

Functions

func AppConfig

func AppConfig() (string, interface{})

AppConfig helps to override default appConfig template and configs. return "", nil if no custom configuration is required for the application.

Types

type Config

type Config struct {
	config.Config

	EVMRPC EVMRPCConfig `mapstructure:"evm-rpc"`
}

Config defines the server's top level configuration. It includes the default app config from the SDK as well as the EVM configuration to enable the JSON-RPC APIs.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns server's default configuration.

func GetConfig

func GetConfig(v *viper.Viper) Config

GetConfig returns a fully parsed Config object.

type EVMRPCConfig

type EVMRPCConfig struct {
	// 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"`
}

EVMRPCConfig defines configuration for the EVM RPC server.

func DefaultEVMConfig

func DefaultEVMConfig() *EVMRPCConfig

DefaultEVMConfig returns an EVM config with the JSON-RPC API enabled by default

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL