Chainers / Ditch

Create and broadcast transactions to Graphene-based blockchains
MIT License
33 stars 26 forks source link

Ditch.Steem does not work with nodes other than api.steemit.com #16

Closed beetlevc closed 6 years ago

beetlevc commented 6 years ago

It seems there are two a bit different formats for calling methods via Steem JsonRpc.

The first one is the one Ditch uses: {"jsonrpc":"2.0","method":"database_api.get_dynamic_global_properties","id":14}

The second one is the one steemit.com website uses: {"id":14,"jsonrpc":"2.0","method":"call","params":["database_api","get_dynamic_global_properties",[]]}

Main api.steemit.com node seems to support both formats, but alternative public nodes like "https://steemd.minnowsupportproject.org" and "https://rpc.buildteam.io" only support the second one, so they reject Ditch requests.

The way I see it this issue can be fixed by making minor changes to DitchSteem/JsonRpc/JsonRpcRequest.cs. Also it might be a good idea to add some sort of setting to choose format needed.

pmartynov commented 6 years ago

"https://steemd.minnowsupportproject.org" and "https://rpc.buildteam.io" are using 0.19.0 at the moment, which seems a bit obsolete.

However, api.steemit.com is unstable sometimes, so I agree that there should be a way to support both formats and switch between them. Otherwise, the devs without custom fresh nodes would have instability in their projects.

beetlevc commented 6 years ago

Thank you for the clarification Pavel. I did not realize those nodes were using obsolete software. They seem to work fine with the most current version of blockchain. Also you are right, api.steemit.com is unstable, probably due to overload. That's why I was experimenting with other nodes. As a member of the team, can you propose a clean way to override this behavior and make Ditch work with older nodes? Like overriding some factory method and injecting my own implementation of JsonRpcRequest, you know...

KorzunAV commented 6 years ago

Older Ditch versions works with older nods versions ;)

KorzunAV commented 6 years ago

v4.0.0 adds BroadcastOperationsSynchronousLikeSteemit function to solve this issue