Hot answers tagged


This is my implementation of getting the latest block number. I set up the project using import org.web3j.protocol.Web3j; import org.web3j.protocol.core.methods.response.EthBlockNumber; import org.web3j.protocol.http.HttpService; import java.util.concurrent.ExecutionException; public class App { public ...


If you are trying to generate a Java smart contract wrapper you should use the web3j cli. You can still use truffles contract schema. $ web3j truffle generate [--javaTypes|--solidityTypes] /path/to/<truffle-smart-contract-output>.json -o /path/to/src/main/java -p


The problem was actually not with the Project.load method but with .send() when using Web3j on android you have to use sendAsync().get() to make it work. So the problem is solved.


This line: contract.getCounter().send(); should be contract.getCounter().call({from:yourAccount}); Reason When you request state from Ethereum, it doesn't cost gas because you're just reading a node. If the node is on your computer, you're just reading your hard drive. On the other hand, when you change state, it requires miners to pick up the change ...

Only top voted, non community-wiki answers of a minimum length are eligible