ios_background_test
Test Lightning Network background processing and channel monitoring for iOS wallet development. Verify sync, monitor, and payment tasks in background mode.
Instructions
Test Lightning background processing and channel monitoring
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskType | No | Type of background task to test | sync |
Implementation Reference
- src/tools/iosBackgroundTest.ts:20-69 (handler)The execute function implementing the core logic of the 'ios_background_test' tool. It tests iOS background processing via iosService and returns structured results including best practices and plist configuration.execute: async (args: any): Promise<ToolResult> => { try { const result = await iosService.testBackgroundProcessing(); return { content: [{ type: 'text', text: JSON.stringify({ success: result.success, message: result.message, swiftExample: result.swiftCode, taskType: args.taskType, bestPractices: [ 'Register background tasks in Info.plist', 'Use BGProcessingTask for longer operations', 'Implement proper task expiration handling', 'Schedule tasks based on user behavior', 'Monitor battery and network conditions', 'Persist state before task completion' ], plistConfiguration: ` <!-- Add to Info.plist --> <key>BGTaskSchedulerPermittedIdentifiers</key> <array> <string>com.yourapp.lightning.sync</string> <string>com.yourapp.lightning.monitor</string> <string>com.yourapp.lightning.payment</string> </array> <key>UIBackgroundModes</key> <array> <string>fetch</string> <string>processing</string> </array>`.trim() }, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : 'Unknown error' }, null, 2) }], isError: true }; } }
- src/tools/iosBackgroundTest.ts:9-19 (schema)Input schema for the tool defining the optional taskType parameter.inputSchema: { type: 'object', properties: { taskType: { type: 'string', enum: ['sync', 'monitor', 'payment'], description: 'Type of background task to test', default: 'sync' } } },
- src/index.ts:19-19 (registration)Import statement registering the backgroundTestTool for use in the MCP server.import { backgroundTestTool } from './tools/iosBackgroundTest.js';
- src/index.ts:38-62 (registration)The tools array that includes backgroundTestTool, used by the MCP server handlers for listing and executing tools.const tools = [ generateInvoiceTool, payInvoiceTool, getChannelStatusTool, getNodeInfoTool, backupStateTool, keychainTestTool, backgroundTestTool, pushNotificationTool, biometricAuthTool, createChannelTool, closeChannelTool, getBalanceTool, decodeInvoiceTool, listPaymentsTool, estimateFeeTool, generateMnemonicTool, deriveAddressTool, getSwiftCodeTool, getArchitectureTool, testScenarioTool, networkGraphTool, eventHandlingTool, chainSyncTool, ];