add comment
This commit is contained in:
parent
212cf65521
commit
911b6b1354
|
@ -20,12 +20,14 @@ import java.math.BigInteger;
|
|||
public class AccessBlockchain {
|
||||
private static final String node2 = "http://93.30.148.59:1402";
|
||||
private static final String node1 = "http://93.30.148.59:1401";
|
||||
private static String address_test = "0x5421c79d465a288c28e10aa43f9b7dff1b313c8e";
|
||||
//private static String address_test = "0x5421c79d465a288c28e10aa43f9b7dff1b313c8e";
|
||||
//Web3j web3jNode2 = Web3jFactory.build(new HttpService(node2));
|
||||
|
||||
public static void main(String [ ] args)
|
||||
{
|
||||
try{
|
||||
//USED FOR TEST
|
||||
|
||||
/*
|
||||
Web3j web3jNode1 = Web3jFactory.build(new HttpService(node1));
|
||||
System.out.println(web3jNode1.ethCoinbase().sendAsync().get().getResult());
|
||||
|
@ -50,10 +52,10 @@ public class AccessBlockchain {
|
|||
//System.out.println("wei is : "+wei);
|
||||
|
||||
//System.out.println("*************************************************");
|
||||
Web3j web3jNode1 = Web3jFactory.build(new HttpService(node1));
|
||||
Web3j web3jNode2 = Web3jFactory.build(new HttpService(node2));
|
||||
System.out.println("ethAccounts : "+web3jNode1.ethAccounts().send().getAccounts());
|
||||
System.out.println("ethAccounts : "+web3jNode2.ethAccounts().send().getAccounts());
|
||||
//Web3j web3jNode1 = Web3jFactory.build(new HttpService(node1));
|
||||
//Web3j web3jNode2 = Web3jFactory.build(new HttpService(node2));
|
||||
//System.out.println("ethAccounts : "+web3jNode1.ethAccounts().send().getAccounts());
|
||||
//System.out.println("ethAccounts : "+web3jNode2.ethAccounts().send().getAccounts());
|
||||
//System.out.println("ethGasPrice : "+web3jNode2.ethGasPrice().send().getGasPrice());
|
||||
//System.out.println("ethGetWork : "+web3jNode2.ethGetWork().send().getResult());
|
||||
//System.out.println("ethBlockNumber : "+web3jNode2.ethBlockNumber().send().getResult());
|
||||
|
@ -67,6 +69,7 @@ public class AccessBlockchain {
|
|||
}
|
||||
|
||||
|
||||
//Get Balance function
|
||||
public BigInteger getTheBalanceOfWallet(String walletAddress){
|
||||
Web3j web3jNode1 = Web3jFactory.build(new HttpService(node1));
|
||||
try{
|
||||
|
@ -80,6 +83,7 @@ public class AccessBlockchain {
|
|||
return null;
|
||||
}
|
||||
|
||||
//Send transaction demo function
|
||||
public boolean sendTransationTo(String addressSource, String addressDestination, BigInteger amountToSend){
|
||||
Web3j web3jNode1 = Web3jFactory.build(new HttpService(node1));
|
||||
try{
|
||||
|
|
Loading…
Reference in a new issue