Web3ClientVersion web3ClientVersion = web3j.web3ClientVersion().send();
String clientVersion = web3ClientVersion.getWeb3ClientVersion();
System.out.println("客戶端版本: " + clientVersion);
EthProtocolVersion ethProtocolVersion = web3j.ethProtocolVersion().send();
String protocolVersion = ethProtocolVersion.getProtocolVersion();
System.out.println("協議版本" + protocolVersion);
EthBlockNumber ethBlockNumber = web3j.ethBlockNumber().send();
BigInteger blockNumber = ethBlockNumber.getBlockNumber();
System.out.println("當前區塊:" + blockNumber);
EthSyncing ethSyncing = web3j.ethSyncing().send();
boolean isSyncing = ethSyncing.isSyncing();
System.out.println("同步狀態:" + isSyncing);
EthMining ethMining = web3j.ethMining().send();
boolean isMining = ethMining.isMining();
System.out.println("挖礦狀態:" + isMining);
EthCoinbase ethCoinbase = web3j.ethCoinbase().send();
String coinbase = ethCoinbase.getAddress();
System.out.println("礦工賬號:" + coinbase);
EthHashrate ethHashrate = web3j.ethHashrate().send();
BigInteger hashRate = ethHashrate.getHashrate();
System.out.println("挖礦速度:" + hashRate);
EthGasPrice ethGasPrice = web3j.ethGasPrice().send();
BigInteger gasPrice = ethGasPrice.getGasPrice();
System.out.println("Gas 價格:" + gasPrice);
EthEstimateGas ethEstimateGas = web3.ethEstimateGas(Transaction.createEthCallTransaction(credentials.getAddress(), null, encodedFunction)).sendAsync().get();
BigInteger estimateGas = ethEstimateGas.getAmountUsed();
System.out.println(estimateGas);
ethEstimateGas.getAmountUsed().divide(BigInteger.valueOf(100));
NetPeerCount netPeerCount = web3j.netPeerCount().send();
BigInteger peerCount = netPeerCount.getQuantity();
System.out.println("節點數量:" + peerCount);