SCENARIO:
I have the following code:
final String hostUrl = this.deployerProperties.getProperty("quorum.host.url");
final String hostPort = this.deployerProperties.getProperty("quorum.host.port");
final String host = hostUrl + ":" + hostPort;
final HttpService httpService = new HttpService(host);
this.admin = Admin.build(httpService);
this.quorum = Quorum.build(httpService);
final EthAccounts ethAccounts = this.quorum.ethAccounts().send();
final String ethFirstAccount = ethAccounts.getAccounts().get(0);
final PersonalUnlockAccount personalUnlockAccount = this.admin.personalUnlockAccount(ethFirstAccount, "").send();
if (!personalUnlockAccount.accountUnlocked()) {
throw new IllegalStateException("Account " + ethFirstAccount + " can not be unlocked!");
}
final List<String> privateFor = new ArrayList<>();
final ClientTransactionManager clientTransactionManager = new ClientTransactionManager(this.quorum, ethFirstAccount, ethFirstAccount, privateFor);
final ContractGasProvider contractGasProvider = new DefaultGasProvider();
//final ContractGasProvider contractGasProvider = new DeployGasProvider();
final Tokens tokens = Tokens.deploy(this.quorum, clientTransactionManager, contractGasProvider).send();
When I execute the code. I get the following error:
Caused by: java.lang.RuntimeException: Error processing transaction request: Non-200 status code: &{Status:400 Bad Request StatusCode:400 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Type:[text/plain] Content-Length:[96] Connection:[keep-alive]] Body:0xc423004080 ContentLength:96 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc4200ea500 TLS:}
The line that make the Token deploy breaks the execution. Googleing I found similar issue in this site: LINK So I decided to create my own GasProvider.
import org.web3j.tx.gas.StaticGasProvider;
import java.math.BigInteger;
import org.web3j.tx.ManagedTransaction;
@SuppressWarnings("deprecation")
public class DeployGasProvider extends StaticGasProvider{
public static final BigInteger GAS_LIMIT = BigInteger.valueOf(22_000_000_000L);
public static final BigInteger GAS_PRICE = ManagedTransaction.GAS_PRICE;
public DeployGasProvider() {
super(GAS_PRICE, GAS_LIMIT);
}
}
But the error persists. The environment is the following:
- Web3jQuorum v4.0.6
- Quorum v2.2.21
- Solcjs v0.4.24
I try fixing with this post answer. But still returning the same