Documentation
¶
Index ¶
- func AddGenesisAccounts(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
- func CollectGenesisTxs(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
- func ConfigurePayload(settings config.Schema, evt *model.Event, cmdRunner CommandRunner) (err error)
- func CreateEvent(settings config.Schema, evt *model.Event) (err error)
- func DeployPayload(settings config.Schema, evt *model.Event, cmdRunner CommandRunner, ...) (err error)
- func DestroyEvent(settings config.Schema, evt *model.Event, cmdRunner CommandRunner) (err error)
- func DownloadPayloadBinary(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
- func EditConfigs(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
- func GenerateFaucetConfig(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
- func GenerateKeys(settings config.Schema, evt *model.Event, runCommand CommandRunner) (*model.Event, error)
- func GenesisTxs(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
- func GetEventByID(settings config.Schema, ID string) (event model.Event, err error)
- func InitDaemon(settings config.Schema, evt *model.Event, runCommand CommandRunner) (*model.Event, error)
- func InspectEvent(settings config.Schema, evt *model.Event, cmdRunner CommandRunner) (err error)
- func InstallDockerMachine(settings config.Schema) (err error)
- func ListEvents(settings config.Schema) (events []model.Event, err error)
- func LoadEvent(settings config.Schema, evtID string) (evt *model.Event, err error)
- func Provision(settings config.Schema, evt *model.Event, cmdRunner CommandRunner, ...) (err error)
- func RereadDockerMachineInfo(settings config.Schema, evt *model.Event, dmc DockerMachineInterface) (event *model.Event, err error)
- func RunCommand(command, envVars []string) (out string, err error)
- func SetupWorkspace(settings config.Schema) (err error)
- func StoreEvent(settings config.Schema, evt *model.Event) (err error)
- type CommandRunner
- type DockerMachineConfig
- type DockerMachineConfigFormat
- type DockerMachineInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGenesisAccounts ¶
func AddGenesisAccounts(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
AddGenesisAccounts runs gaiad add-genesis-account with the created addresses and default initial balances
func CollectGenesisTxs ¶
func CollectGenesisTxs(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
CollectGenesisTxs is run on every node's config directory from the single directory where the genesis transactions were placed before. In the end, only the first node's genesis.json will be used.
func ConfigurePayload ¶
func ConfigurePayload(settings config.Schema, evt *model.Event, cmdRunner CommandRunner) (err error)
ConfigurePayload is a wrapper function that runs all the needed steps to generate a payload's configuration and fills out the evt object with said information.
func CreateEvent ¶
CreateEvent creates the event home and the event descriptor
func DeployPayload ¶
func DeployPayload(settings config.Schema, evt *model.Event, cmdRunner CommandRunner, dmc DockerMachineInterface) (err error)
DeployPayload tells the provisioned machines to run the configured docker image
func DestroyEvent ¶
DestroyEvent destroy an existing event
func DownloadPayloadBinary ¶
func DownloadPayloadBinary(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
DownloadPayloadBinary downloads a copy of the payload binaries to the host running lctrld to generate the config files for the provisioned machines
func EditConfigs ¶
EditConfigs edits the config.toml of every node to have the same persistent_peers.
func GenerateFaucetConfig ¶
func GenerateFaucetConfig(settings config.Schema, evt *model.Event, runCommand CommandRunner) (err error)
GenerateFaucetConfig generates a configuration for the faucet given what it knows about the event
func GenerateKeys ¶
func GenerateKeys(settings config.Schema, evt *model.Event, runCommand CommandRunner) (*model.Event, error)
GenerateKeys generates keys for each genesis account (this includes validator accounts). The specific command is gaiacli keys add validatoremail/some other name -o json --keyring-backend test --home.... for each node.
func GenesisTxs ¶
GenesisTxs runs gentx to turn accounts into validator accounts and outputs the genesis transactions into a single folder.
func GetEventByID ¶
GetEventByID retrieve an event by name
func InitDaemon ¶
func InitDaemon(settings config.Schema, evt *model.Event, runCommand CommandRunner) (*model.Event, error)
InitDaemon runs gaiad init burnerchain --home state.DaemonConfigDir and gaiad tendermint show-node-id
func InspectEvent ¶
InspectEvent inspect status of the infrastructure for an event
func InstallDockerMachine ¶
InstallDockerMachine setup docker machine environment
func ListEvents ¶
ListEvents list available events
func Provision ¶
func Provision(settings config.Schema, evt *model.Event, cmdRunner CommandRunner, dmc DockerMachineInterface) (err error)
Provision provision the infrastructure for the event
func RereadDockerMachineInfo ¶
func RereadDockerMachineInfo(settings config.Schema, evt *model.Event, dmc DockerMachineInterface) (event *model.Event, err error)
RereadDockerMachineInfo is useful when docker-machine failed during 'create', and a human fixed the problem, and wants to continue
func RunCommand ¶
RunCommand runs a command
func SetupWorkspace ¶
SetupWorkspace setup the workspace for the service
Types ¶
type CommandRunner ¶
CommandRunner func type allows for mocking out RunCommand()
type DockerMachineConfig ¶
DockerMachineConfig holds information that lets lctrld read the state of a docker-machine provisioning
func NewDockerMachineConfig ¶
func NewDockerMachineConfig(settings config.Schema, eventID string) *DockerMachineConfig
NewDockerMachineConfig ensures that all fields of a DockerMachineConfig are filled out
func (*DockerMachineConfig) HomeDir ¶
func (dmc *DockerMachineConfig) HomeDir(machineN string) string
HomeDir returns the path of a docker-machine instance home, e.g. /tmp/workspace/evts/drop-xxx/.docker/machine/machines/drop-xxx-0/
func (*DockerMachineConfig) ReadConfig ¶
func (dmc *DockerMachineConfig) ReadConfig(machineN string) (mc *model.MachineConfig, err error)
ReadConfig return configuration of a docker machine
type DockerMachineConfigFormat ¶
type DockerMachineConfigFormat struct {
ConfigVersion int `json:"ConfigVersion"`
Driver struct {
IPAddress string `json:"IPAddress"`
MachineName string `json:"MachineName"`
SSHUser string `json:"SSHUser"`
SSHPort int `json:"SSHPort"`
SSHKeyPath string `json:"SSHKeyPath"`
StorePath string `json:"StorePath"`
SwarmMaster bool `json:"SwarmMaster"`
SwarmHost string `json:"SwarmHost"`
SwarmDiscovery string `json:"SwarmDiscovery"`
VBoxManager struct {
} `json:"VBoxManager"`
HostInterfaces struct {
} `json:"HostInterfaces"`
CPU int `json:"CPU"`
Memory int `json:"Memory"`
DiskSize int `json:"DiskSize"`
NatNicType string `json:"NatNicType"`
Boot2DockerURL string `json:"Boot2DockerURL"`
Boot2DockerImportVM string `json:"Boot2DockerImportVM"`
HostDNSResolver bool `json:"HostDNSResolver"`
HostOnlyCIDR string `json:"HostOnlyCIDR"`
HostOnlyNicType string `json:"HostOnlyNicType"`
HostOnlyPromiscMode string `json:"HostOnlyPromiscMode"`
UIType string `json:"UIType"`
HostOnlyNoDHCP bool `json:"HostOnlyNoDHCP"`
NoShare bool `json:"NoShare"`
DNSProxy bool `json:"DNSProxy"`
NoVTXCheck bool `json:"NoVTXCheck"`
ShareFolder string `json:"ShareFolder"`
} `json:"Driver"`
DriverName string `json:"DriverName"`
HostOptions struct {
Driver string `json:"Driver"`
Memory int `json:"Memory"`
Disk int `json:"Disk"`
EngineOptions struct {
ArbitraryFlags []interface{} `json:"ArbitraryFlags"`
DNS interface{} `json:"Dns"`
GraphDir string `json:"GraphDir"`
Env []interface{} `json:"Env"`
Ipv6 bool `json:"Ipv6"`
InsecureRegistry []interface{} `json:"InsecureRegistry"`
Labels []interface{} `json:"Labels"`
LogLevel string `json:"LogLevel"`
StorageDriver string `json:"StorageDriver"`
SelinuxEnabled bool `json:"SelinuxEnabled"`
TLSVerify bool `json:"TlsVerify"`
RegistryMirror []interface{} `json:"RegistryMirror"`
InstallURL string `json:"InstallURL"`
} `json:"EngineOptions"`
SwarmOptions struct {
IsSwarm bool `json:"IsSwarm"`
Address string `json:"Address"`
Discovery string `json:"Discovery"`
Agent bool `json:"Agent"`
Master bool `json:"Master"`
Host string `json:"Host"`
Image string `json:"Image"`
Strategy string `json:"Strategy"`
Heartbeat int `json:"Heartbeat"`
Overcommit int `json:"Overcommit"`
ArbitraryFlags []interface{} `json:"ArbitraryFlags"`
ArbitraryJoinFlags []interface{} `json:"ArbitraryJoinFlags"`
Env interface{} `json:"Env"`
IsExperimental bool `json:"IsExperimental"`
} `json:"SwarmOptions"`
AuthOptions struct {
CertDir string `json:"CertDir"`
CaCertPath string `json:"CaCertPath"`
CaPrivateKeyPath string `json:"CaPrivateKeyPath"`
CaCertRemotePath string `json:"CaCertRemotePath"`
ServerCertPath string `json:"ServerCertPath"`
ServerKeyPath string `json:"ServerKeyPath"`
ClientKeyPath string `json:"ClientKeyPath"`
ServerCertRemotePath string `json:"ServerCertRemotePath"`
ServerKeyRemotePath string `json:"ServerKeyRemotePath"`
ClientCertPath string `json:"ClientCertPath"`
ServerCertSANs []interface{} `json:"ServerCertSANs"`
StorePath string `json:"StorePath"`
} `json:"AuthOptions"`
} `json:"HostOptions"`
Name string `json:"Name"`
}
DockerMachineConfigFormat is the structure of .docker/machine/machines/<MACHINE NAME>/config.json, which describes a deployed VM's configuration
type DockerMachineInterface ¶
type DockerMachineInterface interface {
HomeDir(string) string
ReadConfig(string) (*model.MachineConfig, error)
}
DockerMachineInterface is a mocking interface for functions that need to read docker-machine config files