|
| 1 | +--- |
| 2 | +title: Network Status & Health Monitoring |
| 3 | +--- |
| 4 | + |
| 5 | +# Network Status |
| 6 | + |
| 7 | +Monitor the real-time health and uptime of Lit Protocol's core network endpoints across different environments. |
| 8 | + |
| 9 | +## Status Pages |
| 10 | + |
| 11 | +### Development Network |
| 12 | + |
| 13 | +**[Naga Dev Network Status](https://uptime.getlit.dev/naga-dev)** |
| 14 | + |
| 15 | +Live monitoring dashboard for the development network, tracking real-time metrics for all core SDK operations. |
| 16 | + |
| 17 | +### Test Network |
| 18 | + |
| 19 | +**[Naga Test Network Status](https://uptime.getlit.dev/naga-test)** |
| 20 | + |
| 21 | +Live monitoring dashboard for the test network, providing visibility into network health and performance. |
| 22 | + |
| 23 | +## Monitored Operations |
| 24 | + |
| 25 | +These dashboards track the uptime and performance of core SDK methods: |
| 26 | + |
| 27 | +| Operation | Description | |
| 28 | +| ------------------ | ---------------------------------------------------- | |
| 29 | +| **decrypt** | Decryption operations for encrypted data | |
| 30 | +| **executeJs** | JavaScript execution in Lit Actions | |
| 31 | +| **handshake** | Node handshake and connection establishment | |
| 32 | +| **pkpSign** | PKP signing operations for transactions and messages | |
| 33 | +| **signSessionKey** | Session key signing for authentication | |
| 34 | + |
| 35 | +## Programmatic Access |
| 36 | + |
| 37 | +<Warning> |
| 38 | +**Experimental Feature**: The Lit Status SDK is currently in active development and should be considered experimental. APIs and features may change without notice. |
| 39 | +</Warning> |
| 40 | + |
| 41 | +You can access network metrics programmatically using the [Lit Status SDK](https://uptime-docs.vercel.app/docs/sdk) for read-only monitoring and analytics. |
| 42 | + |
| 43 | +### Prerequisites |
| 44 | + |
| 45 | +To access the Status API, you'll need a read-only API key. Request access by filling out the [Lit Protocol Contact Form](https://docs.google.com/forms/d/e/1FAIpQLScBVsg-NhdMIC1H1mozh2zaVX0V4WtmEPSPrtmqVtnj_3qqNw/viewform). |
| 46 | + |
| 47 | +### Installation |
| 48 | + |
| 49 | +```bash |
| 50 | +npm install @lit-protocol/lit-status-sdk |
| 51 | +``` |
| 52 | + |
| 53 | +### Example Usage |
| 54 | + |
| 55 | +```typescript |
| 56 | +import { createLitStatusClient } from '@lit-protocol/lit-status-sdk'; |
| 57 | + |
| 58 | +(async () => { |
| 59 | + const client = createLitStatusClient({ |
| 60 | + url: process.env.API_URL, |
| 61 | + apiKey: process.env.READ_KEY, |
| 62 | + }); |
| 63 | + |
| 64 | + // Get available filter options |
| 65 | + const filterOptions = await client.getFilterOptions(); |
| 66 | + console.log('Available networks:', filterOptions.networks); |
| 67 | + console.log('Available functions:', filterOptions.functions); |
| 68 | + |
| 69 | + // Register and retrieve function references |
| 70 | + const functions = await client.getOrRegisterFunctions({ |
| 71 | + network: 'naga-dev', |
| 72 | + product: 'js-sdk/naga', |
| 73 | + functions: ['executeJs', 'pkpSign', 'decrypt'], |
| 74 | + }); |
| 75 | + |
| 76 | + // Get recent metrics for a specific function |
| 77 | + const executeJsMetrics = await client.getFunctionMetrics( |
| 78 | + functions['executeJs'].id, |
| 79 | + { |
| 80 | + startDate: new Date(Date.now() - 24 * 60 * 60 * 1000), // Last 24 hours |
| 81 | + endDate: new Date(), |
| 82 | + } |
| 83 | + ); |
| 84 | + |
| 85 | + console.log('ExecuteJs Metrics:', { |
| 86 | + uptime: `${executeJsMetrics.uptime}%`, |
| 87 | + successRate: `${executeJsMetrics.successRate}%`, |
| 88 | + avgResponseTime: `${executeJsMetrics.averageResponseTime}ms`, |
| 89 | + totalExecutions: executeJsMetrics.totalExecutions, |
| 90 | + }); |
| 91 | + |
| 92 | + // Get time-series data for charting |
| 93 | + const timeSeries = await client.getFunctionMetricsTimeSeries( |
| 94 | + functions['executeJs'].id, |
| 95 | + { |
| 96 | + startDate: new Date(Date.now() - 24 * 60 * 60 * 1000), |
| 97 | + endDate: new Date(), |
| 98 | + }, |
| 99 | + 'hour' |
| 100 | + ); |
| 101 | + |
| 102 | + timeSeries.buckets.forEach((bucket) => { |
| 103 | + console.log( |
| 104 | + `${bucket.timestamp}: ${bucket.successRate}% success, ` + |
| 105 | + `${bucket.averageResponseTime}ms avg` |
| 106 | + ); |
| 107 | + }); |
| 108 | +})(); |
| 109 | +``` |
0 commit comments