config

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCConfig

type RPCConfig struct {
	RootDir string `toml:"home"`

	// TCP or UNIX socket address for the RPC server to listen on
	ListenAddress string `toml:"laddr" comment:"TCP or UNIX socket address for the RPC server to listen on"`

	// A list of origins a cross-domain request can be executed from.
	// If the special '*' value is present in the list, all origins will be allowed.
	// An origin may contain a wildcard (*) to replace 0 or more characters (i.e.: http://*.domain.com).
	// Only one wildcard can be used per origin.
	CORSAllowedOrigins []string `` /* 178-byte string literal not displayed */

	// A list of methods the client is allowed to use with cross-domain requests.
	CORSAllowedMethods []string `toml:"cors_allowed_methods" comment:"A list of methods the client is allowed to use with cross-domain requests"`

	// A list of non simple headers the client is allowed to use with cross-domain requests.
	CORSAllowedHeaders []string `toml:"cors_allowed_headers" comment:"A list of non simple headers the client is allowed to use with cross-domain requests"`

	// TCP or UNIX socket address for the gRPC server to listen on
	// NOTE: This server only supports /broadcast_tx_commit
	GRPCListenAddress string `` /* 142-byte string literal not displayed */

	// Maximum number of simultaneous connections.
	// Does not include RPC (HTTP&WebSocket) connections. See max_open_connections
	// If you want to accept a larger number than the default, make sure
	// you increase your OS limits.
	// 0 - unlimited.
	GRPCMaxOpenConnections int `` /* 427-byte string literal not displayed */

	// Activate unsafe RPC commands like /dial_persistent_peers and /unsafe_flush_mempool
	Unsafe bool `toml:"unsafe" comment:"Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool"`

	// Maximum number of simultaneous connections (including WebSocket).
	// Does not include gRPC connections. See grpc_max_open_connections
	// If you want to accept a larger number than the default, make sure
	// you increase your OS limits.
	// 0 - unlimited.
	// Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
	// 1024 - 40 - 10 - 50 = 924 = ~900
	MaxOpenConnections int `` /* 433-byte string literal not displayed */

	// How long to wait for a tx to be committed during /broadcast_tx_commit
	// WARNING: Using a value larger than 10s will result in increasing the
	// global HTTP write timeout, which applies to all connections and endpoints.
	// See https://github.com/gnolang/gno/tm2/pkg/bft/issues/3435
	TimeoutBroadcastTxCommit time.Duration `` /* 319-byte string literal not displayed */

	// Maximum size of request body, in bytes
	MaxBodyBytes int64 `toml:"max_body_bytes" comment:"Maximum size of request body, in bytes"`

	// Maximum size of request header, in bytes
	MaxHeaderBytes int `toml:"max_header_bytes" comment:"Maximum size of request header, in bytes"`

	// The path to a file containing certificate that is used to create the HTTPS server.
	// Might be either absolute path or path related to tendermint's config directory.
	//
	// If the certificate is signed by a certificate authority,
	// the certFile should be the concatenation of the server's certificate, any intermediates,
	// and the CA's certificate.
	//
	// NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. Otherwise, HTTP server is run.
	TLSCertFile string `` /* 503-byte string literal not displayed */

	// The path to a file containing matching private key that is used to create the HTTPS server.
	// Might be either absolute path or path related to tendermint's config directory.
	//
	// NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. Otherwise, HTTP server is run.
	TLSKeyFile string `` /* 333-byte string literal not displayed */
}

RPCConfig defines the configuration options for the Tendermint RPC server

func DefaultRPCConfig

func DefaultRPCConfig() *RPCConfig

DefaultRPCConfig returns a default configuration for the RPC server

func TestRPCConfig

func TestRPCConfig() *RPCConfig

TestRPCConfig returns a configuration for testing the RPC server

func (RPCConfig) CertFile

func (cfg RPCConfig) CertFile() string

func (*RPCConfig) IsCorsEnabled

func (cfg *RPCConfig) IsCorsEnabled() bool

IsCorsEnabled returns true if cross-origin resource sharing is enabled. XXX review.

func (RPCConfig) IsTLSEnabled

func (cfg RPCConfig) IsTLSEnabled() bool

func (RPCConfig) KeyFile

func (cfg RPCConfig) KeyFile() string

func (*RPCConfig) ValidateBasic

func (cfg *RPCConfig) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

Jump to

Keyboard shortcuts

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