Steemit steem-ruby: Create NetworkBroadcastApi#broadcast_transaction_synchronous helper method

in utopian-io •  6 years ago 

Repository

https://github.com/steemit/steem-ruby

Issue

https://github.com/steemit/steem-ruby/issues/16

Details

In steem-ruby, the method Steem::NetworkBroadcastApi#broadcast_transaction_synchronous was never officially available as an RPC. Early versions of AppBase provided this method and steem-ruby would pass it along, but when AppBase dropped it, it also became unavailable in steem-ruby.

Prior to this, steem-ruby didn't even need a concrete class for Steem::NetworkBroadcastApi because it is dynamically defined at runtime with all available methods.

For now, the workaround is to use Steem::CondenserApi#broadcast_transaction_synchronous, but this is not a good long-term solution.

Instead, we should actually add the concrete class called Steem::NetworkBroadcastApi with an instance method of broadcast_transaction_synchronous to simulate the desired behavior by internally polling broadcasts with Steem::TransactionStatusApi#find_transaction.

https://developers.steem.io/apidefinitions/#apidefinitions-transaction-status-api

When the new Steem::NetworkBroadcastApi#broadcast_transaction_synchronous method polls for the transaction, it should poll for within_reversible_block and include block_num in the result like Steem::CondenserApi#broadcast_transaction_synchronous currently does.

Components

  • Create concrete class lib/steem/network_broadcast_api.rb with an instance method broadcast_transaction_synchronous that handles polling
  • Define tests in test/steem/network_broadcast_api_test.rb

Communication

https://github.com/steemit/steem-ruby/blob/master/CONTRIBUTING.md

Github

https://github.com/inertia186

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thanks for the task request, @inertia! The task is clear, however from past experience I think there is a lack of Ruby developers on Utopian (or the blockchain in general), so I wish you luck finding someone. Maybe it's worth contacting @coingecko and seeing if they know any Ruby developers, as they have also posted task requests looking for them in the past.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks for the lead. I also have the people who have already forked it to hit up. :D

Interesting! Yes, we're on the lookout for Ruby dev ourselves. Hope you put in a good word for us to your guys if they're looking for more gigs!

Thank you for your review, @amosbastian! Keep up the good work!

Hi, @inertia!

You just got a 2.65% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hey, @inertia!

Thanks for contributing on Utopian.
We’re already looking forward to your next task request!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Congratulations @inertia! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You got more than 3500 replies. Your next target is to reach 3750 replies.

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Saint Nicholas challenge for good boys and girls

Support SteemitBoard's project! Vote for its witness and get one more award!

Hi @inertia!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 6.469 which ranks you at #165 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 210 contributions, your post is ranked at #6.

Evaluation of your UA score:
  • You've built up a nice network.
  • The readers appreciate your great work!
  • Good user engagement!

Feel free to join our @steem-ua Discord server