Documentation ¶
Index ¶
- type Network
- func (n Network) Delete(binDir string) error
- func (n Network) Genesis() gen.GenesisData
- func (n Network) GetGoalClient(binDir, nodeName string) (lg libgoal.Client, err error)
- func (n Network) GetNodeController(binDir, nodeName string) (nc nodecontrol.NodeController, err error)
- func (n Network) GetNodeDir(nodeName string) (string, error)
- func (n Network) GetPeerAddresses(binDir string) []string
- func (n Network) Name() string
- func (n Network) NodeDataDirs() []string
- func (n Network) NodesStatus(binDir string) map[string]NetworkNodeStatus
- func (n Network) PrimaryDataDir() string
- func (n Network) Save(rootDir string) error
- func (n Network) SetConsensus(binDir string, consensus config.ConsensusProtocols) error
- func (n Network) Start(binDir string, redirectOutput bool) error
- func (n Network) StartNode(binDir, nodeDir string, redirectOutput bool) (err error)
- func (n Network) Stop(binDir string)
- type NetworkCfg
- type NetworkNodeStatus
- type NetworkTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network represents an instance of a deployed network
func CreateNetworkFromTemplate ¶
func CreateNetworkFromTemplate(name, rootDir, templateFile, binDir string, importKeys bool, nodeExitCallback nodecontrol.AlgodExitErrorCallback, consensus config.ConsensusProtocols) (Network, error)
CreateNetworkFromTemplate uses the specified template to deploy a new private network under the specified root directory.
func LoadNetwork ¶
LoadNetwork loads and initializes the Network state representing an existing deployed network.
func (Network) Delete ¶
Delete the network - try stopping it first if we can. No return code - we try to kill them if we can (if we read valid PID file)
func (Network) Genesis ¶
func (n Network) Genesis() gen.GenesisData
Genesis returns the genesis data for this network
func (Network) GetGoalClient ¶
GetGoalClient returns the libgoal.Client for the specified node name
func (Network) GetNodeController ¶
func (n Network) GetNodeController(binDir, nodeName string) (nc nodecontrol.NodeController, err error)
GetNodeController returns the node controller for the specified node name
func (Network) GetNodeDir ¶
GetNodeDir returns the node directory that is associated with the given node name.
func (Network) GetPeerAddresses ¶
GetPeerAddresses returns an array of Relay addresses, if any; to be used to start nodes outside of the main 'Start' call.
func (Network) NodeDataDirs ¶
NodeDataDirs returns an array of node data directories (not the relays)
func (Network) NodesStatus ¶
func (n Network) NodesStatus(binDir string) map[string]NetworkNodeStatus
NodesStatus retrieves the status of all nodes in the network and returns the status/error for each
func (Network) PrimaryDataDir ¶
PrimaryDataDir returns the primary data directory for the network
func (Network) SetConsensus ¶
func (n Network) SetConsensus(binDir string, consensus config.ConsensusProtocols) error
SetConsensus applies a new consensus settings which would get deployed before any of the nodes starts
type NetworkCfg ¶
type NetworkCfg struct { Name string // RelayDirs are directories where relays live (where we check for connection IP:Port) // They are stored relative to root dir (e.g. "Primary") RelayDirs []string TemplateFile string // Template file used to create the network }
NetworkCfg contains the persisted configuration of the deployed network
type NetworkNodeStatus ¶
type NetworkNodeStatus struct { Status generatedV2.NodeStatusResponse Error error }
NetworkNodeStatus represents the result from checking the status of a particular node instance
type NetworkTemplate ¶
type NetworkTemplate struct { Genesis gen.GenesisData Nodes []remote.NodeConfigGoal Consensus config.ConsensusProtocols }
NetworkTemplate represents the template used for creating private named networks
func (NetworkTemplate) Validate ¶
func (t NetworkTemplate) Validate() error
Validate a specific network template to ensure it's rational, consistent, and complete