×
Array
(
[fid] => 6980
[description] =>
[password] =>
[icon] =>
[redirect] =>
[attachextensions] =>
[creditspolicy] => Array
(
[post] => Array
(
[usecustom] => 1
[cycletype] => 1
[cycletime] => 0
[rewardnum] => 75
[extcredits1] => 0
[extcredits2] => 0
[extcredits3] => 0
[extcredits4] => 0
[extcredits5] => 0
[extcredits6] => 0
[extcredits7] => 0
[extcredits8] => 0
[rid] => 1
[fid] => 6980
[rulename] => 发表主题
[action] => post
[fids] => 32,52,67,447,1120,1151,1156,6750,6762,6763,6766,6769,6772,6773,6787,6796,6808,6809,6810,6813,6814,6820,6829,6830,6846,6856,6864,6865,6827,6930,6931,6776,6858,6880,6764,6932,6871,6758,6905,1116,6788,6812,6798,6736,6759,6842,6966,6767,6828,6924,6935,6936,6938,6940,6941,6826,6909,6803,6919,6911,6908,6881,6920,6912,6913,6921,6925,6922,6789,6818,6819,6872,6928,6969,6889,6888,6917,6939,6947,6961,6937,6943,6970,6869,6900,6902,6783,6817,1111,6870,6821,6951,6876,6952,6954,6960,6942,6910,6949,6962,6963,6964,6927,6926,6973,6728,6929,6874,6894,6896,6885,6857,6868,1113,6778,56,6844,6878,6802,6933,6811,6923,6877,6875,6918,6892,6757,6832,6833,6795,6793,6848,6837,6849,6850,6851,6852,6853,6854,6863,6882,6836,6790,6838,6794,6791,6873,555,6895,6934,6958,6944,6945,6907,6779,6886,6950,6904,6956,6862,6957,6855,6955,6959,6914,6965,6971,6972,6953,6975,6976,6799,6974,6824,6815,6891,6866,6979,6977,6765,6903,6948,6845,6879,1121,6980
)
[reply] => Array
(
[usecustom] => 1
[cycletype] => 4
[cycletime] => 0
[rewardnum] => 0
[extcredits1] => 0
[extcredits2] => 0
[extcredits3] => 0
[extcredits4] => 0
[extcredits5] => 0
[extcredits6] => 0
[extcredits7] => 0
[extcredits8] => 0
[rid] => 2
[fid] => 6980
[rulename] => 发表回复
[action] => reply
)
[digest] => Array
(
[usecustom] => 1
[cycletype] => 4
[cycletime] => 0
[rewardnum] => 0
[extcredits1] => 0
[extcredits2] => 0
[extcredits3] => 0
[extcredits4] => 0
[extcredits5] => 0
[extcredits6] => 0
[extcredits7] => 0
[extcredits8] => 0
[rid] => 3
[fid] => 6980
[rulename] => 加精华
[action] => digest
)
)
[formulaperm] => a:5:{i:0;s:0:"";i:1;s:0:"";s:7:"message";s:0:"";s:5:"medal";N;s:5:"users";s:0:"";}
[moderators] =>
[rules] =>
[threadtypes] => Array
(
[status] => 1
[required] => 0
[listable] => 0
[types] => Array
(
)
)
[threadsorts] => Array
(
)
[viewperm] =>
[postperm] =>
[replyperm] =>
[getattachperm] =>
[postattachperm] =>
[postimageperm] =>
[spviewperm] =>
[seotitle] =>
[keywords] =>
[seodescription] =>
[supe_pushsetting] =>
[modrecommend] => Array
(
[open] => 0
[num] => 10
[imagenum] => 0
[imagewidth] => 300
[imageheight] => 250
[maxlength] => 0
[cachelife] => 0
[dateline] => 0
)
[threadplugin] => Array
(
)
[replybg] =>
[extra] => a:2:{s:9:"namecolor";s:0:"";s:9:"iconwidth";s:0:"";}
[jointype] => 0
[gviewperm] => 0
[membernum] => 0
[dateline] => 0
[lastupdate] => 0
[activity] => 0
[founderuid] => 0
[foundername] =>
[banner] =>
[groupnum] => 0
[commentitem] =>
[relatedgroup] =>
[picstyle] => 0
[widthauto] => 0
[noantitheft] => 0
[noforumhidewater] => 0
[noforumrecommend] => 0
[livetid] => 0
[price] => 0
[fup] => 6974
[type] => sub
[name] => 币圈资讯
[status] => 1
[displayorder] => 0
[styleid] => 0
[threads] => 84891
[posts] => 84962
[todayposts] => 0
[yesterdayposts] => 0
[rank] => 56
[oldrank] => 56
[lastpost] => 2760085 The Smarter Web Company 筹集 500 万美元,用于增持比特币 1756189025 比推快讯
[domain] =>
[allowsmilies] => 1
[allowhtml] => 1
[allowbbcode] => 1
[allowimgcode] => 1
[allowmediacode] => 0
[allowanonymous] => 0
[allowpostspecial] => 1
[allowspecialonly] => 0
[allowappend] => 0
[alloweditrules] => 0
[allowfeed] => 0
[allowside] => 0
[recyclebin] => 1
[modnewposts] => 0
[jammer] => 0
[disablewatermark] => 0
[inheritedmod] => 0
[autoclose] => 0
[forumcolumns] => 0
[catforumcolumns] => 0
[threadcaches] => 0
[alloweditpost] => 1
[simple] => 16
[modworks] => 0
[allowglobalstick] => 1
[level] => 0
[commoncredits] => 0
[archive] => 0
[recommend] => 0
[favtimes] => 0
[sharetimes] => 0
[disablethumb] => 0
[disablecollect] => 0
[ismoderator] => 0
[threadtableid] => 0
[allowreply] =>
[allowpost] =>
[allowpostattach] =>
)
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 分钟
本月在线: 分钟
|
|
前言
随着区块链技术的不断发展和应用落地,大众逐步加深了对区块链技术的认识。我们都知道,区块链具有可追溯、不可篡改等技术特点,那么链上的数据如何查询、溯源呢?这就是我们今天要分享的主角—区块链浏览器。
区块链浏览器:是链上数据可视化的主要窗口,是提供用户浏览与查询区块链所有信息的工具。借助这一窗口,如区块信息、交易信息、账户信息等重要的加密数据得以直观呈现。因此,区块链浏览器对于区块链使用者而言至关重要。以目前国外开源区块链项目以太坊为例,其社区开源浏览器Etherscan承载大量用户流量,是分析链上行为最便捷的工具。

本文将从区块链浏览器研发实操经验切入,与大家交流如何快速构建一个区块链浏览器。
浏览器可以呈现什么?
通过分析一些开源浏览器,我们总结出区块链浏览器展示的典型区块链信息如下几类:
- 区块高度
- 交易数
- 交易趋势
- 区块列表
- 最近交易列表等
浏览器数据可以直接获取吗?
通常,区块链提供必要的链SDK信息,用以帮助开发者获取链上区块和交易数据,但是其提供的接口往往是基础性的,例如如何获取区块高度、获取某个区块详情、获取某个交易详情等,这些数据直接对应了页面上的区块列表、区块详情、交易详情等基础数据,无法直接通过链SDK获取浏览器所需的的全量信息。
为此,一个好的区块浏览器是需要支持在本地进行链上数据的加工与处理。
首先,通过对不同区块链底层的区块和交易数据等进行监听,当链上产生新区块时,监听系统可通过链SDK第一时间获取该区块的信息;随后,系统将相关数据进行缓存入库,按需设计多种统计逻辑以完成数据的加工统计。因此,区块链浏览器页面上的数据并非直接通过链上SDK直接请求获取,而是源于本地的列表数据和统计数据。
较于通用的直接通过链SDK获取的模式,我们更需要的是一个通过本地缓存区块数据并且加工链上数据的方式来显著提升前端对区块链浏览器数据获取速度,但对于这一方案读者可能会产生两个质疑:
针对质疑一,显然这个时差主要源于本地定时获取链上数据的频率,因此通过控制频率范围在合理范围内,就可以实现极短的延时,基本不会影响用户使用浏览器的性能体验。而针对质疑二是本方案中研发设计人员需要重点关注并解决的。
如何保障数据真实有效?
实际上,为了确保数据浏览器数据的真实性,区块浏览器需要增加数据校验模块,即用户可以通过简单的接口调用与区块链进行交互,快速验证数据的真实性。例如,上述校验模块中接口主要包括如下功能:
|
|
|
|
|
|
|