Documentation
¶
Index ¶
- func ChainAndFSEmitter(paths []string) func(context.Context, ...EventHandler) error
- func ChainEmitter(ctx context.Context, ehs ...EventHandler) (err error)
- func DeploymentDataUpdateHandler(dd *DeploymentData) func(pubsub.Event) error
- func Execute()
- func FSEvents(paths []string) func(context.Context, ...EventHandler) error
- func PrintHandler(ev pubsub.Event) (err error)
- func SendManifestHander(dd *DeploymentData) func(pubsub.Event) error
- type Config
- func (c *Config) BlockHeight() (uint64, error)
- func (c *Config) BroadcastTxCommit(txBytes []byte) (sdk.TxResponse, error)
- func (c *Config) BuildAndSignTx(msgs []sdk.Msg) ([]byte, error)
- func (c *Config) CLICtx(client *rpchttp.HTTP) cctx.CLIContext
- func (c *Config) CreateDeploymentFileInArchive(dd *DeploymentData) error
- func (c *Config) CreateKeybase() (err error)
- func (c *Config) GetAccAddress() sdk.AccAddress
- func (c *Config) NewTMClient() *rpchttp.HTTP
- func (c *Config) SendMsgs(datagrams []sdk.Msg) (res sdk.TxResponse, err error)
- func (c *Config) TxCreateDeployment(dd *DeploymentData) (err error)
- func (c *Config) WaitForLeasesAndPollService(dd *DeploymentData, cancel context.CancelFunc) error
- type DeploymentData
- func (dd *DeploymentData) AddLease(lease mtypes.LeaseID)
- func (dd *DeploymentData) AddOrder(order mtypes.OrderID)
- func (dd *DeploymentData) ExpectedLeases() bool
- func (dd *DeploymentData) ExpectedOrders() bool
- func (dd *DeploymentData) Leases() []mtypes.LeaseID
- func (dd *DeploymentData) MsgCreate() dtypes.MsgCreateDeployment
- func (dd *DeploymentData) RemoveLease(order mtypes.LeaseID)
- func (dd *DeploymentData) RemoveOrder(order mtypes.OrderID)
- type EventEmitter
- type EventHandler
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 ¶
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 ¶
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 ¶
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 ¶
CreateKeybase returns the
func (*Config) GetAccAddress ¶
func (c *Config) GetAccAddress() sdk.AccAddress
GetAccAddress returns the deployer account address
func (*Config) NewTMClient ¶
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) 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 ¶
EventHandler is a type of function that handles events coming out of the event bus