EOS获取计算RAM单价价格

1.命令行中输入:

./cleos get table eosio eosio rammarket

返回:

response:{"rows":[{"supply":"10000000000.0000 RAMCORE","base":{"balance":"68626470312 RAM","weight":"0.50000000000000000"},"quote":{"balance":"1001355.2562 SYS","weight":"0.50000000000000000"}}],"more":false}
{
  "rows": [{
      "supply": "10000000000.0000 RAMCORE",
      "base": {
        "balance": "68626470312 RAM",
        "weight": "0.50000000000000000"
      },
      "quote": {
        "balance": "1001355.2562 SYS",
        "weight": "0.50000000000000000"
      }
    }
  ],
  "more": false
}

2.使用Bancor算法,计算出需要nKB的RAM的价格:

RAM价格 = (n * quote.balance) / (n + base.balance / 1024)

猜你喜欢

转载自blog.csdn.net/yhc166188/article/details/82230056