SteemJ Dev Diary #8 (13.01.2018)

in #utopian-io7 years ago (edited)

The previous Dev Diary motivated me a lot and resulted in a pretty productive week - So let's keep going =).


SteemJV2Logo


Latest SteemJ 0.4.x releases: 0.4.3 v0.4.2 v0.4.2pr1 v0.4.1 v0.4.0

SteemJ Dev Diary #8 (13.01.2018)


Hello Steemians!

So the previous Dev Diary was a really great week for me and a lot of changes have been implemented already, so as I decided to keep you guys informed and share everything related to the SteemJ development.

I basically spend most of the time today to check and understand how the 'Asset' object will work in the future - Again, I am not sure if this will already be part of HF 0.20 or HF 0.21, but as said, it will not hurt us if its already implemented :)

While having a look at the 'Asset' and 'Price' object I've refactored the 'Price' object and its JavaDoc and verified that the tests of both objects are still working.

Beside that I have removed some remaining todos on the 'DatabaseAPI'.

Bug Fixes

What was the issue?

  1. The Price object was not validated correctly - It was possible to create an invalid price object.
  2. Some '_args' object of the 'DatabaseAPI' were not fully implemented.

What was the solution?

  1. The problem has been solved by adding an external 'validation()' method that is called whenever a field of the 'Price' object is set. This method throws an 'InvalidParameterException' if the parameters are not valid.
  2. The missing objects have been implemented.

Full list of commits:

(A prove that the commits have been made by me can be found here)

A list of all commits made after the last release can be found here: https://github.com/marvin-we/steem-java-api-wrapper/compare/v0.4.3...master

General information

What is SteemJ?

SteemJ is a project that allows you to communicate with a Steem node using Java. So far, the project supports most of the API calls and is also able to broadcast most of the common operation types. Further information can be found on GitHub.

https://github.com/marvin-we/steem-java-api-wrapper

Quick Start Guide

Add SteemJ to your project

SteemJ binaries are pushed into the maven central repository and can be integrated with a bunch of build management tools like Maven. The Wiki provides a lot of examples for the most common build tools. If you do not use a build management tool you can download the binaries as described here.

To add this release to your project paste the following snippet into your 'pom.xml'

<dependency>
    <groupId>eu.bittrade.libs</groupId>
    <artifactId>steemj-core</artifactId>
    <version>0.4.3</version>
</dependency>

Start posting

SteemJConfig myConfig = SteemJConfig.getInstance();

myConfig.setDefaultAccount(new AccountName("YOUR-ACCOUNT"));

List<ImmutablePair<PrivateKeyType, String>> privateKeys = new ArrayList<>();
privateKeys.add(new ImmutablePair<>(PrivateKeyType.POSTING, "YOUR-PRIVATE-POSTING-KEY"));

myConfig.getPrivateKeyStorage().addAccount(myConfig.getDefaultAccount(), privateKeys);

steemJ.createComment(new AccountName("steemj"), new Permlink("testofsteemj040"), "Example comment without no link but with a @user .", new String[] { "test" });

Further information

The sample module of the SteemJ project provides showcases for the most common acitivies and operations users want to perform.

Beside that you can find a lot of snippets and examples in the different Wiki sections.

Contribute

The project became quite big and there is still a lot to do. If you want to support the project simply clone the git repository and submit a pull request. I would really appreciate it =).

git clone https://github.com/marvin-we/steem-java-api-wrapper.git

Get in touch!

Most of my projects are pretty time consuming and I always try to provide some useful stuff to the community. What keeps me going for that is your feedback and your support. For that reason I would love to get some Feedback from you <3. Just contact me here on Steemit or ping me on GitHub.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hi, I'd like to contribute. any task you want me to work on?

Hay @eastmael and thank you for the offer <3

Hm, the master branch is quite messi at the moment as I am still not able to test stuff. As you may have read, I try to restructure Steem to work with the refactored api (Appbase API). Sadly, Jussi, the proxy Steem is running infront of their nodes, does not accept those calls yet (see https://github.com/steemit/jussi/pull/78 ) so I guess it makes more sense to wait until things can be tested again.

But there is one really old task that already cost me a lot of nerves which can already be done by using SteemJ 0.4.3: https://github.com/marvin-we/steem-java-api-wrapper/issues/83

This task is about documenting how the "DiscussionQuery" object is working. (More information can also be found in this post: https://steemit.com/steemdev/@steemj/help-wanted-help-to-improve-steemj-and-earn-a-reward )

I, and a lot of users :P, would like to know which parameters have which effect on which 'sort_by' filter.

If you are interested in, you could either commit JavaDoc that explains everything or publish a post in the documentation category of Utopian where you describe the behavior. I would then use your post to update the SteemJ wiki.

For more technical tasks I guess I will come back to your offer when things can be tested again :)

Thank you once again and best regards!

Thank you. Will return to this for reference.

@dez1337 Such a great articleThis is my quest to follow the whales.. No matter how hopeless

Thanks! :)

Your contribution cannot be approved because it does not follow the Utopian Rules.

  • Except for your first commit, all other commits listed in the posts are not meaningful as they contain only one line changes or just adding comments to the code.
  • In the first commit your most code contrbution is just fixing a typo. Rest part is adding comments and including getter functions.

Sorry but this cannot be considered as a Development contribution.

You can contact us on Discord.
[utopian-moderator]

As discussed via Discord - There is not much more to do for an API wrapper than creating Steem objects in Java, but I am fine with your decission.

Thanks for the fast review and have a nice day! :)