What Changed In The Transfer RPC Request?


I use steem-js in my scripts for working with Hive, Steem and Blurt.

const chain=require("steem");

Switching The Blockchains

I switch the blockchains by setting different options. Before HF24, chain_id was the same as this from Steem and rebranded_api was not set.

if (name=='steem') {
    chain.api.setOptions({ url: 'https://api.steemit.com' });
    chain.config.set('alternative_api_endpoints', ['https://api.steemit.com', 'https://api.steemit.com']);
} else if (name=='hive') {
    chain.api.setOptions({ url: 'https://api.hive.blog' });
    chain.config.set('alternative_api_endpoints', ['https://api.openhive.network', 'https://rpc.esteem.app']);
    chain.config.set('rebranded_api', true)
    //chain.broadcast.updateOperations() doesn't exist in steem-js nor in blurtjs and not needed anymore with hivejs
} else if (name=='blurt') {
    chain.api.setOptions({ url: 'https://rpc.blurt.buzz', useAppbaseApi: true });
    chain.config.set('alternative_api_endpoints', ['https://rpc.blurt.buzz', 'https://rpc.blurt.buzz']);

The Free Hive Voting Service

Following The Community Fork, @mahdiyari released hive-js. I tried to extend my voting service to Hive using his library.

// not working
const steem=require("steem");
const hive=require("@hiveio/hive-js");

That was not working. The operations were done in the wrong blockchains when using both libraries simultaneously. Only one instance is possible.

I resolved the case importing only @hiveio/hive-js or steem, switching blockchains and making synchronous calls.

Hard Fork #24

Using these settings and updating the operations, according to How to prepare your applications for HF24, @quicktrades works well in the Hive and Steem internal markets. My other scripts work on Blurt and Steem. With Hive, the scripts worked well before HF24.

What Works


What Doesn't Work

vote works

...but not if the script worked before with Blurt or Steem.
My voting service has not been working with Hive anymore since HF24 for this cause, but it works well with Blurt and Steem. The voting service is popular on Blurt only. See @droida/do-you-vote-on-blurt-are-you-loosing-money.

transfer doesn't work

const active="a secret not to disclose";
chain.broadcast.transfer(active, "droida", "freebot", "0.001 HIVE", "", function(err, result) {
    console.log(err, result);

Error message is RPCError: missing required active authority:Missing Active Authority droida

claim_account doesn't work

const op=['claim_account',{
    creator: creator,
    fee: '0.000 HIVE',
    json_metadata: JSON.stringify({}),
    extensions: [],
    extensions: [],
    operations: [ op ]
    }, [active], (err, result) => {
        console.log(err, result);

Error message is OperationalError [RPCError]: missing required active authority:Missing Active Authority droida

What Changed In The transfer RPC Requests?

...and in claim_account?

I can transfer on Hive only if I import @hiveio/hive-js but using the Hive library makes getAccountHistory fail now.

chain.api.getAccountHistory("droida", -1, 1, function(err, result) {
    console.log(err, result);

The error message:

(node:5730) UnhandledPromiseRejectionWarning: TypeError: callback is not a function
    at /hive/node_modules/@hiveio/hive-js/lib/api/transports/http.js:148:11
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:5730) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5730) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Broken By HF24

HF24 made a mess. It sucks, I would like to call it Hard Fuck 24. It obliges developers to rewrite what was working (I have many scripts accepting the blockchain name as a parameter).
That takes energy, nerves, time and money (time is money). It makes me willing to focus on Blurt only, now that @quicktrades works.

Thanks For Your Help


The solution is probably a small common change for all the operations that fail now that shouldn't because those operations haven't changed (shouldn't).

The resolution will wait because of the missing time to investigate.
I have a full-time job and little time to invest in personal projects or to learn some javascript coding (I wrote my first instruction 37 years ago :p ). I have too few will to search for the modifications in the source code.

Discord is faster and more probative, but I can't reward answers there.

3 columns
2 columns
1 column