server

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGRPCPort int = 9632
View Source
const DefaultGraphQLPort int = 9898
View Source
const DefaultJSONRPCPort int = 8545

Variables

This section is empty.

Functions

func ConsensusSupported

func ConsensusSupported(value string) bool

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
	MaxAccountDemotions uint64

	Telemetry *Telemetry
	Network   *network.Config

	DataDir     string
	RestoreFile *string

	Seal           bool
	SecretsManager *secrets.SecretsManagerConfig

	LogLevel    hclog.Level
	LogFilePath string

	Daemon       bool
	ValidatorKey string
}

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
}

type JSONRPC

type JSONRPC struct {
	JSONRPCAddr              *net.TCPAddr
	AccessControlAllowOrigin []string
}

JSONRPC holds the config details for the JSON-RPC server

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 Minimal server (blockchain, networking, consensus)

func (*Server) JoinPeer

func (s *Server) JoinPeer(rawPeerMultiaddr string) error

JoinPeer attempts to add a new peer to the networking server

type Telemetry

type Telemetry struct {
	PrometheusAddr *net.TCPAddr
}

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