### Install Web3j CLI on Windows Source: https://github.com/lfdt-web3j/web3j/blob/main/README.md Use this PowerShell command to install the Web3j command line interface on Windows. ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/hyperledger/web3j-installer/main/installer.ps1')) ``` -------------------------------- ### Install Web3j CLI on Unix Source: https://github.com/lfdt-web3j/web3j/blob/main/README.md Use this command to install the Web3j command line interface on Unix-based systems. ```shell curl -L get.web3j.io | sh && source ~/.web3j/source.sh ``` -------------------------------- ### Create a New Web3j Project Source: https://github.com/lfdt-web3j/web3j/blob/main/README.md Run this command to initialize a new project using the Web3j CLI. ```shell $ web3j new ``` -------------------------------- ### Run Web3j Build Commands Source: https://github.com/lfdt-web3j/web3j/blob/main/README.md Commands for executing builds and managing integration tests via Gradle. ```bash $ ./gradlew check ``` ```bash $ ./gradlew -Pintegration-tests=true :integration-tests:test ``` ```bash $ ./gradlew -Pintegration-tests=false :test ``` -------------------------------- ### Generate Web3j Wrapper Class Source: https://github.com/lfdt-web3j/web3j/blob/main/core/src/main/resources/solidity/readme.txt Generate a Java wrapper class for a Solidity smart contract using the web3j CLI. Specify the ABI file, the base package for the generated class, and the output directory. ```bash web3j generate solidity -a ${fileName}.abi -p org.web3j.ens.contracts.generated -o ../../../../../main/java/ > /dev/null ``` -------------------------------- ### Generate ABI File with Solc Source: https://github.com/lfdt-web3j/web3j/blob/main/core/src/main/resources/solidity/readme.txt Use the solc compiler to generate the binary and ABI files for a Solidity contract. Ensure the contract file is in the specified location and the output directory is set. ```bash solc --bin --abi --optimize --overwrite ${fileName}.sol -o build/ ``` -------------------------------- ### Add Web3j Dependency (Gradle) Source: https://github.com/lfdt-web3j/web3j/blob/main/README.md Use these snippets to include Web3j in your Gradle build file for Java or Android projects. ```groovy implementation ('org.web3j:core:5.0.3') ``` ```groovy implementation ('org.web3j:core:4.12.3-android') ``` -------------------------------- ### Proposal PR Template for Web3j Maintainer Source: https://github.com/lfdt-web3j/web3j/blob/main/MAINTAINERS.md Use this Markdown template when creating a Pull Request to propose a new maintainer for the Web3j project. It includes placeholders for the maintainer's handle, achievements, and a link to their contributions. ```markdown I propose to add [maintainer github handle] as a Web3J project maintainer. [maintainer github handle] contributed with many high quality commits: - [list significant achievements] Here are [their past contributions on Web3J project](https://github.com/hyperledger/web3j/commits?author=[user github handle]). Voting ends two weeks from today. For more information on this process see the Becoming a Maintainer section in the MAINTAINERS.md file. ``` -------------------------------- ### Add Web3j Android Dependency (Maven) Source: https://github.com/lfdt-web3j/web3j/blob/main/README.md Use this XML snippet to include the Web3j Android core library in a Maven project. ```xml org.web3j core 4.12.3-android ``` -------------------------------- ### Add Web3j Dependency to Maven Source: https://github.com/lfdt-web3j/web3j/blob/main/README.md Include this dependency in your pom.xml file to use Web3j in your Java project. ```xml org.web3j core 5.0.3 ``` -------------------------------- ### Keep BouncyCastle Classes Source: https://github.com/lfdt-web3j/web3j/wiki/Android-ProGuard-rules-for-web3j-android Configure ProGuard to keep BouncyCastle classes, especially for specific SPIs and helpers. ```proguard #-keep class org.bouncycastle.** -dontwarn org.bouncycastle.jce.provider.X509LDAPCertStoreSpi -dontwarn org.bouncycastle.x509.util.LDAPStoreHelper ``` -------------------------------- ### Suppress SafeVarargs and SLF4j Warnings Source: https://github.com/lfdt-web3j/web3j/wiki/Android-ProGuard-rules-for-web3j-android Use these rules to avoid warnings related to `java.lang.SafeVarargs` and SLF4j logging framework. ```proguard #-dontwarn java.lang.SafeVarargs -dontwarn org.slf4j.** ``` -------------------------------- ### Ignore Java8 Warnings Source: https://github.com/lfdt-web3j/web3j/wiki/Android-ProGuard-rules-for-web3j-android Use this rule to prevent ProGuard from warning about Java 8 specific utilities. ```proguard -dontwarn java8.util.** ``` -------------------------------- ### Keep Web3j Classes for Jackson Serialization Source: https://github.com/lfdt-web3j/web3j/wiki/Android-ProGuard-rules-for-web3j-android Ensure Web3j classes used with Jackson for reflection-based serialization are kept. ```proguard -keepclassmembers class org.web3j.protocol.** { ; } -keepclassmembers class org.web3j.crypto.* { *; } ``` -------------------------------- ### Ignore JNR Posix Warnings Source: https://github.com/lfdt-web3j/web3j/wiki/Android-ProGuard-rules-for-web3j-android Add this rule to suppress warnings related to the JNR Posix library. ```proguard -dontwarn jnr.posix.** ``` -------------------------------- ### Keep Web3j ABI Types Source: https://github.com/lfdt-web3j/web3j/wiki/Android-ProGuard-rules-for-web3j-android Preserve Web3j types that are used for runtime data extraction from type names, such as integer sizes. ```proguard -keep class * extends org.web3j.abi.TypeReference -keep class * extends org.web3j.abi.datatypes.Type ``` -------------------------------- ### Ignore JFFI Rules Source: https://github.com/lfdt-web3j/web3j/wiki/Android-ProGuard-rules-for-web3j-android This rule is for ignoring warnings related to the JFFI library. ```proguard #-dontwarn com.kenai.** ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.