1

I am trying to generate a simple smart contract wrapper using solc and web3j in ubuntu.

I have downloaded the source as defined in https://docs.web3j.io/command_line.html

Release package can be obtained from https://github.com/web3j/web3j/releases/tag/v4.1.0.

I have download the source from https://github.com/web3j/web3j/archive/v4.1.0.zip

After unwrapping the zip package I can't find any bin directory as the document page shows

unzip web3j-<version>.zip
creating: web3j-3.0.0/lib/
inflating: web3j-3.0.0/lib/core-1.0.2-all.jarcreating: web3j-3.0.0/bin/
inflating: web3j-3.0.0/bin/web3j
inflating: web3j-3.0.0/bin/web3j.bat

How to get the bin directory?

3 Answers 3

0

4.1.0 binary package is not attached yet in https://github.com/web3j/web3j/releases

I have to download package for 4.0.1 from https://github.com/web3j/web3j/releases/download/v4.0.1/web3j-4.0.1.tar

0

First of all you need to install web3j, I consider you to use the version 3.5.0 because it's stable and reliable. Then you can generate your contract wrapper. It's very simple

$ web3j truffle generate [--javaTypes|--solidityTypes] /path/to/<truffle-smart-contract-output>.json -o /path/to/src/main/java -p com.your.organisation.name

Now you can just import your new generated package and use it's class. Remember to use web3j 3.5.0 in your gradle/maven project as well.

0
curl -L get.web3j.io | sh && source ~/.web3j/source.sh

Ubuntu 20.04, web3j release from July 2022

web3j --version 

by Web3Labs
Version: 1.4.1
Build timestamp: 2021-02-16 20:28:33.742 UTC

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.