// ensureRemoteValid ensures the node is healthy and the target account is in a valid
// state. To achieve this, it will verify, create or delete applications and store the
// updated results in the AlgorandBuffer. Call this when initializing the AlgorandBuffer
// (see NewAlgorandBuffer).
//
// If the target account is valid and the node is healthy, this function does nothing.
ensureRemoteValid ensures the node is healthy and the target account is in a valid
state. To achieve this, it will verify, create or delete applications and store the
updated results in the AlgorandBuffer. Call this when initializing the AlgorandBuffer
.

If the target account is valid and the node is healthy, this function does nothing.
// ensureRemoteValid ensures the node is healthy and the target account is in a valid // state . To achieve this it will verify create or delete applications and store the // updated results in the AlgorandBuffer . Call this when initializing the AlgorandBuffer // ( see NewAlgorandBuffer ) . // // If the target account is valid and the node is healthy this function does nothing .
func (ab *AlgorandBuffer) ensureRemoteValid(ctx context.Context) error {
	err := ab.checkConnection()
	if err != nil {
		return err
	}
	err = ab.manageDeletion()
	if err != nil {
		return err
	}
	err = ab.manageCreation()
	if err != nil {
		return err
	}
	ctx, cancel := context.WithTimeout(context.Background(), ab.timeoutLength)
	info, err := ab.Client.AccountInformation(ab.AccountCrypt.Address.String(), ctx)
	cancel()
	if err != nil {
		return err
	}
	ab.AppId = info.CreatedApps[0].Id
	return nil
}
func ( ab * AlgorandBuffer ) ensureRemoteValid ( ctx context . Context ) error { err := ab . checkConnection ( ) if err != nil { return err } err = ab . manageDeletion ( ) if err != nil { return err } err = ab . manageCreation ( ) if err != nil { return err } ctx , cancel := context . WithTimeout ( context . Background ( ) , ab . timeoutLength ) info , err := ab . Client . AccountInformation ( ab . AccountCrypt . Address . String ( ) , ctx ) cancel ( ) if err != nil { return err } ab . AppId = info . CreatedApps [ 0 ] . Id return nil }
ensureRemoteValid ensures the node is healthy and the target account is in a valid
state.
ensureRemoteValid ensures the node is healthy and the target account is in a valid state .
// Connectivity check // Deletion Routine // Creation Routine // Set AppID correctly