Using Radiator on Testnet

in #radiator6 years ago (edited)
monkey patch

Just a quick note on using Radiator with the new Testnet.

Pretty much everything will work with the current version, probably even past versions. But you'll have to do a monkey patch at the beginning of your project, typically right after the require for Radiator:



module Radiator
  module ChainConfig
    NETWORKS_STEEM_CHAIN_ID = '0feb08c380aeb483b61a34cccb7271a3a99c47052bea529c4a891622f2c50d75'
    NETWORKS_STEEM_ADDRESS_PREFIX = 'TST'
    NETWORKS_STEEM_CORE_ASSET = 'TESTS'
    NETWORKS_STEEM_DEBT_ASSET = 'TBD'
    NETWORKS_STEEM_VEST_ASSET = 'VESTS'
    NETWORKS_STEEM_DEFAULT_NODE = 'https://testnet.steemitdev.com'

    NETWORK_CHAIN_IDS = [NETWORKS_STEEM_CHAIN_ID]
  end
end

Here's a full example with the monkey patch in the right spot. Also notice that you hav to set the url to the one and only node we have at the moment and failover_urls to an empty array.

require 'radiator'

module Radiator
  module ChainConfig
    NETWORKS_STEEM_CHAIN_ID = '0feb08c380aeb483b61a34cccb7271a3a99c47052bea529c4a891622f2c50d75'
    NETWORKS_STEEM_ADDRESS_PREFIX = 'TST'
    NETWORKS_STEEM_CORE_ASSET = 'TESTS'
    NETWORKS_STEEM_DEBT_ASSET = 'TBD'
    NETWORKS_STEEM_VEST_ASSET = 'VESTS'
    NETWORKS_STEEM_DEFAULT_NODE = 'https://testnet.steemitdev.com'

    NETWORK_CHAIN_IDS = [NETWORKS_STEEM_CHAIN_ID]
  end
end

comment = {
  type: :comment,
  parent_permlink: 'test',
  author: 'your-account',
  permlink: 'something-unique',
  title: 'Radiator Can Post Comments!',
  body: 'Yep, this post was created by Radiator in `ruby`.',
  json_metadata: '',
  parent_author: ''
}

options = {
  url: 'https://testnet.steemitdev.com',
  failover_urls: []
}
tx = Radiator::Transaction.new(options.merge(wif: 'Your Wif Here'))
op = Radiator::Operation.new(comment)
tx.operations << op
tx.process(true)
Sort:  

I was thinking since tesnet was develop to help programers try out HF20 will it possible that the previous version of Radiator may lack any feature?

Previous versions indirectly rely on condenser_api. It might work. But for sure it works on radiator-0.4.x.

Oh okay, thank you

Oh, specific HF20 methods are not yet supported in Radiator. There are new methods that may or may not be final. In the current testnet, the only new method I'm aware of is: account_history_api.enum_virtual_ops. And I'm not sure what it does.

Radiator doesn't know what to do with it yet.

tx = Radiator::Transaction.new(options.merge(wif: 'Your Wif Here'

I was wondering where my wif was...

Your testnet wif is the same as your mainnet wif. But I don't think that was ever explicitly documented anywhere.

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.391 which ranks you at #173 across all Steem accounts.

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

Evaluation of your UA score:
  • You've built up a nice network.
  • The readers like your work!
  • Try to improve on your user engagement! The more interesting interaction in the comments of your post, the better!

Feel free to join our @steem-ua Discord server