Radiator Update: Getting Ready for Transaction Signing

in #radiator7 years ago (edited)

Good news! Radiator got some bug fixes. Nothing all that important, but I also did a bit of the groundwork needed to support transaction singing.

In this update:

  • Logging support, mainly because some annoying messages started showing up from Hashie.
  • A quick price feed history lookup.
  • A few missing RPC method names.
  • Bug fix for when streaming and there are no transactions in the block. It happens.
  • Improved tests.

Transaction Signing, almost.

Because of Dan's post, I have to say, that cleared up a bit of confusion on my part. It's not like I've been working on this since November, but every time I looked at the code examples, I just didn't know what to make of it. But now, I think I'm pretty much up to speed.

There's only one problem. I can't get it to work. And it's a problem that has been described before, I just need to research it a bit more.

The problem I'm having is, when I build a transaction and broadcast it, I get this message: tx_missing_posting_auth

I'm having trouble finding where my mistake is. I'm aware that if, for instance, you don't format the timestamp correctly, you might get this message. In fact, it seems like this is what you get when the node can't figure out what you're doing.

But I'm sure it's all on my end. And I'm sure it's simple.

If you want to take a stab at troubleshooting, I recommend starting here:

https://github.com/inertia186/radiator/blob/master/test/radiator/transaction_test.rb#L22

This test is supposed to mirror what @xeroc documented here:

https://steemit.com/steem/@xeroc/steem-transaction-signing-in-a-nutshell

It does so to the best of my ability, yet the message I get when I run it on a live console is tx_missing_posting_auth, like I mentioned.

Anyway, I'll keep troubleshooting.


UPDATE: Troubleshooting complete. Radiator is now able to sign transactions. I just need to make it aware of all operations because for testing purposes, it only supports vote. But here's an example of that:

require 'radiator'

transaction = Radiator::Transaction.new(wif: '5JLw5dgQAx6rhZEgNN5C2ds1V47RweGshynFSWFbaMohsYsBvE8')
vote = {
  type: :vote,
  voter: 'xeroc',
  author: 'xeroc',
  permlink: 'piston',
  weight: 10000
}

operation = Radiator::Operation.new(vote)
transaction.operations << operation
transaction.process(true)

Radiator

Related Links:

Sort:  

I'm trying to kickstart the use of a new tag, #steemdev, your content should use that tag. I'll pretty much upvote anything that is legit steem related dev content posted with that tag and downvote what's not.

Good to know.

I'm not familiar with ruby...

am i understand correctly that the tx.expiration keep changing on each loop of signature generation?

      loop do
        @expiration += 1
        sig = ec.sign_compact(digest_hex, @private_key.priv, public_key_hex)
        
        next if public_key_hex != ec.recover_compact(digest_hex, sig)
        
        return sig if canonical? sig
      end

https://github.com/inertia186/radiator/blob/master/lib/radiator/transaction.rb#L102

Correct. It adds a second for each generation attempt. That's probably way too much time to add, but it hasn't been an issue.

Graphenej does this too, but they only add 1 millisecond per iteration. I should probably do the same.

https://github.com/kenCode-de/graphenej/blob/master/graphenej/src/main/java/de/bitsharesmunich/graphenej/Transaction.java#L145

this step is redundant IMO....

but it's okay if the users are aware of it.

  • he can't set a fixed expiration,
  • tx_id can't be determined until signing done.

Good point. I'll keep that in mind. Maybe it'd be better as an option, then make the default disabled.

Perhaps create the same signed tx with steem.js and radiator and diff them?

Example failed txes/code here in comments might allow some community members to help out.

Loading...

tx_missing_posting_auth

the message state that your txn doesn't had the correct signature.
either you signed it with wrong a key, or there's a problem with your signing algorithm.