create account

SteemJ Dev Diary #6 (06.01.2018) - Add new API methods to the DatabaseApi by dez1337

View this thread on: hive.blogpeakd.comecency.com
· @dez1337 · (edited)
$82.78
SteemJ Dev Diary #6 (06.01.2018) - Add new API methods to the DatabaseApi
*Next to last day of the SteemJ Dev Diary, the work on the DatabaseApi has been continued.*

<center>
![SteemJV2Logo](https://imgur.com/lLwFYhy.png)
</center>

<center>
Latest SteemJ 0.4.x releases: [0.4.3](https://steemit.com/utopian-io/@dez1337/steemj-v0-4-3-is-available-now-use-the-steem-api-in-your-java-project) [v0.4.2](https://steemit.com/utopian-io/@dez1337/steemj-v0-4-2-is-available-now-use-the-steem-api-in-your-java-project) [v0.4.2pr1](https://steemit.com/steemdev/@dez1337/steemj-v0-4-1-has-been-released-use-the-steem-api-in-your-java-project) [v0.4.1](https://steemit.com/steemdev/@dez1337/steemj-v0-4-1-has-been-released-use-the-steem-api-in-your-java-project) [v0.4.0](https://steemit.com/steemdev/@dez1337/steemj-v0-4-0-has-been-released-integrate-steem-into-your-java-project) 
</center>

# SteemJ Dev Diary #6 (06.01.2018) - Add new API methods to the DatabaseApi
<br>Hello Steemians and welcome back to day #5 of the SteemJ HF 0.20 Dev Diary! 

This series has been introduced to collect feedback from you and to motivate myself to finalize the next SteemJ version as soon as possible. If this is the first part of this series you read, you may want to checkout [Day #1](https://steemit.com/utopian-io/@dez1337/steemj-dev-diary-1-01-01-2018-cryptocore-and-code-cleanups) which explains the motivation behind this diary in detail and also provides a first overview of the API changes that come with HF 0.20.

# Changes during day #6
Todays focus was the 'DatabaseApi' which received the biggest update by the SteemDevs I would say. The future version of SteemJ will also support the great new API calls like 'list_vesting_delegations', 'list_escrows' or 'find_sbd_conversion_requests'. So far there was only one way of collecting those information: You had to index all blocks and search for those operations, so I really love to see those methods being implemented on Steem side. 

As tomorrow is already the last, planned day of this diary series I will for sure try my best to finalize the 'DatabaseApi', so that I can hopefully share a Screenshot of all available methods with you tomorrow.

Beside this change I was able to close some smaller issues by removing deprecated fields, adding a License Header to all files and by adding the Issue section to all poms.

List of fixed issues:
* [IS #197](https://github.com/marvin-we/steem-java-api-wrapper/issues/197)
* [IS #165](https://github.com/marvin-we/steem-java-api-wrapper/issues/165)
* [IS #161](https://github.com/marvin-we/steem-java-api-wrapper/issues/161)

Full list of commits:
* [ce7a7b](https://github.com/marvin-we/steem-java-api-wrapper/commit/ce7a7b8dbc92b17204895e6980786e33376b9231)
* [ada03f](https://github.com/marvin-we/steem-java-api-wrapper/commit/ada03fdeb675b4fe028214eac33e7185ae358012)
* [88fd3b](https://github.com/marvin-we/steem-java-api-wrapper/commit/88fd3b72fb09d8e4c453c88c80fb13a498c5f38a)
* [f2d88c](https://github.com/marvin-we/steem-java-api-wrapper/commit/f2d88c8b5d0b751f089a44851b05cb4fce60c912)
* [cb4ecd](https://github.com/marvin-we/steem-java-api-wrapper/commit/cb4ecdb69a030a5ff9bf8f3362547426a86ce94c)
* [180fe6](https://github.com/marvin-we/steem-java-api-wrapper/commit/180fe685214f3641256358cd51f1ae559954f63a)
* [f56d93](https://github.com/marvin-we/steem-java-api-wrapper/commit/f56d93ec559d8ea3d64aa8af5d9acfef5ed119b5)
* [c19f2e](https://github.com/marvin-we/steem-java-api-wrapper/commit/c19f2e9c1d4c3d86bbb04787fe74469f2c165d53)

*(A prove that the commits have been made by me can [be found here](https://steemit.com/utopian-io/@dez1337/steemj-image-upload-1-0-0-has-been-released-upload-images-to-steemitimages-com-out-of-your-java-application#@dez1337/re-codingdefined-re-dez1337-steemj-image-upload-1-0-0-has-been-released-upload-images-to-steemitimages-com-out-of-your-java-application-20171217t115152531z))*

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](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).

> 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](https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project) 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](https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project#download).

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

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

### Start posting

```Java
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](https://github.com/marvin-we/steem-java-api-wrapper/tree/master/sample) 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](https://github.com/marvin-we/steem-java-api-wrapper/wiki).  

## 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](https://steemit.com/@dez1337) or ping me on [GitHub](https://github.com/marvin-we/steem-java-api-wrapper).

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@dez1337/steemj-dev-diary-6-06-01-2018-add-new-api-methods-to-the-databaseapi">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , ,
properties (23)
authordez1337
permlinksteemj-dev-diary-6-06-01-2018-add-new-api-methods-to-the-databaseapi
categoryutopian-io
json_metadata{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":77389964,"name":"steem-java-api-wrapper","full_name":"marvin-we/steem-java-api-wrapper","html_url":"https://github.com/marvin-we/steem-java-api-wrapper","fork":false,"owner":{"login":"marvin-we"}},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","steemdev","programming","java","steem"],"users":["dez1337","user"],"links":["https://imgur.com/lLwFYhy.png","https://steemit.com/utopian-io/@dez1337/steemj-v0-4-3-is-available-now-use-the-steem-api-in-your-java-project","https://steemit.com/utopian-io/@dez1337/steemj-v0-4-2-is-available-now-use-the-steem-api-in-your-java-project","https://steemit.com/steemdev/@dez1337/steemj-v0-4-1-has-been-released-use-the-steem-api-in-your-java-project","https://steemit.com/steemdev/@dez1337/steemj-v0-4-0-has-been-released-integrate-steem-into-your-java-project","https://steemit.com/utopian-io/@dez1337/steemj-dev-diary-1-01-01-2018-cryptocore-and-code-cleanups","https://github.com/marvin-we/steem-java-api-wrapper/issues/197","https://github.com/marvin-we/steem-java-api-wrapper/issues/165","https://github.com/marvin-we/steem-java-api-wrapper/issues/161","https://github.com/marvin-we/steem-java-api-wrapper/commit/ce7a7b8dbc92b17204895e6980786e33376b9231","https://github.com/marvin-we/steem-java-api-wrapper/commit/ada03fdeb675b4fe028214eac33e7185ae358012","https://github.com/marvin-we/steem-java-api-wrapper/commit/88fd3b72fb09d8e4c453c88c80fb13a498c5f38a","https://github.com/marvin-we/steem-java-api-wrapper/commit/f2d88c8b5d0b751f089a44851b05cb4fce60c912","https://github.com/marvin-we/steem-java-api-wrapper/commit/cb4ecdb69a030a5ff9bf8f3362547426a86ce94c","https://github.com/marvin-we/steem-java-api-wrapper/commit/180fe685214f3641256358cd51f1ae559954f63a","https://github.com/marvin-we/steem-java-api-wrapper/commit/f56d93ec559d8ea3d64aa8af5d9acfef5ed119b5","https://github.com/marvin-we/steem-java-api-wrapper/commit/c19f2e9c1d4c3d86bbb04787fe74469f2c165d53","https://steemit.com/utopian-io/@dez1337/steemj-image-upload-1-0-0-has-been-released-upload-images-to-steemitimages-com-out-of-your-java-application#@dez1337/re-codingdefined-re-dez1337-steemj-image-upload-1-0-0-has-been-released-upload-images-to-steemitimages-com-out-of-your-java-application-20171217t115152531z","https://github.com/marvin-we/steem-java-api-wrapper/compare/v0.4.3...master","https://github.com/marvin-we/steem-java-api-wrapper","https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project","https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project#download","https://github.com/marvin-we/steem-java-api-wrapper/tree/master/sample","https://github.com/marvin-we/steem-java-api-wrapper/wiki","https://steemit.com/@dez1337"],"image":["https://imgur.com/lLwFYhy.png"],"moderator":{"account":"dutch","reviewed":true,"pending":false,"flagged":false}}
created2018-01-07 00:40:12
last_update2018-01-09 17:13:21
depth0
children4
last_payout2018-01-14 00:40:12
cashout_time1969-12-31 23:59:59
total_payout_value59.398 HBD
curator_payout_value23.382 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7,060
author_reputation20,544,257,521,749
root_title"SteemJ Dev Diary #6 (06.01.2018) - Add new API methods to the DatabaseApi"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id27,646,832
net_rshares10,526,081,912,092
author_curate_reward""
vote details (17)
@dutch ·
$0.43
Thank you for the contribution. It has been approved.

Great to see you maintaining both a high level of quality and significant work output throughout this series. =)

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
👍  ,
properties (23)
authordutch
permlinkre-dez1337-steemj-dev-diary-6-06-01-2018-add-new-api-methods-to-the-databaseapi-20180109t142136108z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-01-09 14:21:36
last_update2018-01-09 14:21:36
depth1
children1
last_payout2018-01-16 14:21:36
cashout_time1969-12-31 23:59:59
total_payout_value0.330 HBD
curator_payout_value0.098 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length286
author_reputation11,905,004,165,125
root_title"SteemJ Dev Diary #6 (06.01.2018) - Add new API methods to the DatabaseApi"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id28,263,021
net_rshares39,628,644,897
author_curate_reward""
vote details (2)
@dez1337 ·
$0.85
Thank you for the quick review @dutch =)
👍  
properties (23)
authordez1337
permlinkre-dutch-re-dez1337-steemj-dev-diary-6-06-01-2018-add-new-api-methods-to-the-databaseapi-20180109t211500336z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["dutch"],"app":"steemit/0.1"}
created2018-01-09 21:14:57
last_update2018-01-09 21:14:57
depth2
children0
last_payout2018-01-16 21:14:57
cashout_time1969-12-31 23:59:59
total_payout_value0.636 HBD
curator_payout_value0.212 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length40
author_reputation20,544,257,521,749
root_title"SteemJ Dev Diary #6 (06.01.2018) - Add new API methods to the DatabaseApi"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id28,339,224
net_rshares79,110,868,944
author_curate_reward""
vote details (1)
@utopian-io ·
### Hey @dez1337 I am @utopian-io. I have just upvoted you!
#### Achievements
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-dez1337-steemj-dev-diary-6-06-01-2018-add-new-api-methods-to-the-databaseapi-20180109t231251635z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-01-09 23:12:51
last_update2018-01-09 23:12:51
depth1
children0
last_payout2018-01-16 23:12:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,005
author_reputation152,955,367,999,756
root_title"SteemJ Dev Diary #6 (06.01.2018) - Add new API methods to the DatabaseApi"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id28,357,808
net_rshares0
@walidsalah ·
$0.05
VERY NICE POST
GREETINGS  TO  U
👍  
properties (23)
authorwalidsalah
permlinkre-dez1337-steemj-dev-diary-6-06-01-2018-add-new-api-methods-to-the-databaseapi-20180107t165838812z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-01-07 17:03:57
last_update2018-01-07 17:03:57
depth1
children0
last_payout2018-01-14 17:03:57
cashout_time1969-12-31 23:59:59
total_payout_value0.042 HBD
curator_payout_value0.005 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length31
author_reputation4,044,999,895,445
root_title"SteemJ Dev Diary #6 (06.01.2018) - Add new API methods to the DatabaseApi"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id27,800,605
net_rshares4,845,628,513
author_curate_reward""
vote details (1)