cmd

package
v0.0.0-...-1220a83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainAndFSEmitter

func ChainAndFSEmitter(paths []string) func(context.Context, ...EventHandler) error

ChainAndFSEmitter runs the passed EventHandlers the on chain and filesystem event streams

func ChainEmitter

func ChainEmitter(ctx context.Context, ehs ...EventHandler) (err error)

ChainEmitter runs the passed EventHandlers just on the on chain event stream

func DeploymentDataUpdateHandler

func DeploymentDataUpdateHandler(dd *DeploymentData) func(pubsub.Event) error

DeploymentDataUpdateHandler updates a DeploymentData and prints relevant events

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func FSEvents

func FSEvents(paths []string) func(context.Context, ...EventHandler) error

FSEvents runs the passed EventHandlers just on the filesystem event stream

func PrintHandler

func PrintHandler(ev pubsub.Event) (err error)

PrintHandler prints all the events

func SendManifestHander

func SendManifestHander(dd *DeploymentData) func(pubsub.Event) error

SendManifestHander sends manifests on the lease created event

Types

type Config

type Config struct {
	ChainID string `yaml:"chain-id" json:"chain-id"`
	RPCAddr string `yaml:"rpc-addr" json:"rpc-addr"`
	Keyfile string `yaml:"keyfile" json:"keyfile"`
	Keypass string `yaml:"keypass" json:"keypass"`

	Amino *codec.Codec
	// contains filtered or unexported fields
}

Config represents the application configuration

func (*Config) BlockHeight

func (c *Config) BlockHeight() (uint64, error)

BlockHeight returns the current block height from the configured client

func (*Config) BroadcastTxCommit

func (c *Config) BroadcastTxCommit(txBytes []byte) (sdk.TxResponse, error)

BroadcastTxCommit takes the marshaled transaction bytes and broadcasts them

func (*Config) BuildAndSignTx

func (c *Config) BuildAndSignTx(msgs []sdk.Msg) ([]byte, error)

BuildAndSignTx takes messages and builds, signs and marshals a sdk.Tx to prepare it for broadcast

func (*Config) CLICtx

func (c *Config) CLICtx(client *rpchttp.HTTP) cctx.CLIContext

CLICtx returns the CLICtx object with some defaults set

func (*Config) CreateDeploymentFileInArchive

func (c *Config) CreateDeploymentFileInArchive(dd *DeploymentData) error

CreateDeploymentFileInArchive creates the deployment file in the `$HOME/.akash-deploy/deployments/` folder

func (*Config) CreateKeybase

func (c *Config) CreateKeybase() (err error)

CreateKeybase returns the

func (*Config) GetAccAddress

func (c *Config) GetAccAddress() sdk.AccAddress

GetAccAddress returns the deployer account address

func (*Config) NewTMClient

func (c *Config) NewTMClient() *rpchttp.HTTP

NewTMClient returns a new tendermint RPC client from the config NOTE: there shouldn't be errors here because we already check them in validateConfig

func (*Config) SendMsgs

func (c *Config) SendMsgs(datagrams []sdk.Msg) (res sdk.TxResponse, err error)

SendMsgs sends given sdk messages

func (*Config) TxCreateDeployment

func (c *Config) TxCreateDeployment(dd *DeploymentData) (err error)

TxCreateDeployment takes DeploymentData and creates the specified deployment

func (*Config) WaitForLeasesAndPollService

func (c *Config) WaitForLeasesAndPollService(dd *DeploymentData, cancel context.CancelFunc) error

WaitForLeasesAndPollService waits for

type DeploymentData

type DeploymentData struct {
	SDLFile      []byte
	SDL          sdl.SDL
	Manifest     manifest.Manifest
	Groups       []*dtypes.GroupSpec
	DeploymentID dtypes.DeploymentID
	OrderID      []mtypes.OrderID
	LeaseID      []mtypes.LeaseID

	sync.RWMutex
}

DeploymentData contains the various IDs involved in a deployment

func NewDeploymentData

func NewDeploymentData(file string, flags *pflag.FlagSet, depAddr sdk.AccAddress) (*DeploymentData, error)

NewDeploymentData returns a DeploymentData struct initialized from a file and flags

func NewDeploymentDataFromConfig

func NewDeploymentDataFromConfig() *DeploymentData

NewDeploymentDataFromConfig returns all the deployment data that can be gleaned from the config file

func (*DeploymentData) AddLease

func (dd *DeploymentData) AddLease(lease mtypes.LeaseID)

AddLease adds a lease for tracking

func (*DeploymentData) AddOrder

func (dd *DeploymentData) AddOrder(order mtypes.OrderID)

AddOrder adds an order for tracking

func (*DeploymentData) ExpectedLeases

func (dd *DeploymentData) ExpectedLeases() bool

ExpectedLeases returns true if all the leases are in state

func (*DeploymentData) ExpectedOrders

func (dd *DeploymentData) ExpectedOrders() bool

ExpectedOrders returns true if all the orders are in state

func (*DeploymentData) Leases

func (dd *DeploymentData) Leases() []mtypes.LeaseID

Leases returns a copy of the LeaseIDs tracked

func (*DeploymentData) MsgCreate

func (dd *DeploymentData) MsgCreate() dtypes.MsgCreateDeployment

MsgCreate constructor for MsgCreateDeployment

func (*DeploymentData) RemoveLease

func (dd *DeploymentData) RemoveLease(order mtypes.LeaseID)

RemoveLease adds an order for tracking

func (*DeploymentData) RemoveOrder

func (dd *DeploymentData) RemoveOrder(order mtypes.OrderID)

RemoveOrder adds an order for tracking

type EventEmitter

type EventEmitter func(context.Context, ...EventHandler) error

EventEmitter is a type that describes event emitter functions

type EventHandler

type EventHandler func(pubsub.Event) error

EventHandler is a type of function that handles events coming out of the event bus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL