> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getVersion

> Returns the current version of the node

## Parameters

None

## Response

<ResponseField name="result" type="object">
  Object containing:

  <ResponseField name="solana-core" type="string">
    Version of the Solana core software
  </ResponseField>

  <ResponseField name="feature-set" type="number" optional>
    Feature set version
  </ResponseField>
</ResponseField>

## Code Examples

### Basic Request

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getVersion"
}'
```

### Using web3.js

```typescript theme={null}
import { Connection } from '@solana/web3.js';

const connection = new Connection('https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');

// Get version
const version = await connection.getVersion();
console.log('Node version:', version);

// Get version with analysis
async function getVersionWithAnalysis() {
  const version = await connection.getVersion();
  
  return {
    version,
    analysis: {
      timestamp: Date.now(),
      isLatest: await checkLatestVersion(version['solana-core'])
    }
  };
}

async function checkLatestVersion(currentVersion: string): Promise<boolean> {
  // Implementation to check if current version is latest
  // This would typically involve calling an external API
  return true;
}
```

## Notes

1. Returns the current version of the node
2. The version includes the Solana core software version
3. The response is immediate as it reads from the current state
4. The version can change with node updates
5. Different nodes may run different versions

## Best Practices

1. Cache results when appropriate to reduce RPC load
2. Monitor for version changes
3. Consider using websocket subscription for real-time updates
4. Handle network errors and retry when appropriate
5. Keep track of version compatibility

## Common Errors

| Code   | Message          | Solution                                     |
| ------ | ---------------- | -------------------------------------------- |
| -32601 | Method not found | Verify you're connected to a Solana RPC node |

## Use Cases

1. **Version Analysis**
   ```typescript theme={null}
   interface VersionAnalysis {
     version: {
       core: string;
       featureSet?: number;
     };
     metrics: {
       timestamp: number;
       isLatest: boolean;
       isCompatible: boolean;
     };
   }

   class VersionAnalyzer {
     private readonly minCompatibleVersion = '1.8.0';
     
     async analyzeVersion(): Promise<VersionAnalysis> {
       const version = await connection.getVersion();
       
       return {
         version: {
           core: version['solana-core'],
           featureSet: version['feature-set']
         },
         metrics: {
           timestamp: Date.now(),
           isLatest: await this.checkLatestVersion(version['solana-core']),
           isCompatible: this.checkCompatibility(version['solana-core'])
         }
       };
     }
     
     private async checkLatestVersion(currentVersion: string): Promise<boolean> {
       // Implementation to check if current version is latest
       return true;
     }
     
     private checkCompatibility(currentVersion: string): boolean {
       const [currentMajor, currentMinor] = currentVersion.split('.').map(Number);
       const [minMajor, minMinor] = this.minCompatibleVersion.split('.').map(Number);
       
       return currentMajor > minMajor || 
              (currentMajor === minMajor && currentMinor >= minMinor);
     }
   }
   ```

2. **Version Monitoring**
   ```typescript theme={null}
   interface VersionChange {
     changes: {
       previousVersion: string;
       currentVersion: string;
       type: 'upgrade' | 'downgrade';
     };
     metadata: {
       timestamp: number;
     };
   }

   class VersionMonitor {
     private previousVersion: string | null = null;
     
     async monitorVersion(): Promise<VersionChange | null> {
       const version = await connection.getVersion();
       const currentVersion = version['solana-core'];
       
       if (this.previousVersion !== null && this.previousVersion !== currentVersion) {
         const type = this.compareVersions(currentVersion, this.previousVersion) > 0 ? 'upgrade' : 'downgrade';
         
         this.previousVersion = currentVersion;
         
         return {
           changes: {
             previousVersion: this.previousVersion,
             currentVersion,
             type
           },
           metadata: {
             timestamp: Date.now()
           }
         };
       }
       
       this.previousVersion = currentVersion;
       return null;
     }
     
     private compareVersions(v1: string, v2: string): number {
       const [major1, minor1, patch1] = v1.split('.').map(Number);
       const [major2, minor2, patch2] = v2.split('.').map(Number);
       
       if (major1 !== major2) return major1 - major2;
       if (minor1 !== minor2) return minor1 - minor2;
       return patch1 - patch2;
     }
   }
   ```

3. **Version Planning**
   ```typescript theme={null}
   interface VersionPlan {
     currentVersion: string;
     recommendations: Array<{
       type: 'upgrade' | 'downgrade' | 'maintain';
       reason: string;
     }>;
     metadata: {
       timestamp: number;
     };
   }

   class VersionPlanner {
     private readonly targetVersion = '1.9.0';
     private readonly minCompatibleVersion = '1.8.0';
     
     async planVersion(): Promise<VersionPlan> {
       const version = await connection.getVersion();
       const currentVersion = version['solana-core'];
       
       const recommendations: Array<{
         type: 'upgrade' | 'downgrade' | 'maintain';
         reason: string;
       }> = [];
       
       // Check for version compatibility
       if (!this.checkCompatibility(currentVersion)) {
         recommendations.push({
           type: 'upgrade',
           reason: `Current version (${currentVersion}) is not compatible with minimum version (${this.minCompatibleVersion})`
         });
       }
       
       // Check for target version
       if (this.compareVersions(currentVersion, this.targetVersion) < 0) {
         recommendations.push({
           type: 'upgrade',
           reason: `Current version (${currentVersion}) is below target version (${this.targetVersion})`
         });
       }
       
       return {
         currentVersion,
         recommendations,
         metadata: {
           timestamp: Date.now()
         }
       };
     }
     
     private checkCompatibility(currentVersion: string): boolean {
       const [currentMajor, currentMinor] = currentVersion.split('.').map(Number);
       const [minMajor, minMinor] = this.minCompatibleVersion.split('.').map(Number);
       
       return currentMajor > minMajor || 
              (currentMajor === minMajor && currentMinor >= minMinor);
     }
     
     private compareVersions(v1: string, v2: string): number {
       const [major1, minor1, patch1] = v1.split('.').map(Number);
       const [major2, minor2, patch2] = v2.split('.').map(Number);
       
       if (major1 !== major2) return major1 - major2;
       if (minor1 !== minor2) return minor1 - minor2;
       return patch1 - patch2;
     }
   }
   ```
