[Help Wanted] – Help to improve SteemJ and earn a reward

in #steemdev7 years ago

Create a post that explains the getDiscussions method and earn 25 SBD or more.


SteemJV2Logo

Source left Orc - Source right Orc

[Help Wanted] – Help to improve SteemJ and earn a reward

Hello Steemians!

The development of the next SteemJ version is still ongoing and consumes a lot of my time. To speed this process up, I thought about asking for some help in the community. So if you ever wanted to contribute to SteemJ, here is your chance to do so and to get paid for it on top.

The Task

The database_api provided by a Steem Node has several methods to receive posts (aka discussions) based on the provided conditions. Sadly, I wasn’t able to find documentation for those methods and how they act in detail. The only way to finger this out seems to be testing it on my own.

The task itself is to write a tutorial here on Steemit that fulfills the following requirements:

  • For each “get_discussions_by” method (11 in total):
    • Explain what the method is used for
    • Explain which fields of the “discussion_query” object needs to be set and which fields are not allowed to be set (I guess there are some).
    • Provide a small snippet using SteemJ
  • Describe every field of the “discussion_query” object (12 in total) and their usage (e.g. The tag field is used to filter for discussions that have been posted with this main tag)
  • Post the link to your post in the comment section below until theend of October 2017.

The idea is to reuse your post to:

  • Create proper JavaDoc for the “getDiscussionsBy” method of SteemJ
  • Create proper Unit-Tests
  • Provide a proper documentation

Due to that your post should be written in English and should have a good quality in general :) - Thanks!

The reward

I really appropriate any help I can get, but I guess that this may not be enough motivation :P – Therefore I thought about the following reward for the first post that fulfills the requirements described above:

  • You will receive the SBD reward of this post if it is higher than 25 SBD – If not, I’ll pay 25 SBD from my own Wallet.
  • I’ll resteem your post with the @steemj and the @dez1337 so it can reach more than 500 people that are potentially interested in your post.

Technical Background

To make the task a little bit easier, here are some useful information.

As a look at the original Steem source code will be really helpful for sure, here is the link to the “database_api” which contains the “get_discussions_by*” methods: https://github.com/steemit/steem/blob/master/libraries/app/database_api.cpp

Beside that, here is the original code of the “discussion_query” struct:

/**
* Defines the arguments to a query as a struct so it can be easily extended
*/
struct discussion_query {
void validate()const{
FC_ASSERT( filter_tags.find(tag) == filter_tags.end() );
FC_ASSERT( limit <= 100 );
}

string tag;
uint32_t limit = 0;
set<string> filter_tags;
set<string> select_authors; ///< list of authors to include, posts not by this author are filtered
set<string> select_tags; ///< list of tags to include, posts without these tags are filtered
uint32_t truncate_body = 0; ///< the number of bytes of the post body to return, 0 for all
optional<string> start_author;
optional<string> start_permlink;
optional<string> parent_author;
optional<string> parent_permlink;
};

For your tests and for creating the snippets you need the latest version of SteemJ (a pre release of version 0.4.0) which can be downloaded here: https://oss.sonatype.org/content/repositories/releases/eu/bittrade/libs/steemj-core/0.4.0pr1/

Or added as a dependency to a Maven project using:

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

In SteemJ all “get_discussions_by” methods are aggregated in a single method:

getDiscussionsBy(DiscussionQuery discussionQuery, DiscussionSortType sortBy)

As described above, please provide snippets for all 12 DiscussionSortTypes.

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 meFollow @dez1337
follow mefollow dez1337


Thanks for reading and best regards,
@dez1337

Sort:  

Hey! I just came across your library today. I have already started working on the get_discussion methods for my Android project:
https://steemit.com/android/@edgar-trem/steemit-android-app-coming-up-and-my-recent-project

So i already have a general understanding of how these work, but i just started looking into them just a few days ago. I'll keep on investigating further and if i can contribute to your library I definitely will.

Hello and welcome @edgar-trem - Nice to see you here :)

Hey! I just came across your library today. I have already started working on the get_discussion methods for my Android project

Great! There is already an issue at GitHub about using SteemJ on Android. The main problem is that steemj is using Java 8 which is only supported by Android > 7.0 . I am very interested in having steemj working on Android - So please let me know about all the issues you face and I'll try to solve them with you. You can also ping me on steemit.chat.

So i already have a general understanding of how these work, but i just started looking into them just a few days ago. I'll keep on investigating further and if i can contribute to your library I definitely will.

Thank you very much!

Hey thanks for the link to the api spec. I was searching for that.
If I have time I'll check out steemj and give it a try.
Why is there eu.bittrade in ur artifact pom? Are you doing this for a trading company?
Thanks J

Hay @jjb777 - No problem :P The Steem source code is still the most accurate documentation :D

If I have time I'll check out steemj and give it a try.

That would be really great! Even if you do not have the time to work on the task described in this post, any kind of feedback is really great :)

Why is there eu.bittrade in ur artifact pom?

To push artifacts to the central maven repository you need to own a domain and the bittrade.eu domain is one domain I own.

Are you doing this for a trading company?

Sadly no :P Me and some colleagues had the idea of a "social trading" plattform and started to buy domains and to develop the tools. Sadly, we did not had enough time next to our real jobs to finish that project so the domain and some servers are the only things left from bittrade.eu.

Hi @dez1337. Is it somehow possible to change the SteemAddressPrefix to "STX"?

Not yet, but I'll try to include it in SteemJ 0.4.0 and created this Issue to track the request.

Is it enough if I simply add "STX" to the 'SteemitAddressPrefix' so that you can configure it using 'SteemJConfig.getInstance().setAddressPrefix(SteemitAddressPrefix.STX)' ?

No idea about programming, but I love the fact that you guys together with @jerrybanfield are trying to build the community

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 62685.52
ETH 2436.42
USDT 1.00
SBD 2.51