Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultDataDir() string
- func NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string) http.Handler
- func RegisterApisFromWhitelist(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error
- func ReplaceHomeVariable(path string) string
- type Config
- type NetConfig
- type Node
- type ProducerConfig
- type RPCConfig
Constants ¶
View Source
const (
DefaultWalletDir = "wallet"
)
Variables ¶
View Source
var ( ErrDataDirUsed = errors.New("dataDir already used by another process") ErrNodeStopped = errors.New("node not started") )
View Source
var DefaultNodeConfig = Config{ DataPath: DefaultDataDir(), Name: p2p.DefaultNodeName, LogLevel: "info", RPC: RPCConfig{ HTTPPort: p2p.DefaultHTTPPort, HTTPHost: "0.0.0.0", EnableHTTP: true, WSPort: p2p.DefaultWSPort, WSHost: "0.0.0.0", EnableWS: true, HTTPCors: []string{"*"}, WSOrigins: []string{"*"}, }, Net: NetConfig{ ListenHost: p2p.DefaultListenHost, ListenPort: p2p.DefaultListenPort, MinPeers: p2p.DefaultMinPeers, MinConnectedPeers: p2p.DefaultMinConnectedPeers, MaxPeers: p2p.DefaultMaxPeers, MaxPendingPeers: p2p.DefaultMaxPendingPeers, Seeders: p2p.DefaultSeeders, }, }
Functions ¶
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir is the default data directory to use for the databases and other persistence requirements.
func NewHTTPHandlerStack ¶
NewHTTPHandlerStack returns wrapped http-related handlers
func RegisterApisFromWhitelist ¶
func RegisterApisFromWhitelist(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error
RegisterApisFromWhitelist checks the given modules' availability, generates a whitelist based on the allowed modules, and then registers all of the APIs exposed by the services.
func ReplaceHomeVariable ¶
Types ¶
type Config ¶
type Config struct { DataPath string // default ~/.zenon WalletPath string // default DataPath/wallet GenesisFile string // GenesisFile is the absolute path to the genesis file Name string LogLevel string // "debug", "dbug" | "info" | "warn" | "error", "error" | "crit" Producer *ProducerConfig RPC RPCConfig Net NetConfig }
func (*Config) HTTPEndpoint ¶
func (*Config) MakePathsAbsolute ¶
func (*Config) WSEndpoint ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is chain container that manages p2p、rpc、zenon modules
func (*Node) WalletManager ¶
type ProducerConfig ¶
Click to show internal directories.
Click to hide internal directories.