New to Nutbox?

SteemJ Dev Diary #9 (14.01.2018)

23 comments

dez1337
63
7 years agoUtopian4 min read

Appbase API calls and additional utility methods.


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 #9 (14.01.2018)


Hello Steemians!

I am still a little bit blocked by the limited possibility to test the changes made for HF 0.20. While I feel like we are already on a pretty good way to support the new API structure ('Appbase APIs'), we hit a point where I simply would like to test the methods. This would help a lot to improve the JavaDoc and the tests again.

So due to that I started to search for a reason, why the new Appbase API calls are not accepted by the Steem API endpoints like api.steemitstage.com and found the following Jussie Issue #78. It looks like due to this issue it is currently not possible to send Appbase API calls as Jussi can't process them.

Sure, this will not help to test new API calls that will be introduced with HF 0.20, but when this Jussie issue is fixed at least the old api methods should work again.

But hay, there is still a lot of other stuff to do. In example, two smaller issues that requested some additional functionallities to:

  • Calculate the bandwidth for an account
  • Calculate the SBD value for a Steem Asset and the other way around
    So I committed a first draft for both feature requests, while the one for the account bandwidth is based on the great guide provided by @jfollas.

Beside that I finally changed all API calls to the new Appbase format as I am now 100% sure that it should work in general after the Jussi issue is fixed.

List of related issues:

  • IS #196 - Add a method to calculate the remaining bandwidth
  • IS #205 - Provide a utility method to calculate the STEEM <-> SBD values
  • IS #206 - Fully drop the WS support and only support the appbase api
  • IS #208 - Implement the CodenserAPI

The commits are only related to the issues above - It does not mean that the issues are completly solved

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

Comments

Sort byBest