BlockchainOperation

Blockchain과 Node에 관계되어 있는 연산을 제공합니다.

Get Chain Id Hash

현재 연결되어 있는 node의 chain id hash를 조회합니다.

ChainIdHash chainIdHash = client.getBlockchainOperation().getChainIdHash();
System.out.println("Chain id hash: " + chainIdHash);

Get Blockchain Status

현재 연결되어 있는 node의 blockchain 상태를 조회합니다.

BlockchainStatus blockchainStatus = client.getBlockchainOperation().getBlockchainStatus();
System.out.println("Blockchain status: " + blockchainStatus);

Get Chain Info

현재 연결되어 있는 node의 chain 정보를 조회합니다.

ChainInfo chainInfo = client.getBlockchainOperation().getChainInfo();
System.out.println("Chain info: " + chainInfo);

Get Chain Stats

현재 연결되어 있는 node의 chain 상태를 조회합니다.

ChainStats chainStats = client.getBlockchainOperation().getChainStats();
System.out.println("Chain stats: " + chainStats);

List Peers

현재 연결되어 있는 node의 peer정보를 조회합니다.

자기 자신과 hidden peer를 제외하고 조회합니다.

List<Peer> peers = client.getBlockchainOperation().listPeers(false, false);
System.out.println("Peers: " + peers);

자기 자신과 hidden peer를 제외하지 않고 조회합니다.

List<Peer> peers = client.getBlockchainOperation().listPeers(true, true);
System.out.println("Peers: " + peers);

List Peers Metrics

현재 연결되어 있는 node의 peer 상태를 조회합니다.

List<PeerMetric> peerMetrics = client.getBlockchainOperation().listPeerMetrics();
System.out.println("PeerMetrics: " + peerMetrics);

Get Server Info

현재 연결되어 있는 node의 서버 정보를 조회합니다. Category는 아직 구현되어 있지 않습니다.

List<String> categories = emptyList();
ServerInfo serverInfo = client.getBlockchainOperation().getServerInfo(categories);
System.out.println("Server info: " + serverInfo);

Get Node Status

현재 연결되어 있는 node자체의 상태를 조회합니다.

NodeStatus nodeStatus = client.getBlockchainOperation().getNodeStatus();
System.out.println("Node status: " + nodeStatus);