EOS智能合约开发(十八)从EOS数据分析history_plugin插件和MongoDB插件区别

EOS数据
从EOS上线一段时间来看,他产生的Block已经远远超过了以太坊。以太坊在交易完成后,很容易过滤出交易信息(如何获取在我之前以太坊文章中有详细描述)。EOS机制与以太坊有却别,EOS如此大的数据量,我们就会问,EOS数据时如何获取,查询。今天我们就这个问题,给大家分析一下。
Data的价值分析
随着区块量各种应用的爆棚,EOS每天增加的用户量上万。我们从https://www.dappradar.com/ 上分析当前DApp排行榜,就可以清查看到目前的热点和应用方向。
EOS智能合约开发(十八)从EOS数据分析history_plugin插件和MongoDB插件区别
如此多的应用,大家非常关心就是,交易数据如何获取。
通过history_plugin插件获取交易数据
在EOSIO的1.3.0版本之前,官方提供文档通过history_plugin插件获取交易历史数据,通过一下配置,可以获取交易历史数据。
如果你想搜集所有的交易信息,包括收集所有traces信息,
我们可以查看V1.1.0版本的官方文档描述
Options

  -f [ --filter-on ] arg                Track actions which match
                                        receiver:action:actor. Actor may be
                                        blank to include all. Receiver and
                                        Action may not be blank.

Config Options for eosio::http_client_plugin:
  --https-client-root-cert arg          PEM encoded trusted root certificate
                                        (or path to file containing one) used
                                        to validate any TLS connections made.
                                        (may specify multiple times)

  --https-client-validate-peers arg (=1)
                                        true: validate that the peer
                                        certificates are valid and trusted,
                                        false: ignore cert errors

可以通过config.ini 文件配置。
需要配置如下插件,配置方式

# config.ini
plugin = eosio::history_plugin

通过启动node节点,通过参数配置如下:

# nodeos startup params
--plugin eosio::history_plugin

如果我们需要收集所有traces信息,那么欢需要在config.ini文件中打开下面配置

# Track actions which match receiver:action:actor. Actor may be blank to include all. Action and Actor both blank allows all from Recieiver. Receiver may not be blank. (eosio::history_plugin)
# filter-on =   //默认
filter-on =*   #打开配置

# Do not track actions which match receiver:action:actor. Action and Actor both blank excludes all from Reciever. Actor blank excludes all from reciever:action. Receiver may not be blank. (eosio::history_plugin)
# filter-out =

# PEM encoded trusted root certificate (or path to file containing one) used to validate any TLS connections made.  (may specify multiple times)
#  (eosio::http_client_plugin)
# https-client-root-cert =