# system_name - Moonbase RPC Method

Returns the node implementation name on Moonbase Alpha. This identifies the client software running the node (e.g., `"Parity Polkadot"`, `"Substrate Node"`, `"Astar Collator"`).

> **Why Moonbase?** Build on the Moonbeam testnet for risk-free EVM dApp development and deployment testing with free testnet tokens, full EVM compatibility, XCM testing capabilities, and identical feature set to Moonbeam mainnet.

## When to Use This Method

`system_name` is essential for Moonbeam developers, dApp testers, and teams validating cross-chain integrations:

- **Client Identification** -- Determine which Substrate client implementation your node is running (useful when multiple implementations exist)
- **Infrastructure Monitoring** -- Track client types across your validator or collator fleet on Moonbase
- **Bug Reports and Diagnostics** -- Include client implementation details when reporting issues for EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification
- **Compatibility Checks** -- Verify that the node implementation supports features required by your application

## Best Practices

- Provides client implementation info -- equivalent to `web3_clientVersion` on EVM chains
- Include this output in bug reports when troubleshooting node behavior
- Different client implementations (Substrate, Polkadot SDK, Cumulus) return different names
- Use with `system_version` for the complete software identity

## Request Parameters

This method accepts no parameters.

## Request Example

```json
{
  "jsonrpc": "2.0",
  "method": "system_name",
  "params": [],
  "id": 1
}
```

## Response Fields

- `result` (`String, required`): The node implementation name (e.g., "Parity Polkadot", "Substrate Node")

## Successful Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "Parity Polkadot"
}
```

## Error Responses

### Error Response

- Code: `-32603`

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32603,
    "message": "Internal error"
  }
}
```

## Code Examples

cURL
JavaScript
Python
Rust

```bash
curl -X POST https://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "system_name",
    "params": [],
    "id": 1
  }'
```

```javascript
// Using @polkadot/api
import { ApiPromise, WsProvider } from '@polkadot/api';

const provider = new WsProvider('wss://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });

const name = await api.rpc.system.name();
console.log('Moonbase node implementation:', name.toString());

await api.disconnect();

// Using fetch (HTTP JSON-RPC)
const response = await fetch('https://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'system_name',
    params: [],
    id: 1
  })
});

const { result } = await response.json();
console.log('Moonbase node implementation:', result);
```

```python
import requests

def get_node_name():
    response = requests.post(
        'https://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY',
        json={
            'jsonrpc': '2.0',
            'method': 'system_name',
            'params': [],
            'id': 1
        }
    )
    return response.json()['result']

name = get_node_name()
print(f'Moonbase node implementation: {name}')

# Using substrate-interface
from substrateinterface import SubstrateInterface

substrate = SubstrateInterface(url='wss://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY')
name = substrate.rpc_request('system_name', [])['result']
print(f'Moonbase node implementation: {name}')
```

```rust
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let response = client
        .post("https://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "system_name",
            "params": [],
            "id": 1
        }))
        .send()
        .await?;

    let result: serde_json::Value = response.json().await?;
    println!("Moonbase node implementation: {}", result["result"]);
    Ok(())
}
```

## Common Use Cases

### 1. Full Node Identity Report

Gather complete node identity details in a single call:

```javascript
import { ApiPromise, WsProvider } from '@polkadot/api';

async function getNodeIdentity(endpoint) {
  const provider = new WsProvider(endpoint);
  const api = await ApiPromise.create({ provider });

  const [name, version, chain] = await Promise.all([
    api.rpc.system.name(),
    api.rpc.system.version(),
    api.rpc.system.chain()
  ]);

  const identity = {
    implementation: name.toString(),
    version: version.toString(),
    chain: chain.toString(),
    endpoint
  };

  await api.disconnect();
  return identity;
}

// Example output:
// { implementation: "Parity Polkadot", version: "0.9.43-ba6af17", chain: "Polkadot", endpoint: "..." }
```

### 2. Infrastructure Audit Across Nodes

Audit client implementations across a fleet of Moonbase nodes:

```javascript
async function auditFleetClients(endpoints) {
  const results = await Promise.all(
    endpoints.map(async (endpoint) => {
      try {
        const provider = new WsProvider(endpoint);
        const api = await ApiPromise.create({ provider });
        const name = await api.rpc.system.name();
        const version = await api.rpc.system.version();
        await api.disconnect();
        return { endpoint, client: name.toString(), version: version.toString(), status: 'ok' };
      } catch (error) {
        return { endpoint, client: null, version: null, status: 'unreachable' };
      }
    })
  );

  // Group by client implementation
  const byClient = {};
  for (const node of results) {
    if (node.client) {
      byClient[node.client] = byClient[node.client] || [];
      byClient[node.client].push(node);
    }
  }

  console.log('Client distribution:', Object.keys(byClient).map(
    (k) => `${k}: ${byClient[k].length} nodes`
  ));

  return results;
}
```

### 3. Connection Health Check with Client Info

Include client implementation in health-check responses:

```javascript
async function healthCheckWithClientInfo(api) {
  try {
    const name = await api.rpc.system.name();
    const version = await api.rpc.system.version();
    const chain = await api.rpc.system.chain();

    return {
      healthy: true,
      client: `${name.toString()} v${version.toString()}`,
      chain: chain.toString(),
      checkedAt: new Date().toISOString()
    };
  } catch (error) {
    return {
      healthy: false,
      error: error.message,
      checkedAt: new Date().toISOString()
    };
  }
}
```

## Related Methods

- [`system_version`](https://www.dwellir.com/docs/moonbase-alpha/system_version) -- Get the node implementation version
- [`system_chain`](https://www.dwellir.com/docs/moonbase-alpha/system_chain) -- Get the chain name
- [`system_properties`](https://www.dwellir.com/docs/moonbase-alpha/system_properties) -- Get chain properties (token symbol, decimals, SS58 format)
- [`state_getRuntimeVersion`](https://www.dwellir.com/docs/moonbase-alpha/state_getRuntimeVersion) -- Get the on-chain runtime version
- [`rpc_methods`](https://www.dwellir.com/docs/moonbase-alpha/rpc_methods) -- List all available RPC methods
