create account

How to prepare your applications for HF24 by mahdiyari

View this thread on: hive.blogpeakd.comecency.com
· @mahdiyari · (edited)
$66.16
How to prepare your applications for HF24
<center>![eclipse.jpg](https://images.hive.blog/DQmWDX4F8crXcKRUpSy5DUSCTZWUt6MGs2FVrhRbLpBiVHT/fantasy-4566021_1280.jpg)
</center>

> "and everything under the Sun is in tune
but the sun is eclipsed by the moon"
Eclipse - Pink Floyd

### Changes in HF24/Eclipse RPC nodes:
Almost everything is rebranded in this version. You have to update anything that includes the word "steem" or "sbd" in your apps.

***
<center>
** **ATTENTION** **
All the listed changes will only take effect on the eclipse RPC nodes. It means you must not apply the updates in the production until there is a final release candidate.
Also, the old public nodes will continue running to give you enough time for updating your applications.
In the meantime, @gtg maintains an early version which you can test your apps with `https://beta.openhive.network/` (It is the mainnet)
</center>
***

<b>Affected operations:</b>
- `comment_options` (!)
Old: `percent_steem_dollars`
New: `percent_hbd`

- `escrow_transfer`
Old: `steem_amount`, `sbd_amount`
New: `hive_amount`, `hbd_amount`

- `escrow_release`
Old: `steem_amount`, `sbd_amount`
New: `hive_amount`, `hbd_amount`

- `claim_reward_balance`
Old: `reward_steem`, `reward_sbd`
New: `reward_hive`, `reward_hbd`

- `author_reward` (virtual operation)
Old: `steem_payout`, `sbd_payout`
New: `hive_payout`, `hbd_payout`

- `witness_update`
Old: `sbd_interest_rate`
New: `hbd_interest_rate`

- `witness_set_properties`
Old: `sbd_interest_rate`, `sbd_exchange_rate`
New: `hbd_interest_rate`, `hbd_exchange_rate`

***

<b>Affected API calls:</b>
Replace all the `steem` with `hive` and all the `sbd` with `hbd` in the received JSON object.
There is one exception in `percent_steem_dollars` which is now `percent_hbd`!

- `condenser_api.get_accounts` (and other similar calls returning an account object like `condenser_api.lookup_account_names`)
- `condenser_api.get_blog`
- `condenser_api.get_chain_properties`
- `condenser_api.get_content`
- `condenser_api.get_content_replies`
- `condenser_api.get_discussions_by_*`
- `condenser_api.get_dynamic_global_properties`
- `condenser_api.get_market_history`
- `condenser_api.get_ticker`
- `condenser_api.get_version`
- `condenser_api.get_volume`
- `condenser_api.get_witness_by_account`
- `condenser_api.get_witness_schedule`
- `bridge.get_ranked_posts`
- All `database_api` equivelants of the methods above
- `database_api.list_escrows`
- `database_api.find_sbd_conversion_requests` (method renamed)
- `database_api.list_sbd_conversion_requests` (method renamed)
- `database_api.find_witnesses`
- `market_history_api.get_market_history`
- `market_history_api.get_order_book`
- `market_history_api.get_ticker`
- `market_history_api.get_volume`
- `tags_api.get_discussion`
- `tags_api.get_discussions_by_*`

***
## Updated libraries:
#### Hive-js (see [v0.8.2](https://gitlab.syncad.com/hive/hive-js/-/releases/v0.8.2))

In order to connect to the eclipse RPC nodes, you have to set `rebranded_api` in the `config.json` to `true`.

Or

```
hive.config.set('rebranded_api', true)
hive.broadcast.updateOperations()
```

There is also a helper function to get the node version and update the config:
```
hive.utils.autoDetectApiVersion().then(() => {
  hive.broadcast.updateOperations()
})
``` 

Note: Calling `hive.broadcast.updateOperations()` is necessary after updating the `rebranded_api`.
***
#### Dhive (see [MR16](https://gitlab.syncad.com/hive/dhive/-/merge_requests/16) - v0.14.1)

In order to connect to the eclipse RPC nodes, the easy way is:
```
const client = new dhive.Client("https://rpc", { rebrandedApi: true })
```
 Or

```
client.updateOperations(true) // true: hf24
```


And with the helper function:

```
const client = new dhive.Client("https://rpc")
client.database.getVersion().then((res) => {
  if (res.blockchain_version !== '0.23.0') {
    client.updateOperations(true)
  }
})
```

***
#### Hive-tx (see [v3.1.8](https://github.com/mahdiyari/hive-tx-js/releases/tag/v3.1.8))
```
hiveTx.config.rebranded_api = true
hiveTx.updateOperations()
```
OR

```
hiveTx.call('condenser_api.get_version').then(res => {
  if (res.result.blockchain_version !== '0.23.0') {
    hiveTx.config.rebranded_api = true
    hiveTx.updateOperations()
  }
})
```

***
Beem is also updated: https://github.com/holgern/beem/releases/tag/0.24.5

For the other libraries visit their repository for more information.
***

Note: the chain id is also changed in the HF24. But you don't have to worry about it since the libraries will take care of that.
***
If you have any question, join HiveDevs discord server `https://discord [dot] gg/3WV87YE`
Hive official discord: `https://discord [dot] gg/kcCw73Z`
<sub>Noob's guide: replace the [dot] with .</sub>
***
Hope for a better everything.
<sub>Image source: pixabay.com</sub>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 466 others
👎  
properties (23)
authormahdiyari
permlinkhow-to-prepare-your-applications-for-hf24
categoryhive-139531
json_metadata{"app":"peakd/2020.09.5","format":"markdown","image":["https://images.hive.blog/DQmWDX4F8crXcKRUpSy5DUSCTZWUt6MGs2FVrhRbLpBiVHT/fantasy-4566021_1280.jpg"],"links":["/@gtg","https://gitlab.syncad.com/hive/hive-js/-/releases/v0.8.2","https://gitlab.syncad.com/hive/dhive/-/merge_requests/16","https://github.com/mahdiyari/hive-tx-js/releases/tag/v3.1.8","https://github.com/holgern/beem/releases/tag/0.24.5"],"tags":["dev","hive","hf24","eclipse"],"users":["gtg"]}
created2020-08-04 21:17:00
last_update2020-10-04 22:21:12
depth0
children4
last_payout2020-08-11 21:17:00
cashout_time1969-12-31 23:59:59
total_payout_value34.454 HBD
curator_payout_value31.709 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,781
author_reputation199,864,818,197,856
root_title"How to prepare your applications for HF24"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,895,038
net_rshares142,837,162,002,394
author_curate_reward""
vote details (531)
@chesatochi ·
What will be the main functionality of hard fork 24?
properties (22)
authorchesatochi
permlinkre-mahdiyari-qek8u9
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.07.4"}
created2020-08-04 22:22:57
last_update2020-08-04 22:22:57
depth1
children1
last_payout2020-08-11 22:22:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length52
author_reputation235,233,928,560,443
root_title"How to prepare your applications for HF24"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,895,806
net_rshares0
@mahdiyari ·
See the posts by @blocktrades
properties (22)
authormahdiyari
permlinkqek8z5
categoryhive-139531
json_metadata{"users":["blocktrades"],"app":"hiveblog/0.1"}
created2020-08-04 22:25:51
last_update2020-08-04 22:25:51
depth2
children0
last_payout2020-08-11 22:25:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length29
author_reputation199,864,818,197,856
root_title"How to prepare your applications for HF24"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,895,847
net_rshares0
@comandoyeya ·
Wow, muy interesante tu post, y muy instructivo, gracias por compartir, te voto y te sigo.
properties (22)
authorcomandoyeya
permlinkqekivw
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-08-05 01:59:57
last_update2020-08-05 01:59:57
depth1
children0
last_payout2020-08-12 01:59:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length90
author_reputation590,943,215,957,467
root_title"How to prepare your applications for HF24"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,898,380
net_rshares0
@elindos ·
$0.05
Hello @mahdiyari, I know you posted this some time ago, but it's never too late to mention a big thank you. This summary is extremely helpful to app developers.
👍  
properties (23)
authorelindos
permlinkre-mahdiyari-qhqe4y
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.09.5"}
created2020-10-05 13:43:51
last_update2020-10-05 13:43:51
depth1
children0
last_payout2020-10-12 13:43:51
cashout_time1969-12-31 23:59:59
total_payout_value0.022 HBD
curator_payout_value0.023 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length160
author_reputation61,889,516,747,789
root_title"How to prepare your applications for HF24"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id99,975,189
net_rshares307,976,443,008
author_curate_reward""
vote details (1)