Я следую этому руководству для развертывания контракта https://www.youtube.com/watch?v=ibAh04Csp0M&index=33&list=PL16WqdAj66SCOdL6XIFbke-XQg2GW_Avg
, но я получаю
[RuntimeException: java.lang.NoSuchMethodException: smartcontract.Counter.<init>(java.lang.String, org.web3j.protocol.Web3j, org.web3j.crypto.Credentials, org.web3j.tx.gas.ContractGasProvider)]
на линии
val deploy=Counter.deploy(web3j, credentials, GAS_PRICE, GAS_LIMIT).send()
вот мой код
def getCredentials (): Credentials = {val private_key = "адрес моей основной учетной записи" val credentials = Credentials.create (private_key);учетные данные}
def deployContract(web3j: Web3j,credentials:Credentials/*transactionManager: TransactionManager*/):String ={
val GAS_LIMIT = BigInteger.valueOf(6721975L);
val GAS_PRICE = BigInteger.valueOf(20000000000L);
val deploy = Counter.deploy(web3j, credentials, GAS_PRICE, GAS_LIMIT).send().getContractAddress
deploy
}
def counterContractDemo() = Action {
val web3j = Web3j.build(new HttpService("http://localhost:8080/"))
val deployAddress = deployContract(web3j,getCredentials)
Ok(deployAddress)
}
это часть контрактного Java-кода
Counter.java
public static RemoteCall<Counter> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
return deployRemoteCall(Counter.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
}
public static RemoteCall<Counter> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
return deployRemoteCall(Counter.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
}
public static Counter load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
return new Counter(contractAddress, web3j, credentials, gasPrice, gasLimit);
}
public static Counter load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
return new Counter(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
я запускаю ethereum в приватной сети, пожалуйста, помогите, что мне не хватает