| | |
| | | |
| | | public class EthService { |
| | | |
| | | private static String ethWalletPath = "/home/javaweb/webresource/eth"; |
| | | // private static String ethWalletPath="E://"; |
| | | private static String ethWalletPath = "/home/javaweb/webresource/rabbit"; |
| | | // private static String ethWalletPath="E://"; |
| | | private Web3j web3j; |
| | | // private Admin admin; |
| | | // private Parity parity; |
| | |
| | | return wallet; |
| | | } |
| | | |
| | | |
| | | public boolean checkTransferResult(String hash) { |
| | | // 0xa3e6a0ccc3aac30d866a86ca9c0477dd58b7b061787ba40b16c3844803273816 交易hash |
| | | Request<?, EthGetTransactionReceipt> ethGetTransactionReceiptRequest = web3j.ethGetTransactionReceipt(hash); |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) throws IOException { |
| | | HttpService service = new HttpService(ETH_UTL); |
| | | Web3j build = Web3j.build(service); |
| | | //Request<?, EthTransaction> ethTransactionRequest = build.ethGetTransactionByHash("0xa3e6a0ccc3aac30d866a86ca9c0477dd58b7b061787ba40b16c3844803273816"); |
| | | Request<?, EthGetTransactionReceipt> ethGetTransactionReceiptRequest = build.ethGetTransactionReceipt("0xa3e6a0ccc3aac30d866a86ca9c0477dd58b7b061787ba40b16c3844803273816"); |
| | | EthGetTransactionReceipt send = ethGetTransactionReceiptRequest.send(); |
| | | String status = send.getResult().getStatus(); |
| | | System.out.println(status);//0x1 |
| | | // HttpService service = new HttpService(ETH_UTL); |
| | | // Web3j build = Web3j.build(service); |
| | | // //Request<?, EthTransaction> ethTransactionRequest = build.ethGetTransactionByHash("0xa3e6a0ccc3aac30d866a86ca9c0477dd58b7b061787ba40b16c3844803273816"); |
| | | // Request<?, EthGetTransactionReceipt> ethGetTransactionReceiptRequest = build.ethGetTransactionReceipt("0xa3e6a0ccc3aac30d866a86ca9c0477dd58b7b061787ba40b16c3844803273816"); |
| | | // EthGetTransactionReceipt send = ethGetTransactionReceiptRequest.send(); |
| | | // String status = send.getResult().getStatus(); |
| | | // System.out.println(status);//0x1 |
| | | // EthTransaction send = ethTransactionRequest.send(); |
| | | // String input = send.getResult().getInput(); |
| | | // System.out.println(input); |
| | | |
| | | |
| | | Map<String, String> eth = createEth(); |
| | | System.out.println(eth); |
| | | } |
| | | |
| | | /** |