eosio计算ram价格

首先获取多索引表rammarket的数据:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$: cleos -u https://nodes.get-scatter.com:443 get table eosio eosio rammarket
{
"rows": [{
"supply": "10000000000.0000 RAMCORE",
"base": {
"balance": "70910488246 RAM",
"weight": "0.50000000000000000"
},
"quote": {
"balance": "1722420.0326 EOS",
"weight": "0.50000000000000000"
}
}
],
"more": false
}

那么n KB的内存价格为:

1
n KB内存需要的EOS = ( n * quote.balance ) / ( n + base.balance / 1024 )
打赏
  • © 2016-2020 留叶
  • Powered by Hexo Theme Ayer
    • PV:
    • UV:

请我喝杯咖啡吧~

支付宝
微信