Documentation ¶
Index ¶
- Variables
- func CreateJSONRawFile(bs *BuildSpec, fp string)
- func ImportState(basepath, stateFP, headerFP string, firstSlot uint64) error
- func InitNode(cfg *Config) error
- func IsNodeInitialised(basepath string) bool
- func LoadGlobalNodeName(basepath string) (nodename string, err error)
- func NewTestGenesisRawFile(t *testing.T, cfg *Config) (filename string)
- func RandomNodeName() string
- func WriteGenesisSpecFile(data []byte, fp string) error
- type AccountConfig
- type BuildSpec
- type Config
- type CoreConfig
- type GlobalConfig
- type InitConfig
- type LogConfig
- type NetworkConfig
- type Node
- type RPCConfig
- type ServiceBuilder
- type StateConfig
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
var ErrWasmInterpreterName = errors.New("unknown wasm interpreter name")
Functions ¶
func CreateJSONRawFile ¶
CreateJSONRawFile will generate a JSON genesis file with raw storage
func ImportState ¶
ImportState imports the state in the given files to the database with the given path.
func IsNodeInitialised ¶
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 ¶
LoadGlobalNodeName returns the stored global node name from database
func NewTestGenesisRawFile ¶
NewTestGenesisRawFile returns a test genesis file using "gssmr" raw data
func RandomNodeName ¶
func RandomNodeName() string
RandomNodeName generates a new random name if there is no name configured for the node
func WriteGenesisSpecFile ¶
WriteGenesisSpecFile writes the build-spec in the output filepath
Types ¶
type AccountConfig ¶
AccountConfig is to marshal/unmarshal account config vars
type BuildSpec ¶
type BuildSpec struct {
// contains filtered or unexported fields
}
BuildSpec object for working with building genesis JSON files
func BuildFromDB ¶
BuildFromDB builds a BuildSpec from the DB located at path
func BuildFromGenesis ¶
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 State StateConfig }
Config is a collection of configurations throughout the system
func DevConfig ¶
func DevConfig() *Config
DevConfig returns the configuration for a development chain
func GssmrConfig ¶
func GssmrConfig() *Config
GssmrConfig returns a new test configuration using the provided basepath
type CoreConfig ¶
type CoreConfig struct { Roles byte BabeAuthority bool BABELead 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 NoTelemetry bool TelemetryURLs []genesis.TelemetryEndpoint RetainBlocks int64 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 LogConfig ¶
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
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 }
NetworkConfig is to marshal/unmarshal toml network config vars
type Node ¶
type Node struct { Name string ServiceRegistry services.ServiceRegisterer // registry of all node services // contains filtered or unexported fields }
Node is a container for all the components of a node.
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
type ServiceBuilder ¶
type ServiceBuilder interface {
NewServiceIFace(cfg *babe.ServiceConfig) (babe.ServiceIFace, error)
}
ServiceBuilder interface to define the building of babe service
type StateConfig ¶
type StateConfig struct {
Rewind uint
}
StateConfig is the config for the State service