How to contribute?
Building the SDK
Prerequisites
Docker
Gradle
The SDK heavily makes use of the lombok IDE plugin to hide glue code, especially getters, setters, builders and helper methods and helps to keep the classes clean and focus on the logic. The plugin is needed in your IDE of choice to automatically create the necessary methods in the background
latest version of the SDK (dev branch):
Development environment
The SDK is shipped with multiple preconfigured docker containers to support integration testing and debugging. In order to start them just call docker-compose:
After pulling the images you should see the following instances up and running:
aeternal - local middleware that provides aggregated data and websockets
compiler - local aeternity node to provide the sophia compiler functions
node - local aeternity node to provide the protocol functions
proxy - a nginx httpd to expose the aeternity nodes as well as the goggles app to the running host
The services then can be accessed through the following URLs.
Function
URL
aeternal REST API
http://aeternal.localhost/api
OR
http://localhost:8080/api
node REST API
http://localhost/api
compiler REST API
http://compiler.localhost/api
OR
http://localhost:3080
If the the docker-machine can't be accessed through localhost (e.g. when using docker-toolbox for windows) you can set the host aelocal
in your /etc/hosts
file and point to the IP of your docker-machine. Of course you would need to use aelocal
instead of localhost
to access the services.
By default, the aeternity node starts with debug logging mode which is defined in the docker/aeternity.yaml. In order to access the node logs, use docker-compose to connect into the container using the following script
Generate API clients
In order to develop and test the SDK one need to generate the necessary Java classes for defined in the swagger endpoint definition once (and every time, the swagger definition is updated).
Testing the SDK
The SDK ships with two kinds of tests
unit tests, which run independently of a node and prove basic functions and services
integration tests, which need a running aeternity node and validate posted transactions of all currently supported types
In order to run the integration tests you need to define the URLs to the local aeternity and compiler node. This is done using the following environment variables (example is provided for local environment):
The tests can be run within your IDE of choice by using the following gradle tasks
The task integrationTest
requires the running docker-compose setup.
Contributing to the SDK
All contributions to the SDK must be linked to an issue within the aepp-sdk-java project - either pick one or create a new one if you miss a feature or want to fix / enhance current services.
The next step is to create a feature branch which must be named according to the ticket
Integrationtests should extend the BaseTest class which especially provides some convinent functions for running tests using the underlying vertx framework. Test methods can thus make use of the
method, assertions should be made using the vertx TestContext
After implementing the feature / enhancement / fix and providing an appropriate amount of tests / integration tests format your code using the google formatter pattern (if you don't already use it) by running the following gradle command. Unformated / wrong formatted as well as untested code will be rejected.
Then push your branch and create a pull request. After successful review, the PR will be merged into the dev branch and later into the master branch, from where it will be released.
Last updated