区块链中文技术社区

get_block_header_state Error 3200006: invalid http request

surou@DESKTOP-444S803:/mnt/c/Users/Surou$ cleos -u https://api.eosnewyork.io:443 get block --header-state 56529797
Error 3200006: invalid http request
Error Details:
The server has rejected the request as invalid!
Please verify this url is valid: https://api.eosnewyork.io:443/v1/chain/get_block_header_state
If the condition persists, please contact the RPC server administrator for api.eosnewyork.io!

意思是只能查看未被确认的区块头信息,可以先get info下,查看下未被确认的块,然后再查下

surou@DESKTOP-444S803:/mnt/c/Users/Surou$ cleos -u https://api.eosnewyork.io:443 get block --header-state 56530363
{
  "id": "035e95bbad1f6416a3ec1941fa80cac5033a0ef23d8b2c353aab780a7a14924f",
  "block_num": 56530363,
  "header": {
    "timestamp": "2019-05-05T10:11:06.500",
    "producer": "eossv12eossv",
    "confirmed": 0,
    "previous": "035e95ba91496b25ee9838a880c58e0a74d3926ae08ab427b12f97982d859487",
    "transaction_mroot": "14775b6209578bcf6e5e0a96dbefe10a2de85c7c462ba6598f8cfe97478a246d",
    "action_mroot": "92c989a247da29209e2070c18f9fb906e78bb644179882a546ba5f6d969b7e95",
    "schedule_version": 810,
    "header_extensions": [],
    "producer_signature": "SIG_K1_K3GYP3PMPKG35ezgMoyzq1Jwe4QtkhPPzkdo86GLkaiSWCpPyEhKLqsiSdB4sVjze4ZDa2G2nTMeFumuQ3WoLo3NZ8vhgn"
  },
  "dpos_proposed_irreversible_blocknum": 56530205,
  "dpos_irreversible_blocknum": 56530037,
  "bft_irreversible_blocknum": 0,
  "pending_schedule_lib_num": 56179346,
  "pending_schedule_hash": "92fda11e5856b17176368caa18db5e88c169d5e35f44b8292e53003bc91dfb08",
  "pending_schedule": {
    "version": 810,
    "producers": []
  },
  "active_schedule": {

参考地址:https://github.com/EOSIO/eos/issues/4485

state_history_plugin 的使用

发现今天更新了1.8.0RC版本,readme中说mongo插件已经废弃,马上将被删除,

Mongo DB plugin deprecated
The Mongo DB plugin has been deprecated and will be removed from the EOSIO source in a future release. Users are recommended to switch to non-deprecated history solutions such as the ones built off of the state_history_plugin.

之前一直没时间研究state_history_plugin EOSIO推荐的方案,最近抽空试一试
优点是分离了入库的逻辑, 不用replay就能自由的同步的其他数据库

源代码地址

插件源码地址:https://github.com/EOSIO/eos/tree/master/plugins/state_history_plugin
应用API:https://github.com/acoutts/EOS-state-history-API

安装依赖

安装postgresql

sudo apt-get install postgresql

待续。。

参考

https://cloud.tencent.com/developer/news/368043
https://www.jianshu.com/p/50bf6429a1ce
https://eosio.stackexchange.com/questions/3832/difference-between-history-plugin-and-state-history-plugin
https://developers.eos.io/eosio-nodeos/docs/monitoring-with-state-history
https://developers.eos.io/eosio-nodeos/docs/monitoring-with-3rd-party
https://eosio.github.io/history-tools/
https://github.com/tmuskal/jsclient-eosio-state-history-plugin

开源EOS浏览器eosweb