The Java SDK of the Ant Blockchain contract platform provides a variety of services, such as account services, contract services, event services, query services, and local services. You can use this SDK to call synchronous or asynchronous operations to send transactions, query transactions, or subscribe to events. This SDK allows you to query receipts after transactions are sent. This way, you can check transaction results.
The .jar package of the Java SDK depends on Netty packages, and different Netty packages are configured in the Maven file for different operating systems.
|Version||Supported blockchain||Improved feature||How to obtain|
|0.10.2.6||Supports standard contract blockchains.||Supports all client features of the contract platform.||See download instructions.|
If you are using the test blockchain, download the SDK from the overview page in the BaaS console.
In other cases, download the SDK from the management page in the BaaS console.
Netty packages provided in the following table are all included in the Java SDK. You need to download the Java SDK from the management page in the BaaS console.
|netty-tcnative-openssl-static-2.0.17-Final-mychain-linux-x86_64.jar||The runtime library on which the SDK depends under Linux operating systems.||Click here to download the dependency of the SDK|
|netty-tcnative-openssl-static-2.0.17-Final-mychain-windows-x86_64.jar||The runtime library on which the SDK depends under Windows operating systems.||Click here to download the dependency of the SDK|
|netty-tcnative-openssl-static-2.0.17-Final-mychain-osx-x86_64.jar||The runtime library on which the SDK depends under macOS operating systems.||Click here to download the dependency of the SDK|
- For Java development kit (JDK) 7 or later, you can run
java -versionon the system terminal to check the current Java version.
- For Maven 3.5.4 or later, you can run
mvn -von the system terminal to check the current Maven version.
- Install the downloaded .jar package in a local repository.
- Go to the root directory of the downloaded file from the terminal, and run the following commands:
//Install the SDK in the local repository.
mvn install:install-file -Dfile=mychainx-sdk-0.10.2.6.jar -DgroupId=com.alipay.mychainx -DartifactId=mychainx-sdk -Dversion=0.10.2.6 -Dpackaging=jar
//Install the Netty package in the local repository. Note: Select the required Netty package, and set the classifier to osx-x86_64 for macOS, linux-x86_64 for Linux, or windows-x86_64 for Windows.
mvn install:install-file -Dfile=netty-tcnative-openssl-static-2.0.17-Final-mychain-osx-x86_64.jar -DgroupId=io.netty -DartifactId=netty-tcnative-openssl-static -Dversion=2.0.17-Final-mychain -Dpackaging=jar -Dclassifier=osx-x86_64
<!--Use the latest SDK -->