dot

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: LGPL-3.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKeystoreType = errors.New("invalid keystore type")

ErrInvalidKeystoreType when trying to create a service with the wrong keystore type

View Source
var ErrNoKeysProvided = errors.New("no keys provided for authority node")

ErrNoKeysProvided is returned when no keys are given for an authority node

View Source
var ErrWasmInterpreterName = errors.New("unknown wasm interpreter name")

Functions

func CreateJSONRawFile added in v0.2.0

func CreateJSONRawFile(bs *BuildSpec, fp string)

CreateJSONRawFile will generate a JSON genesis file with raw storage

func ImportState added in v0.3.2

func ImportState(basepath, stateFP, headerFP string, stateTrieVersion trie.TrieLayout, firstSlot uint64) error

ImportState imports the state in the given files to the database with the given path.

func InitNode

func InitNode(config *cfg.Config) error

InitNode initialise the node with the given Config

func IsNodeInitialised added in v0.7.0

func IsNodeInitialised(basepath string) (bool, error)

IsNodeInitialised returns true if, within the configured data directory for the node, the state database has been created and the genesis data can been loaded

func LoadGlobalNodeName added in v0.7.0

func LoadGlobalNodeName(basepath string) (nodename string, err error)

LoadGlobalNodeName returns the stored global node name from database

func NewTestGenesisRawFile added in v0.2.0

func NewTestGenesisRawFile(t *testing.T, config *cfg.Config) (filename string)

NewTestGenesisRawFile returns a test genesis file using "westend-dev" raw data

func RandomNodeName added in v0.7.0

func RandomNodeName() string

RandomNodeName generates a new random name if there is no name configured for the node

func WriteGenesisSpecFile added in v0.7.0

func WriteGenesisSpecFile(data []byte, fp string) error

WriteGenesisSpecFile writes the build-spec in the output filepath

Types

type AccountConfig

type AccountConfig struct {
	Key    string
	Unlock string // TODO: change to []int (#1849)
}

AccountConfig is to marshal/unmarshal account config vars

type BlockJustificationVerifier added in v0.8.0

type BlockJustificationVerifier interface {
	VerifyBlockJustification(common.Hash, []byte) error
}

BlockJustificationVerifier has a verification method for block justifications.

type BlockProducer added in v0.2.0

type BlockProducer interface {
	Pause() error
	Resume() error
	EpochLength() uint64
	SlotDuration() uint64
}

BlockProducer to produce blocks

type BuildSpec added in v0.2.0

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

BuildSpec object for working with building genesis JSON files

func BuildFromDB added in v0.2.0

func BuildFromDB(path string) (*BuildSpec, error)

BuildFromDB builds a BuildSpec from the DB located at path

func BuildFromGenesis added in v0.2.0

func BuildFromGenesis(path string, authCount int) (*BuildSpec, error)

BuildFromGenesis builds a BuildSpec based on the human-readable genesis file at path

func (*BuildSpec) ToJSON added in v0.2.0

func (b *BuildSpec) ToJSON() ([]byte, error)

ToJSON outputs genesis JSON in human-readable form

func (*BuildSpec) ToJSONRaw added in v0.2.0

func (b *BuildSpec) ToJSONRaw() ([]byte, error)

ToJSONRaw outputs genesis JSON in raw form

type Config

type Config struct {
	Global  GlobalConfig
	Log     LogConfig
	Init    InitConfig
	Account AccountConfig
	Core    CoreConfig
	Network NetworkConfig
	RPC     RPCConfig
	System  types.SystemInfo
	State   StateConfig
	Pprof   PprofConfig
}

Config is a collection of configurations throughout the system

type CoreConfig

type CoreConfig struct {
	Roles            common.NetworkRole
	BabeAuthority    bool
	GrandpaAuthority bool
	WasmInterpreter  string
	GrandpaInterval  time.Duration
}

CoreConfig is to marshal/unmarshal toml core config vars

type GlobalConfig

type GlobalConfig struct {
	Name               string
	ID                 string
	BasePath           string
	LogLvl             log.Level
	PrometheusExternal bool
	PrometheusPort     uint32
	NoTelemetry        bool
	TelemetryURLs      []genesis.TelemetryEndpoint
	RetainBlocks       uint32
	Pruning            pruner.Mode
}

GlobalConfig is used for every node command

type InitConfig

type InitConfig struct {
	Genesis string
}

InitConfig is the configuration for the node initialization

type KeyStore added in v0.8.0

type KeyStore interface {
	Name() keystore.Name
	Type() string
	Keypairs() []keystore.KeyPair
}

KeyStore is the keystore interface for the BABE service.

type LogConfig added in v0.2.0

type LogConfig struct {
	CoreLvl           log.Level
	DigestLvl         log.Level
	SyncLvl           log.Level
	NetworkLvl        log.Level
	RPCLvl            log.Level
	StateLvl          log.Level
	RuntimeLvl        log.Level
	BlockProducerLvl  log.Level
	FinalityGadgetLvl log.Level
}

LogConfig represents the log levels for individual packages

func (LogConfig) String added in v0.7.0

func (l LogConfig) String() string

type NetworkConfig

type NetworkConfig struct {
	Port              uint16
	Bootnodes         []string
	ProtocolID        string
	NoBootstrap       bool
	NoMDNS            bool
	MinPeers          int
	MaxPeers          int
	PersistentPeers   []string
	DiscoveryInterval time.Duration
	PublicIP          string
	PublicDNS         string
	NodeKey           string
	ListenAddress     string
}

NetworkConfig is to marshal/unmarshal toml network config vars

type Node

type Node struct {
	Name            string
	ServiceRegistry ServiceRegisterer // registry of all node services
	// contains filtered or unexported fields
}

Node is a container for all the components of a node.

func NewNode

func NewNode(config *cfg.Config, ks *keystore.GlobalKeystore) (*Node, error)

NewNode creates a node based on the given Config and key store.

func (*Node) Start

func (n *Node) Start() error

Start starts all dot node services

func (*Node) Stop

func (n *Node) Stop()

Stop stops all dot node services

type PprofConfig added in v0.7.0

type PprofConfig struct {
	Enabled  bool
	Settings pprof.Settings
}

PprofConfig is the configuration for the pprof HTTP server.

func (PprofConfig) String added in v0.7.0

func (p PprofConfig) String() string

type RPCConfig

type RPCConfig struct {
	Enabled          bool
	External         bool
	Unsafe           bool
	UnsafeExternal   bool
	Port             uint32
	Host             string
	Modules          []string
	WSPort           uint32
	WS               bool
	WSExternal       bool
	WSUnsafe         bool
	WSUnsafeExternal bool
}

RPCConfig is to marshal/unmarshal toml RPC config vars

func (*RPCConfig) String added in v0.7.0

func (r *RPCConfig) String() string

Strings returns the configuration in the format field1=value1 field2=value2.

type ServiceBuilder added in v0.7.0

type ServiceBuilder interface {
	NewServiceIFace(cfg *babe.ServiceConfig) (service *babe.Service, err error)
}

ServiceBuilder interface to define the building of babe service

type ServiceRegisterer added in v0.8.0

type ServiceRegisterer interface {
	RegisterService(service services.Service)
	StartAll()
	StopAll()
	Get(srvc interface{}) services.Service
}

ServiceRegisterer can register a service interface, start or stop all services, and get a particular service.

type StateConfig added in v0.3.1

type StateConfig struct {
	Rewind uint
}

StateConfig is the config for the State service

func (*StateConfig) String added in v0.7.0

func (s *StateConfig) String() string

type Telemetry added in v0.8.0

type Telemetry interface {
	SendMessage(msg json.Marshaler)
}

Telemetry is the telemetry client to send telemetry messages.

Directories

Path Synopsis
proto
Package proto contains protobuf generated Go structures.
Package proto contains protobuf generated Go structures.
rpc
modules/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package sync is a generated GoMock package.
Package sync is a generated GoMock package.

Jump to

Keyboard shortcuts

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