知乎專欄 | 多維度架構 | | | 微信號 netkiller-ebook | | | QQ群:128659835 請註明“讀者” |
DefaultBlockParameterName.LATEST 當前塊地址 DefaultBlockParameterName.PENDING 處理中塊地址
獲取預設GAS Transaction.DEFAULT_GAS
]package cn.netkiller.wallet.ethereum; import org.web3j.protocol.core.methods.request.Transaction; public class Test { public Test() { // TODO Auto-generated constructor stub } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(Transaction.DEFAULT_GAS); } }
已經廢棄
BigInteger gasLimit = Contract.GAS_LIMIT; BigInteger gasPrice = Contract.GAS_PRICE;
推薦使用
BigInteger gasPrice = BigInteger.ZERO; BigInteger gasLimit = BigInteger.ZERO; gasPrice = DefaultGasProvider.GAS_PRICE; gasLimit = DefaultGasProvider.GAS_LIMIT; System.out.println("gasPrice: " + gasPrice.toString()); System.out.println("gasLimit: " + gasLimit.toString());