server

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGRPCPort int = 9632
View Source
const DefaultGraphQLPort int = 9898
View Source
const DefaultJSONRPCPort int = 8545
View Source
const DefaultJaegerPort int = 14268
View Source
const DefaultPprofPort int = 6060

Variables

This section is empty.

Functions

func ConsensusSupported

func ConsensusSupported(value string) bool

func GetConsensusBackend added in v1.2.2

func GetConsensusBackend(value string) (consensus.Factory, bool)

func GetSecretsManager added in v1.2.2

func GetSecretsManager(secretType secrets.SecretsManagerType) (secrets.SecretsManagerFactory, bool)

func NewJSONRPCStore added in v1.2.2

func NewJSONRPCStore(
	state state.State,
	blockchain *blockchain.Blockchain,
	restoreProgression *progress.ProgressionWrapper,
	txpool *txpool.TxPool,
	executor *state.Executor,
	consensus consensus.Consensus,
	network network.Server,
	metrics *JSONRPCStoreMetrics,
	gpo *gasprice.Oracle,
) jsonrpc.JSONRPCStore

func SetupDataDir

func SetupDataDir(dataDir string, paths []string) error

SetupDataDir sets up the dogechain data directory and sub-folders

Types

type Config

type Config struct {
	Chain *chain.Chain

	JSONRPC       *JSONRPC
	EnableGraphQL bool
	GraphQL       *GraphQL
	GRPCAddr      *net.TCPAddr
	LibP2PAddr    *net.TCPAddr

	PriceLimit            uint64
	MaxSlots              uint64
	BlockTime             uint64
	PruneTickSeconds      uint64
	PromoteOutdateSeconds uint64

	Telemetry *Telemetry
	Network   *network.Config

	DataDir     string
	RestoreFile *string

	LeveldbOptions *LeveldbOptions

	Seal           bool
	SecretsManager *secrets.SecretsManagerConfig

	LogLevel    hclog.Level
	LogFilePath string

	Daemon       bool
	ValidatorKey string

	BlockBroadcast bool

	GasPriceOracle gasprice.Config
}

Config is used to parametrize the minimal client

type ConsensusType

type ConsensusType string
const (
	DevConsensus   ConsensusType = "dev"
	IBFTConsensus  ConsensusType = "ibft"
	DummyConsensus ConsensusType = "dummy"
)

type Entry

type Entry struct {
	Enabled bool
	Config  map[string]interface{}
}

Entry is a backend configuration entry

type GraphQL added in v0.5.3

type GraphQL struct {
	GraphQLAddr              *net.TCPAddr
	AccessControlAllowOrigin []string
	BlockRangeLimit          uint64
	EnablePprof              bool
}

type JSONRPC

type JSONRPC struct {
	JSONRPCAddr              *net.TCPAddr
	AccessControlAllowOrigin []string
	BatchLengthLimit         uint64
	BlockRangeLimit          uint64
	JSONNamespace            []string
	EnableWS                 bool
	EnablePprof              bool
}

JSONRPC holds the config details for the JSON-RPC server

type JSONRPCStoreMetrics added in v1.2.2

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

func JSONRPCStoreNilMetrics added in v1.2.2

func JSONRPCStoreNilMetrics() *JSONRPCStoreMetrics

JSONRPCStoreNilMetrics will return the non operational jsonrpc metrics

func NewJSONRPCStoreMetrics added in v1.2.2

func NewJSONRPCStoreMetrics(namespace string, labelsWithValues ...string) *JSONRPCStoreMetrics

NewJSONRPCStoreMetrics return the JSONRPCStore metrics instance

func (*JSONRPCStoreMetrics) AddTxInc added in v1.2.2

func (m *JSONRPCStoreMetrics) AddTxInc()

AddTx api calls

func (*JSONRPCStoreMetrics) ApplyTxnInc added in v1.2.2

func (m *JSONRPCStoreMetrics) ApplyTxnInc()

ApplyTxn api calls

func (*JSONRPCStoreMetrics) GetAccountInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetAccountInc()

GetAccount api calls

func (*JSONRPCStoreMetrics) GetAvgGasPriceInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetAvgGasPriceInc()

GetAvgGasPrice api calls

func (*JSONRPCStoreMetrics) GetBlockByHashInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetBlockByHashInc()

GetBlockByHash api calls

func (*JSONRPCStoreMetrics) GetBlockByNumberInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetBlockByNumberInc()

GetBlockByNumber api calls

func (*JSONRPCStoreMetrics) GetCapacityInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetCapacityInc()

GetCapacity api calls

func (*JSONRPCStoreMetrics) GetCodeInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetCodeInc()

GetCode api calls

func (*JSONRPCStoreMetrics) GetForksInTimeInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetForksInTimeInc()

GetForksInTime api calls

func (*JSONRPCStoreMetrics) GetHeaderByHashInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetHeaderByHashInc()

GetHeaderByHash api calls

func (*JSONRPCStoreMetrics) GetHeaderByNumberInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetHeaderByNumberInc()

GetHeaderByNumber api calls

func (*JSONRPCStoreMetrics) GetNonceInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetNonceInc()

GetNonce api calls

func (*JSONRPCStoreMetrics) GetPendingTxInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetPendingTxInc()

GetPendingTx api calls

func (*JSONRPCStoreMetrics) GetReceiptsByHashInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetReceiptsByHashInc()

GetReceiptsByHash api calls

func (*JSONRPCStoreMetrics) GetStorageInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetStorageInc()

GetGetStorage api calls

func (*JSONRPCStoreMetrics) GetSyncProgressionInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetSyncProgressionInc()

GetSyncProgression api calls

func (*JSONRPCStoreMetrics) GetTxsInc added in v1.2.2

func (m *JSONRPCStoreMetrics) GetTxsInc()

GetTxs api calls

func (*JSONRPCStoreMetrics) HeaderInc added in v1.2.2

func (m *JSONRPCStoreMetrics) HeaderInc()

Header api calls

func (*JSONRPCStoreMetrics) PeerCountInc added in v1.2.2

func (m *JSONRPCStoreMetrics) PeerCountInc()

PeerCount api calls

func (*JSONRPCStoreMetrics) ReadTxLookupInc added in v1.2.2

func (m *JSONRPCStoreMetrics) ReadTxLookupInc()

ReadTxLookup api calls

func (*JSONRPCStoreMetrics) StateAtTransactionInc added in v1.2.2

func (m *JSONRPCStoreMetrics) StateAtTransactionInc()

StateAtTransaction api calls

func (*JSONRPCStoreMetrics) SubscribeEventsInc added in v1.2.2

func (m *JSONRPCStoreMetrics) SubscribeEventsInc()

SubscribeEvents api calls

type LeveldbOptions added in v1.1.3

type LeveldbOptions struct {
	CacheSize           int
	Handles             int
	BloomKeyBits        int
	CompactionTableSize int
	CompactionTotalSize int
	NoSync              bool
}

LeveldbOptions holds the leveldb options

type Server

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

Minimal is the central manager of the blockchain client

func NewServer

func NewServer(config *Config) (*Server, error)

NewServer creates a new Minimal server, using the passed in configuration

func (*Server) Chain

func (s *Server) Chain() *chain.Chain

Chain returns the chain object of the client

func (*Server) Close

func (s *Server) Close()

Close closes the server sequence:

consensus:
	wait for consensus exit any IbftState,
	stop write any block to blockchain storage and
	stop write any state to state storage

txpool: stop accepting new transactions
networking: stop transport
stateStorage: safe close state storage
blockchain: safe close state storage

func (*Server) JoinPeer

func (s *Server) JoinPeer(rawPeerMultiaddr string, static bool) error

JoinPeer attempts to add a new peer to the networking server

type Telemetry

type Telemetry struct {
	PrometheusAddr  *net.TCPAddr
	EnableIOMetrics bool
	EnableJaeger    bool
	JaegerURL       string
}

Telemetry holds the config details for metric services

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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