Exchange Help - How to Reliably Broadcast Transactions

in steem •  8 years ago 

This article is targeted at anyone looking to integrate STEEM with their exchange. Please read the documentation on How to monitor an account for deposits.

After you understand how to monitor for deposits, then we can start monitoring for successful withdraws.

The Problem

This post was motivated by real world issues discovered by Blocktrades and Bittrex when processing withdraws. The cli_wallet API for issuing a transfer will block until the local steamed instance receives a block containing the transaction or a block with a timestamp after the transaction has expired. The default expiration is 30 seconds.

The problem is that just because the method returns it doesn’t mean the transaction was irreversibly logged into the blockchain or that it failed. A block could become orphaned due to any number of issues.

The Solution

You must scan for withdraws just like you scan for deposits. In other words, only poll blocks that are older than the ‘last_irreversible_block_num` (about 40 seconds old). Each block contains the transaction IDs that were confirmed.

When you broadcast a transaction it will return the transaction ID, mark it as pending until your block scanner sees the withdraw.

How to Avoid Blocking

You can use the cli_wallet to broadcast your transaction, but that will normally block. If you pass ‘false’ as the last argument to the transfer call, then it will create and sign a transaction and return it (without broadcasting it). You can then pass the transaction to steamd using the non-blocking broadcast method on the network api.

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:  

How do you have $76.98 from 2 votes????????

Blocktrades has balance 1,791,298.073 STEEM...Voting is by weight

What do you mean? he got so much because he have big voting weight?
i thought it depends of how much steam power has person who's voting for you.

  ·  8 years ago (edited)

He did vote for himself... not sure if this makes a difference. Seems self-defeating and like a circle jerk though if a whale can loot the pool by voting for themselves. @dantheman have input?

BlockTrades isn't an exchange, it's a market maker. The steem power we have is our own, not our customers. We got $72 for voting for our own post. If we started spamming posts to take advantage of that, other whales can easily vote us down (also note that we have a max of 100 votes that "count" over a 5 day period). This is essentially one of the benefits of owning steem power, it enables a steem power holder to "advertise" their posts and make them more visible.

Additionally, I don't know how comfortable I am with the idea of an exchange using its customer's funds on its posting account to collect so many vests.

Damn.

he made some coin

Very affect

also his the best dude there is

https://www.pinterest.com/pin/223631937725445716/

I'm still not receiving this one transaction and feel as soon as i post this, it will come through. Thanks for all the hard work ya'll!

That link doesn't work for me. Can you email me the info at [email protected]?

Hi, i know this is not the right place to post this but i have had a transaction that is pending for more than 3 hours...please help.

Processing 3 hours ago, 1299. Ether → 3830.685 Steem

by complete coincidence, I just processed it. It looks like it got hung up on some kind of double spend.

Wow that was fast! Thanks!

gimme coin

I checked, but I don't see any Steem orders from your account placed on https://blocktrades.us. If you believe you've placed an order with us, please send more details to [email protected].

Perhaps we need a "delayed_node" like we have in BitShares.