node

package
v1.14.12 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: GPL-3.0, LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2016 The go-ethereum Authors This file is part of the go-ethereum library.

The go-ethereum library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The go-ethereum library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	BatchRequestLimit:    1000,
	BatchResponseMaxSize: 25 * 1000 * 1000,
}

DefaultConfig contains reasonable default settings.

View Source
var (
	ErrNodeStopped = errors.New("node not started")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// KeyStoreDir is the file system folder that contains private keys. The directory can
	// be specified as a relative path, in which case it is resolved relative to the
	// current directory.
	//
	// If KeyStoreDir is empty, the default location is the "keystore" subdirectory of
	// DataDir. If DataDir is unspecified and KeyStoreDir is empty, an ephemeral directory
	// is created by New and destroyed when the node is stopped.
	KeyStoreDir string `toml:",omitempty"`

	// ExternalSigner specifies an external URI for a clef-type signer.
	ExternalSigner string `toml:",omitempty"`

	// UseLightweightKDF lowers the memory and CPU requirements of the key store
	// scrypt KDF at the expense of security.
	UseLightweightKDF bool `toml:",omitempty"`

	// InsecureUnlockAllowed allows user to unlock accounts in unsafe http environment.
	InsecureUnlockAllowed bool `toml:",omitempty"`

	// BatchRequestLimit is the maximum number of requests in a batch.
	BatchRequestLimit int `toml:",omitempty"`

	// BatchResponseMaxSize is the maximum number of bytes returned from a batched rpc call.
	BatchResponseMaxSize int `toml:",omitempty"`

	CorethVersion string
}

Config represents a small collection of configuration values to fine tune the P2P network layer of a protocol stack. These values can be further extended by all registered services.

func (*Config) ExtRPCEnabled

func (c *Config) ExtRPCEnabled() bool

ExtRPCEnabled returns the indicator whether node enables the external RPC(http, ws or graphql).

func (*Config) GetKeyStoreDir

func (c *Config) GetKeyStoreDir() (string, bool, error)

GetKeyStoreDir retrieves the key directory and will create and ephemeral one if necessary.

func (*Config) KeyDirConfig

func (c *Config) KeyDirConfig() (string, error)

KeyDirConfig determines the settings for keydirectory

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node is a container on which services can be registered.

func New

func New(conf *Config) (*Node, error)

New creates a new P2P node, ready for protocol registration.

func (*Node) APIs

func (n *Node) APIs() []rpc.API

RegisterAPIs registers the APIs a service provides on the node.

func (*Node) AccountManager

func (n *Node) AccountManager() *accounts.Manager

AccountManager retrieves the account manager used by the protocol stack.

func (*Node) Config

func (n *Node) Config() *Config

Config returns the configuration of node.

Jump to

Keyboard shortcuts

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