Documentation ¶
Index ¶
- Constants
- func CreateDirIfNotExists(dirname string) error
- func GetDockerComposeDir() string
- func GetNodesListFile() string
- func GetSSHKeyPath(nodeId string) string
- func GetSshKeysDir() string
- func GetWorkDir() string
- func Install(node Node, isDockerComposePresent bool)
- func RemoveNode(nodeId string) error
- func RemoveSshKeyIfExist(nodeId string) error
- func UpdateSshKeyName(oldNodeId string, newNodeId string) error
- func WriteNodeList(nodes []Node) error
- type Config
- type ConsensusStats
- type ExecutionStats
- type InstallNodeInput
- type ManageNodeInput
- type NetworkStats
- type Node
- func (node *Node) BackupWallet() (string, error)
- func (node *Node) DownloadFileSSH(remote string, local string) error
- func (node *Node) FetchStatus() (NodeStatus, State)
- func (node *Node) GetDockerComposePath() string
- func (node *Node) GetLogs() (string, error)
- func (node *Node) GetStatus() NodeStatus
- func (node *Node) GetSystemMetrics() (*SystemMetrics, error)
- func (node *Node) SetStatus(newState NodeStatus)
- func (node *Node) StartNode() (string, error)
- func (node *Node) StopNode() (string, error)
- func (node *Node) WalletInfo() (*WalletInfo, error)
- type NodeStatus
- type State
- type SystemMetrics
- type WalletInfo
Constants ¶
View Source
const DOCKER_COMPOSE_DIR = "docker-compose"
View Source
const NODES_FILENAME = "nodes.json"
View Source
const SSH_PRIVATE_KEY_DIR = "ssh-private-keys"
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfNotExists ¶
func GetDockerComposeDir ¶
func GetDockerComposeDir() string
func GetNodesListFile ¶
func GetNodesListFile() string
func GetSSHKeyPath ¶
func GetSshKeysDir ¶
func GetSshKeysDir() string
func GetWorkDir ¶
func GetWorkDir() string
func RemoveNode ¶
func RemoveSshKeyIfExist ¶
func UpdateSshKeyName ¶
func WriteNodeList ¶
Types ¶
type Config ¶
type Config struct { BlockReward *string `json:"block_reward"` DeltaF0 *uint `json:"delta_f0"` EndTimeStamp *uint `json:"end_timestamp"` GenesisTimestamp *uint `json:"genesis_timestamp"` OperationValidityParios *uint `json:"operation_validity_periods"` PeriodsPerCycle *uint `json:"periods_per_cycle"` PosLockCycles *uint `json:"pos_lock_cycles"` PosLookbackCycle *uint `json:"pos_lookback_cycles"` RollPrice *string `json:"roll_price"` T0 *uint `json:"t0"` ThreadCount *uint `json:"thread_count"` }
type ConsensusStats ¶
type ConsensusStats struct { CliqueCount *uint `json:"clique_count"` EndTimespan *uint `json:"end_timespan"` FinalBlockCount *uint `json:"final_block_count"` FinalOperationCount *uint `json:"final_operation_count"` StakerCount *uint `json:"staker_count"` StaleBlockCount *uint `json:"stale_block_count"` StartTimespan *uint `json:"start_timespan"` }
type ExecutionStats ¶
type InstallNodeInput ¶
type InstallNodeInput struct { Id string `form:"id" binding:"required"` Username string `form:"username" binding:"required"` Host string `form:"host" binding:"required"` DiscordId string `form:"discord-id"` WalletPassword string `form:"wallet-password" binding:"required"` SshPassword string `form:"ssh-password"` SshKeyFile *multipart.FileHeader `form:"file"` DockerComposeFile *multipart.FileHeader `form:"docker-compose"` }
func (*InstallNodeInput) CreateNode ¶
func (input *InstallNodeInput) CreateNode() Node
type ManageNodeInput ¶
type ManageNodeInput struct {
Id string `json:"id" binding:"required"`
}
type NetworkStats ¶
type Node ¶
type Node struct { Id string Username string Host string DiscordId string WalletPassword string SshPassword string Status NodeStatus }
func GetNodeById ¶
func (*Node) BackupWallet ¶
func (*Node) FetchStatus ¶
func (node *Node) FetchStatus() (NodeStatus, State)
func (*Node) GetDockerComposePath ¶
func (*Node) GetStatus ¶
func (node *Node) GetStatus() NodeStatus
func (*Node) GetSystemMetrics ¶
func (node *Node) GetSystemMetrics() (*SystemMetrics, error)
func (*Node) SetStatus ¶
func (node *Node) SetStatus(newState NodeStatus)
func (*Node) WalletInfo ¶
func (node *Node) WalletInfo() (*WalletInfo, error)
type NodeStatus ¶
type NodeStatus int
const ( Unknown NodeStatus = iota Up Down Installing Bootstrapping )
func (NodeStatus) String ¶
func (i NodeStatus) String() string
type State ¶
type State struct { Config *Config `json:"config"` ConsensusStats *ConsensusStats `json:"consensus_stats"` CurrentCycle *uint `json:"current_cycle"` CurrentTime *uint `json:"current_time"` ExecutionStats *ExecutionStats `json:"execution_stats"` LastSlot *node.Slot `json:"last_slot"` NetworkStats *NetworkStats `json:"network_stats"` NextSlot *node.Slot `json:"next_slot"` NodeID *string `json:"node_id"` NodeIP *string `json:"node_ip"` PoolStats *[]uint `json:"pool_stats"` Version *string `json:"version"` }
type SystemMetrics ¶
Click to show internal directories.
Click to hide internal directories.