SteemJ V0.3.1 has been released - Update #13

in #steemdev7 years ago

This release fixes most of the issues reported on GitHub and adds some additional functionalities and improvements.


SteemJV2Logo


Previous 0.3.x releases: 0.3.0

SteemJ v0.3.1 has been released

Hello Steemians!

So another four weeks have passed since the last update I am really proud to share a new SteemJ version with you.

In the last update post I’ve said:

According to the access numbers on GitHub more and more people start to test/use SteemJ which makes me really really happy.

And what can I say? The numbers are still increasing and in the last 7 days, 100 different users visited the project page on GitHub – This is a new "User Record"! Thank you for that, it is absolutly great to see this project growing!

With the increasing number of users and people who really want to start something based on SteemJ, a lot of issues have been identified. This release will cover a lot of the requested fixes. I hope once again that this release supports all the functionality needed to finish your projects – Otherwise, please let me know - I am always happy about any feedback, request or bug report and will try to help you as soon as possible.

Code Quality

Before we have a look at the detailed changes, let’s take a look at the SonarQube dashboard for this release.


SonarQube

The number of tests and the overall code coverage has slightly increased as I’ve added tests for all the reported and fixed issues just to make sure I will never miss those bugs again. Beside that the duplication rate has been decreased a little bit due to some code clean ups.

Changelog

Let’s now have a look at the detailed changelog.

Functional Updates

  • The API method “getOpsInBlock” has been added #44. This operation allows you to fetch all Operations for a specific block.
  • Fix several methods reported in #37
    • getFeedHistory
    • getOrderBook
    • getOpenOrders
  • Dates are now wrapped in a separate TimePointSec-Object 38
  • Fix Timestamp is always 0 for getBlock method #40
  • It is now possible to disable the timeout mechanism by setting the timeout to „0“ #39.
  • From now on a “jar-with-dependencies” will be provided. This Jar contains all required dependencies to run SteemJ. This only effects those people who do not use a build management tool like Maven.

Code Quality Improvements

  • Additional tests have been added.

Documentation

  • Additional JavaDoc has been added to several methods and fields

Sadly, the Wiki is not up to date yet, but I’ll try to solve this in the upcoming days.

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

How to add it 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.

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.


If you want to stay up to date or just like the stuff I am doing it would be great if you could press the button below =).



follow me

Thanks for reading and best regards,
@dez1337

Sort:  

Hi @dez1337

I would like to retrieve all comments of a user. I came up with the following code:

List<CommentOperation> commentOperations = new ArrayList<>();

Map<Integer, AccountActivity> accountHistoryCL = steemApiWrapper.getAccountHistory("accountName", 9999, 9999);

 for(AccountActivity activity : accountHistoryCL.values()){
                
    if(activity.getOperations() instanceof CommentOperation){
        
        CommentOperation commentOperation = (CommentOperation)activity.getOperations();
        if(commentOperation.getAuthor().getAccountName().equalsIgnoreCase("accountName")){
            commentOperations.add(commentOperation);
        }
    }
    
}

But this seem to also retrieve blog posts and other stuff?. Is there a better way to retrieve all comments of a specific account?

Hay @coinlend,

Thank your for your question :) Actually I think you already went for the solution with the best performance 👍

Depending on what you are exactly doing it could boost the performance a lot if you go for a datacollector/datapresenter architecture. The datacollector would periodically insert the comment operations in a db so on a request the presenter only needs to perform a sql query instead of pulling all operations from a steem node for every single request .

Hope that helps at least a bit 💪

Thanks, that helps!

Another question: I tried to run SteemJ on the Google Appengine Cloud, but I get the following error:

Could not reconfigure JMX java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory is a restricted class. Please see the Google  App Engine developer's guide for more details.

Seems to be using classes restricted by Google Appengine. Is there any chance to get this running at the Google Cloud?

Hay @coinled,

Could you create a GitHub issue for that? I'll try to figger out where this class is used and check if I can remove it.

Thank you and best regards! 💪

Thanks for taking the time, I did open an issue:

https://github.com/steemit/steem-js/issues/225

good! i waited about this about two week. thank you.

Thank you for your help and for making this project better and better - Let me know if you find more problems :)

Hi I am a java developer in Korea.
I am very grateful for your steemj project.
With your steemj I think I can easily develop my project.
Thank you.

Nice to hear that :) I would love to hear about your project!

I do not speak English well and use the Google translation system.
You have to understand this.
Koreans are very interested in steemit.
Koreans are now online auctions through steemit.

  1. Buyers "vote" on sales postings.
  2. Buyers write down the desired price.
  3. The seller discounts the amount (votes / 0.375) from the winning bid.

The interface of steemit is very inconvenient for auction.
I will create a web page that makes this screen easy and convenient.
Here is an example of the screen ui.
Https://cobot.co.kr/kr-market.html
The data interface will use your steemj.
I am very pleased with your interest.

So far I can follow you so the google translator seems to do a good job :P

Your idea sounds great - Feel free to create a GitHub issue in case of a problem/question. I'll do my best to support you.

Thank you ^^

Do you know of a good, up to date article on how to set up a local node either in Macosx or in an Ubuntu Server vm? Would like to get into development using this API but struggling to get going.

Hay @markangeltrueman ,

I think the fastes way is a docker image at the moment. You should have a look at @someguy123 s project on GitHub. For me this is the most easisiest way to start a node :)

Beside that you do not need your own node if its only about playing with the api as some witnesses allow you to connect to their node :)

thanks for the response. The Steem In A Box was what i was trying, but getting it configured to accept incoming rpc calls is proving problematic for some reason. I'll keep working on it though :)

Yeah, I know the struggle and also created a post this problem month ago .. 😂 .. good luck mate - Let me know when you get it working :)

Following you to know more. I am interested to know how we can post a story using API, also I want to find out posts based on some criteria, is that possible ?

Thanks for following :)

The question about "How to post a story" has been asked and answered in this issue on GitHub.

To answer your second question: Yes, basically everything is possible - The question is how easy it can be achieved with the Steem API :P Steem supports some basic requests (have a look at the getDiscussion method). If those methods do not fit your needs you can still "scan" all operations on your own by using the getOpsInBlock method.

If you have more questions it would be cool if you could create a GitHub issue for them, because it makes it easier for me to track them and to be aware of things users would like to see in the documentation.

Few more questions : how do we know the address of Steem nodes ? Is it officially published somewhere ? And any documentation on how to connect those nodes ?

Hay @sanjeevm,

thank you for your interest. The sample on the GitHub main Page shows basically how to connect to a node.

Regarding the documentation: The project is still under heavy development and a lot of stuff is changing from version to version. I know it makes it quite hard to use, but currently I am focusing on functionallity.

I would suggest to just check the methods provided by the SteemAPIWrapper - The Javadoc for the most methods is up to date and should give you first a idea of what is possible.

Coin Marketplace

STEEM 0.18
TRX 0.11
JST 0.027
BTC 65422.12
ETH 3433.90
USDT 1.00
SBD 2.31