# net

`net` namespace는 Klaytn 네트워크와 관련된 함수들을 제공합니다.

## net\_networkID <a href="#net_networkid" id="net_networkid"></a>

네트워크 식별자(네트워크 ID)를 반환합니다.

**Parameters**

None

**Return Value**

| Type     | Description                                                                                                                                      |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| QUANTITY | <p>The integer of the network identifier.<br>- <code>"1001"</code>: Klaytn Baobab testnet.<br>- <code>"8217"</code>: Klaytn Cypress mainnet.</p> |

**Example**

```shell
// Request
curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_networkID","params":[],"id":67}' https://public-en-baobab.klaytn.net

// Result
{
    "jsonrpc":"2.0",
    "id":67,
    "result":"1001"
}
```

## net\_listening <a href="#net_listening" id="net_listening"></a>

클라이언트가 네트워크 연결을 수신하고 있으면 `true`를 반환합니다.

**Parameters**

None

**Return Value**

| Type    | Description                                             |
| ------- | ------------------------------------------------------- |
| Boolean | 클라이언트가 연결을 수신 중이면 `true`를 반환하고, 그렇지 않으면 `false`를 반환합니다. |

**Example**

```shell
// Request
curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":67}' https://public-en-baobab.klaytn.net

// Result
{
    "id":67,
    "jsonrpc":"2.0",
    "result":true
}
```

## net\_peerCount <a href="#net_peercount" id="net_peercount"></a>

현재 클라이언트에 연결된 피어의 수를 반환합니다.

**Parameters**

None

**Return Value**

| Type     | Description        |
| -------- | ------------------ |
| QUANTITY | 연결된 피어의 수의 정숫값입니다. |

**Example**

```shell
// Request
curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":74}' https://public-en-baobab.klaytn.net

// Result
{
    "id":74,
    "jsonrpc": "2.0",
    "result": "0x3" // 2
}
```

## net\_peerCountByType <a href="#net_peercountbytype" id="net_peercountbytype"></a>

유형별 연결된 노드의 수와 연결된 모든 노드 수를 키-밸류 쌍의 형태로 반환합니다.

**Parameters**

None

**Return Value**

| Type        | Description                         |
| ----------- | ----------------------------------- |
| JSON string | 유형별 연결된 피어의 수와 연결된 모든 피어의 수를 반환합니다. |

**Example**

```shell
// Request
curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_peerCountByType","params":[],"id":74}' https://public-en-baobab.klaytn.net

// Result
{
    "id":74,
    "jsonrpc": "2.0",
    "result": {"en":3,"pn":2,"total":5}
}
```

## net\_version <a href="#net_version" id="net_version"></a>

현재 Klaytn 프로토콜 버전을 반환합니다.

**Parameters**

None

**Return Value**

| Type     | Description                                                                                                                                           |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| QUANTITY | <p>The integer of the klaytn protocol version.<br>- <code>"1001"</code>: Klaytn Baobab testnet.<br>- <code>"8217"</code>: Klaytn Cypress mainnet.</p> |

**Example**

```shell
// Request
curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}' https://public-en-baobab.klaytn.net
// Result
{
    "jsonrpc":"2.0",
    "id":67,
    "result":"1001"
}
```
