New answers tagged

0

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!


1

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: plugins { id "org.web3j" version "4.8....


1

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 ...


0

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: plugins { id "org.web3j" version "4.8.4" } if you are using ...


2

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 ...


0

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: org.web3j....


1

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: <properties> ... <solidity.version>0.7.4</solidity.version> </properties> So, the plugin will automatically install the right solc ...


1

The syntax has changed. Try commands like this: web3j generate solidity -a PR_sol_ballot.abi -b PR_sol_ballot.bin -o .\Web3App\src\main\java -p com.project.contracts See also: web3j


0

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&...


Top 50 recent answers are included