steem-java-api-wrapper icon indicating copy to clipboard operation
steem-java-api-wrapper copied to clipboard

Can't reblog -- Global Properties Unrecognized

Open Atherz97 opened this issue 8 years ago • 9 comments

In order to resteem, I have to create a signed transaction using the head BlockId.

BlockId headBlock = api.getDynamicGlobalProperties().getHeadBlockId();
SignedTransaction t = new SignedTransaction(headBlock, operations, null);
[...]

However while in an earlier version I used (0.4.3) this caused no problems, now I get an exception:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "current_reserve_ratio" (class eu.bittrade.libs.steemj.plugins.apis.database.models.DynamicGlobalProperty), not marked as ignorable (26 known properties: "virtual_supply", "confidential_supply", "num_pow_witnesses", "total_reward_shares2", "pending_rewarded_vesting_shares", [more properties...])
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: java.lang.Object[0]->eu.bittrade.libs.steemj.plugins.apis.database.models.DynamicGlobalProperty["current_reserve_ratio"])

Basically I can't repost because getting the global properties are breaking the program somehow.

P.S. using api.reblog() is basically the same thing, so it throws the same error. What should I do?

Atherz97 avatar Jan 11 '18 17:01 Atherz97

Hay @Atherz97,

Which version of SteemJ are you using right now? 0.4.3 is the latest release so far and, as you wrote, the field is known there.

In case you are using the master branch: I have started to work on HF 0.20 there and a lot of fields have been rem8ved there, so that would explain your issue :)

Best regards! 😊

marvin-we avatar Jan 11 '18 17:01 marvin-we

Well, it's 0.4.3 (but I cloned the newest version from github today, and building it with "mvn clean package" gave a .jar called "steemj-core-0.5.0-SNAPSHOT-jar-with-dependencies")

And my bad, the older version was 0.4.1. I updated today because that version seemed to have died.

Atherz97 avatar Jan 11 '18 17:01 Atherz97

I am only online via phone and can't test it right now, but from what I have seen right now the 0.4.x still contains this property while on the master branch its already removed.

I think the savest way would be to dowload the souces of the 0.4.3 release.

And my bad, the older version was 0.4.1. I updated today because that version seemed to have died.

Ah yeah, the 0.4.1 was using the websocket connection which has been disabled by Steem 🙈 so yeah, version 0.4.3 should work again :)

Can you let me know if it does? :)

marvin-we avatar Jan 11 '18 18:01 marvin-we

I did use the latest version. It was giving me issues, but I'll try to clone and build again.

... so I'm getting compilation errors. All I did was clone the repo and "mvn clean package" again. Was this latest build still able to work under maven?

Atherz97 avatar Jan 11 '18 20:01 Atherz97

You did a 'git checkout 0.4.x' before the mvn package to do not build the master branch, right?

marvin-we avatar Jan 11 '18 20:01 marvin-we

It works :) I found an already build jar on one of your sites. Thanks.

Atherz97 avatar Jan 11 '18 22:01 Atherz97

api.reblog(d.getAuthor(), d.getPermlink());
// d is a Discussion object returned from searching using a query

Uhh so this issue is sort of the same thing, it doesn't throw an exception and returns successful, however there are no posts appearing on the blog itself.

Atherz97 avatar Jan 12 '18 02:01 Atherz97

Hay @Atherz97 and sorry for the late reply.

Thanks for testing the latest release and for the feedback :)

Uhh so this issue is sort of the same thing, it doesn't throw an exception and returns successful, however there are no posts appearing on the blog itself.

The reason why no exception is thrown is that a Steem Node only checks if the JSON is valid. If it is, the method returns success even if the operation is processed or not. I have some ideas to change/improve this with 0.5.0, but this won't help you right now :P

Are you sure that you have provided the correct default account (SteemJConfig.setDefatultAccount) and its posting key? If this the case, could you also share the value of "d.getAuthor()" and "d.getPermlink()" with me?

Thanks and best regards!

marvin-we avatar Jan 13 '18 21:01 marvin-we

Well I guess my bot is stuck in the water until then, lol.

Yes, the posting key is correct; it's able to post messages like this. And in the case of this comment, d.getAuthor() would return the AccountName of "roundbeargames", and d.getPermlink() returns the Permlink for "mdquedjx". What allowed the bot under the previous SteemJ versions to help out with making sure it posted or not, was erroring if it didn't post, lol.

Atherz97 avatar Jan 15 '18 22:01 Atherz97