Documentation ¶
Index ¶
- Variables
- func CreateJSONRawFile(bs *BuildSpec, fp string) *os.File
- func ExportConfig(cfg *Config, fp string) *os.File
- func ExportTomlConfig(cfg *ctoml.Config, fp string) *os.File
- func InitNode(cfg *Config) error
- func NewTestGenesis(t *testing.T) *genesis.Genesis
- func NewTestGenesisAndRuntime(t *testing.T) string
- func NewTestGenesisFile(t *testing.T, cfg *Config) *os.File
- func NewTestGenesisRawFile(t *testing.T, cfg *Config) *os.File
- func NodeInitialized(basepath string, expected bool) bool
- func WriteConfig(data []byte, fp string) *os.File
- type AccountConfig
- type BuildSpec
- type Config
- type CoreConfig
- type GlobalConfig
- type InitConfig
- type LogConfig
- type NetworkConfig
- type Node
- type RPCConfig
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidKeystoreType = errors.New("invalid keystore type")
ErrInvalidKeystoreType when trying to create a service with the wrong keystore type
var ErrNoKeysProvided = errors.New("no keys provided for authority node")
ErrNoKeysProvided is returned when no keys are given for an authority node
Functions ¶
func CreateJSONRawFile ¶ added in v0.2.0
CreateJSONRawFile will generate an Json File
func ExportConfig ¶
ExportConfig exports a dot configuration to a toml configuration file
func ExportTomlConfig ¶ added in v0.2.0
ExportTomlConfig exports a dot configuration to a toml configuration file
func InitNode ¶
InitNode initializes a new dot node from the provided dot node configuration and JSON formatted genesis file.
func NewTestGenesis ¶
NewTestGenesis returns a test genesis instance using "gssmr" raw data
func NewTestGenesisAndRuntime ¶
NewTestGenesisAndRuntime create a new test runtime and a new test genesis file with the test runtime stored in raw data and returns the genesis file nolint
func NewTestGenesisFile ¶
NewTestGenesisFile returns a human-readable test genesis file using "gssmr" human readable data
func NewTestGenesisRawFile ¶ added in v0.2.0
NewTestGenesisRawFile returns a test genesis-raw file using "gssmr" raw data
func NodeInitialized ¶
NodeInitialized returns true if, within the configured data directory for the node, the state database has been created and the genesis data has been loaded
Types ¶
type AccountConfig ¶
type AccountConfig struct { Key string // TODO: change to array Unlock string // TODO: change to array }
AccountConfig is to marshal/unmarshal account config vars
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
BuildFromDB builds a BuildSpec from the DB located at path
func BuildFromGenesis ¶ added in v0.2.0
BuildFromGenesis builds a BuildSpec based on the human-readable genesis file at path
type Config ¶
type Config struct { Global GlobalConfig Log LogConfig Init InitConfig Account AccountConfig Core CoreConfig Network NetworkConfig RPC RPCConfig System types.SystemInfo }
Config is a collection of configurations throughout the system
func GssmrConfig ¶
func GssmrConfig() *Config
GssmrConfig returns a new test configuration using the provided basepath
func NewTestConfig ¶
NewTestConfig returns a new test configuration using the provided basepath
func NewTestConfigWithFile ¶
NewTestConfigWithFile returns a new test configuration and a temporary configuration file
func PolkadotConfig ¶ added in v0.3.0
func PolkadotConfig() *Config
PolkadotConfig returns a "polkadot" node configuration
type CoreConfig ¶
type CoreConfig struct { Roles byte BabeAuthority bool GrandpaAuthority bool BabeThresholdNumerator uint64 BabeThresholdDenominator uint64 SlotDuration uint64 EpochLength uint64 WasmInterpreter string }
CoreConfig is to marshal/unmarshal toml core config vars
type GlobalConfig ¶
GlobalConfig is used for every node command
type InitConfig ¶
type InitConfig struct {
GenesisRaw string
}
InitConfig is the configuration for the node initialization
type LogConfig ¶ added in v0.2.0
type LogConfig struct { CoreLvl log.Lvl SyncLvl log.Lvl NetworkLvl log.Lvl RPCLvl log.Lvl StateLvl log.Lvl RuntimeLvl log.Lvl BlockProducerLvl log.Lvl FinalityGadgetLvl log.Lvl }
LogConfig represents the log levels for individual packages
type NetworkConfig ¶
type NetworkConfig struct { Port uint32 Bootnodes []string ProtocolID string NoBootstrap bool NoMDNS bool MinPeers int MaxPeers int }
NetworkConfig is to marshal/unmarshal toml network config vars
type Node ¶
type Node struct { Name string Services *services.ServiceRegistry // registry of all node services StopFunc func() // func to call when node stops, currently used for profiling // contains filtered or unexported fields }
Node is a container for all the components of a node.