cmd

package
v0.0.0-...-e391bab Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlagTimeout represents max amount of time for lease status checking process
	FlagTimeout = "timeout"
	// FlagTick represents time interval at which lease status is checked
	FlagTick = "tick"
)

Variables

Functions

func BuildAndBroadcastTx

func BuildAndBroadcastTx(clientCtx client.Context, flags *pflag.FlagSet, msgs []sdk.Msg) (*sdk.TxResponse, error)

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

func ChainEmitter

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

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

func DeploymentDataUpdateHandler

func DeploymentDataUpdateHandler(dd *DeploymentData, bids chan<- mtypes.EventBidCreated, leasesReady chan<- struct{}) func(pubsub.Event) error

DeploymentDataUpdateHandler updates a DeploymentData and prints relevant events

func RootCmd

func RootCmd() *cobra.Command

RootCmd represents root command of deploy tool

func SendManifestHander

func SendManifestHander(clientCtx client.Context, dd *DeploymentData, gClientDir *gateway.ClientDirectory, retryConfiguration []retry.Option) func(pubsub.Event) error

SendManifestHander sends manifests on the lease created event

func SendMsgs

func SendMsgs(clientCtx client.Context, flags *pflag.FlagSet, datagrams []sdk.Msg) (res *sdk.TxResponse, err error)

SendMsgs sends given sdk messages

func TxCreateDeployment

func TxCreateDeployment(clientCtx client.Context, flags *pflag.FlagSet, dd *DeploymentData) (err error)

TxCreateDeployment takes DeploymentData and creates the specified deployment

Types

type DeploymentData

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

	sync.RWMutex
}

DeploymentData contains the various IDs involved in a deployment

func NewDeploymentData

func NewDeploymentData(filename string, flags *pflag.FlagSet, clientCtx client.Context) (*DeploymentData, error)

NewDeploymentData returns a DeploymentData struct initialized from a file and flags

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) 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