Last updated: 04.07.2023
Submited by: Michel Meier, [email protected]
Team: Michel Meier, Marco Walz
Approved Budget (in h):
Used Budget (in h):
Open Source Development
aepp-sdk-java & contraect-maven-plugin - integration of calldata lib, SDK update and further development and optimizations
The Java SDK is actively used by service providers like Venly and Ammercard and opens aeternity development support to a broader audience.
The proposal aims to bring the SDK to the current state and solve existing issues and open topics. Furthermore there will be refactoring between SDK and Plugin to leverage synergies (mapping of Sophia Types in Java) and to overall optimize SDK utilization within the plugin.
The most important aspect will be the integration of the calldata lib into the SDK which will omit the necessity to call the compiler and will result in a faster and more robust SDK and plugin.
The release addresses updates of dependencies and issues fixes due to security issues and possible vulnerabilities, optimizations, refactorings and the inclusion of the calldata lib as we as additional functionalities.
The aepp-sdk-java is a standalone Java library, which empowers Java, Kotlin and Scala developers to easily interact synchronously and asynchronously with the aeternity blockchain. The SDK realizes a generic approach to provide support for every kind of transaction type based on strongly typed models. A developer just needs to create a model for a certain transaction type and the mapping, byte transformation and interaction is executed transparently.
The contraect-maven-plugin comes as handy maven plugin which generates a Java class out of a Sophia Smart contract by leveraging the services provided by the SDK. Every generated class contains methods to easily and typesafe interact with the contract (deploy, call function endpoints).
Currently the aepp-sdk-java is released in version 3.0.1, the contraect-maven-plugin in version 2.0.0. At the moment, there is a lot of interaction with the compiler necessary to realize the communication with contracts, which results in reduced contract interaction performance in both SDK and plugin generated classes.
There is a lack of sufficient and in detail documentation and high quality samples wired together. Additionally, there is a strong need to update project dependencies and catch up the latest changes of aeternity.
Integrate calldata lib
- Update and enhance affected tests within the SDK and Plugin
- Update the Plugin according to the changes done when interacting with the compiler
This milestone will focus on maintenance and refactoring existing known topics
- Library and dependency updates, especially security vulnerabilities
- Implement known refactoring topics
- Rename DEFAULT_TESTNET_COMPILER_URL in BaseConstants · Issue #226 · kryptokrauts/aepp-sdk-java · GitHub
- switch to JUnit 5 for tests · Issue #147 · kryptokrauts/aepp-sdk-java · GitHub
- refactor contract calls: convenience methods in SDK and SophiaTypes in SDK · Issue #64 · kryptokrauts/contraect-maven-plugin · GitHub
- Integration of Sophia-Types from the contraect-maven-plugin into the SDK to make chain interaction within the SDK more typesafe and update Plugin according to the changes done.
- Decoding responses back into the model classes (#48)
- Update and enhance affected tests within the SDK and Plugin
This milestone will focus implementing enhancements and new features
- convenience methods for other tx-types · Issue #216 · kryptokrauts/aepp-sdk-java · GitHub
- convenience method for multiple dry-runs · Issue #208 · kryptokrauts/aepp-sdk-java · GitHub
- improve contract related tests · Issue #204 · kryptokrauts/aepp-sdk-java · GitHub
- switch to devmode for integration tests · Issue #189 · kryptokrauts/aepp-sdk-java · GitHub
- decode oracle query and response · Issue #170 · kryptokrauts/aepp-sdk-java · GitHub
- further dry-run improvements: txEvents & top · Issue #167 · kryptokrauts/aepp-sdk-java · GitHub
- Include new middleware based on OpenAPI generated client
- If necessary, update and enhance affected tests within the SDK and Plugin
Documentation and Showcases
This milestone will focus on updating the documentation and the showcases which demo the use of SDK and Plugin features as template for developers.
- Update the documentation of SDK and plugin
- Update existing showcases and demo projects to the new version of SDK and plugin
- GitHub - kryptokrauts/contraect-showcase-maven: a demonstration how to use the contraect-maven-plugin to generate java classes for smart contract interactions on the æternity blockchain.
- GitHub - kryptokrauts/aepp-showcase-android
- GitHub - kryptokrauts/aens-name-claimer: a showcase how to claim and update ÆNS names using the aepp-sdk-java powered by kryptokrauts.com!
Bugfixes and open topics
This milestone handles to following bugfixes and open issues
It is planned to ship the release after all (implementation) tasks are finished. A release after each task can be discussed.
Similar to other proposals, i will be working on the SDK development based on my availability (currently 5 days a week possible), probably over the next 3-4 months.
Rough estimation (in working hours) of the tasks to be implemented:
- Integrate calldata lib: ~100-160
- Refactoring: ~80-120
- Enhancements: ~60-100
- Update documentation and showcases: ~30-60
- Bugfixes and open topics: ~30-40
- Providing state channel support for node interaction using websockets. Accompanied with a demo project it will be shown, how a java backend using the SDK can be leveraged to use the existing state channel demo
- Provide chain-event subscription and demo project which showcases listening on chain and contract events.
- Further improvements in form of eliminating the duplicated model classes are possible to remove complexity and improve maintainability, whereas this step has to be analyzed further on potential side effects.
- Preparation for the upcoming Ceres hardfork
Research and development will be published free of any proprietary license (open-source, open-access)
- I confirm that my research and code will be maintained with bug fixing free of charge for one year after publishing it. I cannot guarantee an ETA for providing bugfixes, since it dependes on my availability, but i will ship them asap.