简体   繁体   中英

Web3j Solidity Generate Command Not Working

I believe I have everything set up correctly as other Web3j and solc commands have been working fine. However, Following the instructions here: https://docs.web3j.io/smart_contracts.html#deploying-and-interacting-with-smart-contracts to create the autogenerated java wrapper has not been working, when I run the last command it shows me the syntax instead of creating the java code. I ommitted the web3j picture text.

>$ ls
>registrar  registrar.sol

>$ solc registrar.sol --bin --abi --optimize -o ./registrar/

>$ ls registrar  
Registrar_Contract.abi  Registrar_Contract.bin

>$ web3j solidity generate ./registrar/Registrar_Contract.bin ./registrar/Registrar_Contract.abi -o ./

and I get this response instead of it generating file:

solidity generate <input binary file>.bin <input abi file>.abi [-p|--package  <base package name>] -o|--output <destination base directory>

I have tested this a decent amount and have not had any success. Any help would be greatly appreciated.

PS I am on Mac OS Sierra and used homebrew to install everything, the only command that didn't work during installation was "brew linkapps solidity" from http://solidity.readthedocs.io/en/develop/installing-solidity.html#binary-packages but I continued because solidity commands were working anyways.

您缺少参数,请尝试以下命令:

web3j solidity generate /registrar/Registrar_Contract.bin ./registrar/Registrar_Contract.abi -o /path/to/yourSrc/main/java -p your.application.id

使用以下命令进行修复

web3j solidity generate -b Practice.bin  -a Practice.abi -o D:\Solidity\sample-project-gradle-master\src\main\java  -p org.web3j.sample

使用以下命令:-

web3j generate solidity -a ./registrar/Registrar_Contract.abi -b ./registrar/Registrar_Contract.bin -o /path/to/yourSrc/main/java -p package.name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM