I have tried your exact same code but on Rinkeby and it worked just fine.
For Ropsten, it is a little bit different since Block gas limit is not fixed and varies a lot.
Similar issues stating this issue:
Gas estimation errored with the following message error upon contract deployment
Gas estimation failed” on Ropsten using MetaMask!
You can use the events methods exposed in the generated java wrappers.
Generate the Java wrappers
There are multiple ways to generate the wrappers like using the web3j-gradle-plugin, web3j-maven-plugin, web3j-cli...
For the web3j-gradle-plugin, you should add the following line to your build.gradle file:
id "org.web3j" version "4.8....
I suspect you have the HTTP service endpoint wrong.
If I check that link, it looks like it refers to a certain transaction.
However, when you create a web3j instance, you should specify a node endpoint. You can get one using the infura API, or you need to set up an Ethereum client (Geth for example) connecting to the Ropsten network and put its address when ...
As another way of doing it. If you have the smart contract, you can actually use the web3j-gradle-plugin to compile the contract on the go and deploy it (without having to copy past manually the generated java wrapper).
To do so, just apply the plugin to your project using:
id "org.web3j" version "4.8.4"
if you are using ...
This is happening because in the latest release of web3j-cli 1.4.1, the commands were rearranged and the solidity wrappers generator command is now under generate subcommand.
Run the following for it to work:
web3j generate solidity -b SimpleBank/SimpleBank.bin -a SimpleBank/SimpleBank.abi -o ~/IdeaProjects/quiknode/src/main/java/ -p com.simplebank
You can ...
The methods listed on the question are related to wallet usage.
However, on the same link, the org.web3j.crypto.Credentials class is also listed as a wrapper to handle raw keys. This latter has a create method with different overloads you can use.
So, if you have a raw private key that you want to use to load credentials, you can use the following:
You can specify solidity version for the web3j-maven-plugin via setting the following property: solidity.version.
In your case, it is already specified as your pom file contains:
So, the plugin will automatically install the right solc ...
Replacing StaticStruct in the code with DynamicStruct can solve this error.At the same time, you need to pay attention to how to pass the encoded bytes parameter.And the web3j version is 4.8.4.In the 5.0.0 version of web3j, the related classes of Struct have been replaced with Tuple.
Web3j web3j = new Web3Helper("wss://kovan.infura.io/ws/v3/xxxx&...