Documentation
¶
Overview ¶
Package node provides an easy way to access node related information.
Utility functions to generate names and directory paths encapsulate the package conventions. It is highly recommended to use this package when implementing a new package to achieve consistency across packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
CA string `json:"ca"`
Cert string `json:"cert"`
Host string `json:"host"`
Key string `json:"key"`
}
Collection is config for log and node data collection
type Node ¶
type Node struct {
// The global ID of this node
ID string `json:"id"`
// The plugin name
PluginName string `json:"plugin"`
// Dynamic (i.e. defined by the plugin) string parameters
StrParameters map[string]string `json:"str_parameters"`
// Dynamic bool parameters
BoolParameters map[string]bool `json:"bool_parameters"`
// Describes the collection configuration
Collection Collection `json:"collection"`
// Secrets (Example: Private keys)
Secrets map[string]interface{} `json:"-"` // No json here, never serialize secrets!
// Holding place for data that is generated at runtime. E.g. can be used to store data parsed from the parameters
Data map[string]interface{} `json:"-"` // No json here, runtime data only
// The package version used to install this node (if installed yet)
// This is useful to know in order to run migrations on upgrades.
Version string `json:"version"`
// contains filtered or unexported fields
}
Node represents a blockchain node, it's configuration and related information
func (Node) ConfigsDirectory ¶
ConfigsDirectorys returns the directory under which all configuration for the blockchain client is stored
func (Node) NamePrefix ¶
NamePrefix returns the prefix used as a convention when naming containers, volumes, networks, etc.
func (Node) NodeDirectory ¶
NodeDirectory returns the base directory under which all configuration, secrets and meta-data for this node is stored
func (Node) NodeFile ¶
NodeFile returns the filepath in which the base configuration as well as meta-data from the PBG is stored
func (Node) SecretsDirectory ¶
ConfigsDirectorys returns the directory under which all secrets for the blockchain client is stored