Documentation ¶
Index ¶
- Constants
- Variables
- func BuildAndBroadcastTx(clientCtx client.Context, flags *pflag.FlagSet, msgs []sdk.Msg) (*sdk.TxResponse, error)
- func ChainEmitter(ctx context.Context, clientCtx client.Context, ehs ...EventHandler) (err error)
- func DeploymentDataUpdateHandler(dd *DeploymentData, bids chan<- mtypes.EventBidCreated, ...) func(pubsub.Event) error
- func RootCmd() *cobra.Command
- func SendManifestHander(clientCtx client.Context, dd *DeploymentData, ...) func(pubsub.Event) error
- func SendMsgs(clientCtx client.Context, flags *pflag.FlagSet, datagrams []sdk.Msg) (res *sdk.TxResponse, err error)
- func TxCreateDeployment(clientCtx client.Context, flags *pflag.FlagSet, dd *DeploymentData) (err 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) RemoveOrder(order mtypes.OrderID)
- type EventEmitter
- type EventHandler
Constants ¶
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 ¶
var DefaultDeposit = dtypes.DefaultDeploymentMinDeposit
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 ¶
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 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 ¶
EventHandler is a type of function that handles events coming out of the event bus