caver.klay.net
Klaytn API 중 'net' namespace에 해당하는 자바스크립트 래퍼.
The caver-klay-net
package allows you to interact with the Klaytn nodes' network properties.
getId
현재 네트워크 ID를 가져옵니다.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | (optional) Optional callback, returns an error object as the first parameter and the result as the second. |
Return Value
프로미스
는 Number
를 반환합니다 - 네트워크 ID.
Example
isListening
노드가 피어를 수신하고 있는지 확인합니다.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | (optional) Optional callback, returns an error object as the first parameter and the result as the second. |
Return Value
Promise
returns Boolean
- true
if the node is listening for peers, false
otherwise.
Example
getPeerCount
연결된 피어 수를 구합니다.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | (optional) Optional callback, returns an error object as the first parameter and the result as the second. |
Return Value
프로미스
는 Number
를 반환합니다 - 연결된 피어의 수입니다.
Example
peerCountByType
Returns the number of connected nodes by type and the total number of connected nodes with key/value pairs.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | (optional) Optional callback, returns an error object as the first parameter and the result as the second. |
Return Value
프로미스
는 Object
를 반환합니다 - 타입에 따른 연결된 피어의 수뿐만 아니라 연결된 모든 피어의 수.
Example
Last updated