/api/health/find

GET

Search for lost coins in the Limbo folder and attempt to recover them by re-authenticating with the RAIDA network.

Description

The /api/health/find endpoint scans the wallet's Limbo folder for coins that may have been lost or left in an uncertain state. These are typically coins from interrupted operations such as failed exports, incomplete transfers, or network issues during authentication.

The find operation attempts to recover these coins by:

  1. Scanning Limbo: Reads all coin files from the Limbo folder
  2. Re-authenticating: Sends coins to RAIDA for fresh authentication
  3. Grading: Sorts coins based on authentication results
  4. Recovery: Moves recovered coins back to Bank or Fracked folders
What is the Limbo Folder?

The Limbo folder contains coins in an uncertain state:

  • Coins from failed export operations
  • Coins with incomplete POWN operations
  • Coins awaiting verification after network errors
  • Coins that couldn't be sorted during grading

Running Find allows you to recover these coins safely.

Use Cases

Use this endpoint when you:

  • Notice coins missing from your expected balance
  • Had network interruptions during coin operations
  • Want to verify all coins in uncertain states
  • Need to recover from failed transactions

Parameters

Parameter Type Required Description
wallet_path string Yes The file system path to the wallet directory to search for lost coins (e.g., C:/Wallets/MyWallet or /home/user/CloudCoin/Wallets/MyWallet).

Response

Returns a JSON object with the find operation results.

Response Properties

command string
Always "health-find".
success boolean
True if the operation completed successfully.
message string
Human-readable message describing the operation result.
completed boolean
True if the find operation completed without errors.
error_code integer
(Optional) Only present if completed is false. Contains the error code.

Success Response

{
  "command": "health-find",
  "success": true,
  "message": "Find coins completed successfully",
  "completed": true
}

Error Response

{
  "command": "health-find",
  "success": true,
  "message": "Find coins encountered errors",
  "completed": false,
  "error_code": 300
}

Examples

JavaScript (fetch)

const API_HOST = 'http://localhost:8080';

// Find lost coins in specified wallet
async function findLostCoins(walletPath) {
    try {
        console.log(`Searching for lost coins in wallet: ${walletPath}`);
        const encodedPath = encodeURIComponent(walletPath);
        const response = await fetch(`${API_HOST}/api/health/find?wallet_path=${encodedPath}`);
        const result = await response.json();

        if (result.completed) {
            console.log('Find operation completed successfully');
            console.log(`Message: ${result.message}`);
        } else {
            console.error('Find operation encountered errors');
            console.error(`Error code: ${result.error_code}`);
        }
    } catch (error) {
        console.error('Error during find operation:', error);
    }
}

// Usage
findLostCoins('C:/CloudCoin/Wallets/Default');

cURL

# Find lost coins in specified wallet
curl -X GET "http://localhost:8080/api/health/find?wallet_path=C%3A%5CCloudCoin%5CWallets%5CDefault"

# Find lost coins in another wallet
curl -X GET "http://localhost:8080/api/health/find?wallet_path=D%3A%5CCloudCoin%5CWallets%5CMyWallet"

# Pretty-print output
curl -X GET "http://localhost:8080/api/health/find?wallet_path=C%3A%5CCloudCoin%5CWallets%5CDefault" | json_pp

# Unix path example
curl -X GET "http://localhost:8080/api/health/find?wallet_path=/home/user/CloudCoin/Wallets/Default"

Go

package main

import (
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
)

const ApiHost = "http://localhost:8080"

type FindResponse struct {
    Command   string `json:"command"`
    Success   bool   `json:"success"`
    Message   string `json:"message"`
    Completed bool   `json:"completed"`
    ErrorCode int    `json:"error_code,omitempty"`
}

// Find lost coins in specified wallet
func findLostCoins(walletPath string) error {
    fmt.Printf("Searching for lost coins in wallet: %s\n", walletPath)

    params := url.Values{}
    params.Add("wallet_path", walletPath)

    uri := fmt.Sprintf("%s/api/health/find?%s", ApiHost, params.Encode())
    resp, err := http.Get(uri)
    if err != nil {
        return fmt.Errorf("request failed: %v", err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        return fmt.Errorf("failed to read response: %v", err)
    }

    var result FindResponse
    if err := json.Unmarshal(body, &result); err != nil {
        return fmt.Errorf("failed to parse response: %v", err)
    }

    if result.Completed {
        fmt.Println("Find operation completed successfully")
        fmt.Printf("Message: %s\n", result.Message)
        return nil
    }

    return fmt.Errorf("find operation encountered errors: %s (code: %d)", result.Message, result.ErrorCode)
}

func main() {
    // Find lost coins in specified wallet
    if err := findLostCoins("C:/CloudCoin/Wallets/Default"); err != nil {
        panic(err)
    }
}

Related Endpoints

/api/health/authenticate

Re-authenticate coins with RAIDA servers to verify current ownership status.

/api/health/fix

Heal fracked coins using the ticket-based RAIDA authentication protocol.

/api/wallets/balance

Check wallet balance to verify if expected coins are present after recovery.

/api/coins/grade

Sort recovered coins to their final folders based on authentication status.

Troubleshooting

Limbo Folder Is Empty

If the find operation reports no coins found:

  • Coins may have already been recovered or moved
  • Check the Bank and Fracked folders for your coins
  • Review transaction receipts for recent operations

Coins Moved to Counterfeit

If recovered coins end up in Counterfeit folder:

  • Coins may have been double-spent or already owned by another wallet
  • Network issues during original operation may have caused data loss
  • Contact support if you believe this is an error

Network Errors During Find

If the operation encounters network errors:

  • Check RAIDA connectivity with /api/raida/echo
  • Retry the operation when network conditions improve
  • Some coins may be partially recovered - check all folders