【区块链】HyperLedger Besu Alethio区块浏览器

资讯 2024-06-20 阅读:20 评论:0
上一节我们已经完成了整个Besu区块链网络的搭建,...
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

上一节我们已经完成了整个Besu区块链网络的搭建,本章将介绍通过Alethio区块链浏览器对上链数据进行查看和校验。同时,由于Besu区块链是可以通过EthSigner来实现带权限(token)访问的,那么在权限访问下还需要添加explorer-besu-plugin来实现,这个也会在本节中一并叙述。

In the previous section, we have completed the construction of the entire Besu block chain network xff0c; this chapter will describe the viewing and validation of the upper chain data through the ALETHio block chain browser. xff0c; since the Besu block chain can be accessed through EthSigner xff08; token) visited xff0c; then an explorer-besu-plugin to xff0c; this will also be described in this section.

Alethio浏览器

上面提到的Alethio区块链浏览器其实是一个专门用于以太坊区块链实现可视化的交互平台,全称(以下简称“AELE”)。

The above-mentioned Alethio block chain browser is in fact an interactive platform dedicated to visualization in the Taiwan block chain & #xff0c; full & #xff08; hereinafter referred to as “AELE” & #xff09;

有浏览过的小伙伴应该都清楚AELE是Besu官方推荐的以太浏览器,它开源且界面支持中文这对于中国地区开发者算是相当友好了(连在线翻译的工作都可以省了),并且不用过多的配置可以说说是“开箱即用”级别的了推荐各位使用。

The small partners who have been viewed should be aware that AELE is an official Besu-recommended Ether Browser & #xff0c; that its open source and interface to support Chinese is quite friendly to Chinese district developers & #xff08; that even online translation can save & #xff09; #xff0c; and that it can be used by those recommended at the “open box or use” level without too much configuration.

image.png
接下来将分别讲述“不带token”和“带token”的两种实现方式。

2; 6bn_ 61; 2& 6bw_6e_61;

不带token

或许有小伙伴会问,为什么还会有不带token的解决方案呢?基于平台或者系统层面Besu私有链(或联盟链)应“受限访问”才能保证接入安全,关于这点我主要有以下3点考虑:

There may be small partners asking xff0c; why there are solutions without token xff1f; besu-based private chain xff08 at the platform or system level; or Union chain xff09; “limited access” to ensure access xff0c; I have three main considerations xff1a;

  1. 若只是说“访问白名单”功能的话,建议是在服务器层面进行设定而不是直接在区块链节点中做设定。这是考虑到商业使用前提下宿主机本来就存在访问策略。只需要统一管理即可不需要又另外设定徒增运维难度;
  2. 由于数据上链都需要先经过EthSigner校验token的有效性,在分布式高并发下网络开销可能会造成性能问题。即使不考虑网络因素,EthSigner节点使用“多租户”模式下也会受制于本地硬件性能(这里跟我使用本地密钥存储方式有关,会产生大量磁盘IO引起性能问题,不过可以通过使用固态硬盘来解决这个问题,只不过成本略高)。
  3. 获取token进行交易一般是在“隐私交易”场景下作为安全防御机制使用,若不涉及隐私交易的情况下可忽略这部分功能(坦白说,隐私交易这种业务场景非常少,因为需要企业具备资质才能做,并且区块链“受信”问题几乎是无解的。即使你的区块链技术能够公开且通过第三方安全审查,但仍有可能达不到“受信”的要求,至于个中原因相信大家应该懂的)。

回归主题…因此这里其实可以直接使用Besu官方的解决方案 alethio/ethereum-lite-explorer:latest 来部署区块链浏览器。

The theme of return... so it's actually possible to deploy block-chain browsers using the official Besu solution aethio/etheium-lite-explorer:latest.

还是老样子,先下载最新的镜像:

Still the same #xff0c; downloading the latest mirror #xff1a;

 

接着就能够根据以下命令创建

Then it can be created according to the following command:

 

启动之后访问 http://192.168.200.206/ 就能够看到效果了,如下图所示
1.png

will be able to see effects xff0c;

带token

那带token的时候要怎么做呢?为什么我按照网上说的做但是无法登录的呢?为什么alethio/ethereum-lite-explorer整合插件不成功的呢?… 那是因为网上说的都只说了一半,哪怕是Besu官网。

What do you do with token? #xff1f; why do I do what I say on the Internet but can't log in? #xff1f; why does the aethio/etheium-lite-explorer integration plugin not work? #xff1f;...that's because what I say on the Internet is only half #xff0c; even the Besu network.

首先这个时候我们就按照Besu官方说的那样直接使用版本了。为什么?因为区块链,需要账号登录拿到后方可操作,一般的AELE是不带Header访问的因此无法使用。怎么办呢?那就看一下AELE的Github文档是怎样解决这个问题吧。

First of all, we're using the version directly, as Besu officially said. Why xff1f; because the block chain xff0c; because account login is required to operate xff0c; the normal AELE is not accessible without Header and therefore is not available. What should we do? xff1f; then look at AE's Github file.

image.png

如上图所示,我们若要访问带权限的区块链系统需要增加一个验证身份的插件,在AELE处理eth-lite之前就需要先做身份验证。下方还给了个Besu插件的例子连接。如下图所示:

xff0c, as shown in the figure above; we need to add an identification plugin xff0c to our access to the section chain system with access rights; we need to authenticate before AELE processeth-lite. An example link to the Besu plugin is given below. xff1a, as shown in the figure below;

image.png

按上图所述,的确是存在针对besu私有链登录的插件

& #xff0c as shown above; there are plugins for besu private chain login

image.png

并且这里已经给出配置例子,。

And here's an example of configuration #xff0c;

image.png

接着还要更新eth-lite的适配器项,。

This will be followed by the updating of the eth-lite adaptor & #xff0c;

image.png
最后给出了在Docker中运行的启动用脚本,这里主要说的是让我们另外开一个config.json文件在docker run语句中进行挂载(-v),用这个新建config.json文件覆盖掉容器中的config.json文件。同时,我们也留意到这里让我们pull的docker镜像是,那事不宜迟就先pull镜像。

image.png

在docker hub中只有latest和1.0.3版本,在这里我们选择的是1.0.3版本。如果使用的是latest版本无论config.json怎样修改都会报错,哪怕按照我以下将要说明的方式去改也会报错,但是1.0.3就不会(实践出真知,踩过的坑不想别人再踩了)。

Only latest and 1.0.3 & #xff0c in the docker hb; here we choose version 1.0.3. If a latest version is used, regardless of config.json's modification, it's wrong xff0c; it's wrong xff0c; but it's not ff08; practice is true ff0c; the pedested pit does not want anyone to step on ff09;

image.png
这个时候可能就会有小伙伴会问,我都不知道config.json文件怎么写,那应该怎么修改才对呢?

image.png

哦,原来config.json是从config.default.json演变过来的。那直接将config.default.json拷贝过去改名就可以了。

Oh #xff0c; former config.json evolved from config.default.json. That's a direct copy of config.default.json's name.

image.png

这种做法不能说不对,但是可以有更好的办法…最好的做法当然是直接从镜像中拷贝出来。先从docker hub中将1.0.3的镜像下载下来后先简单的运行一次。

This doesn't mean wrong #xff0c; but there's a better way... the best thing is to copy it directly from the mirror. Download the 1.03 mirror from the docker hub and run it once.

 

然后使用docker cp命令将镜像内的config.json文件拷贝到本地。

Then use the docker cap command to copy the config.json file in the mirror to the local site.

 

在这个基础上进行loginUrl和nodeUrl的修改,如下图所示:

On this basis, changes to loginUrl and nodeUrl xff0c; xff1a as shown in the figure below;

image.png

由于这个AELE是部署在我本机不是CentOS中因此ip为92.168.1.164。所有内容修改完成后就可以启动AELE镜像

Since this AELE is deployed on my current plane, not on Centos, the ip is 92.168.1.164. The AELE mirror can be activated once all content changes have been completed.

 

由于是映射80端口,所以直接通过localhost进行访问,如下图:

As it is a map of 80 ports & #xff0c; direct access via localhost & #xff0c; figure #xff1a below;

2.png

访问时会让输入用户名和密码,这里输入创建的用户名和密码即可。进入后就能够正常访问了,如下图:

Access will allow the username and password to be entered xff0c; this is enough to enter the username and password created. Access will allow normal access to xff0c; chart xff1a below;

image.png

为了验证区块链的可用性,我们使用Postman调用一下Besu区块上链API操作,稍微写个Java工具将字符串转换成16进制的hex编码(这里有点懒了,其实可以直接用httpclient写个调用就可以了,ε=(′ο`*)))唉),如下图:

In order to verify the availability of block chains & #xff0c; we use Postman to call the upper chain of the Besu block API & #xff0c; slightly write a Java tool to convert the string into a hexadecimal hex code & #xff08; there's a bit of xff0c; it's actually possible to write a call directly from httpclitt ff0c;#61;xff40;*) xff09;xff0c; and #xff1a below;

image.png

如上图所示,得到的编码为之后通过JSON RPC接口发起了区块链的上链操作,如下图:

xff0c, as shown in the figure above; the code obtained is that the upper chain operation of the block chain was subsequently launched through the JSON RPC interface xff0c; the following figure xff1a;

image.png

最终得到tx码返回。,我们将这段tx码拷贝到AELE中通过查询定位到区块内容。如下图:

& #xff0c; we'll copy this tx code into AELE and locate it to block content by query.

image.png

如上图所示,AELE得知区块链刚刚发生了一次事务提交,在区块中存在数据(INPUT DATA)

xff0c, as shown in the figure above; AELE learned that a service had just been submitted to xff0c; data existed in blocks xff08; INPUT DATA)

至此数据上链简单验证完毕。

The data chain is simply validated.

有小伙伴也许会问,为什么上图中显示交易GAS PRICE是0Gwei?大家还记得在《【区块链】HyperLedger Besu集群服务》一文中奖min-gas-price设置为0么,就是在那时候设置上链无需费用,这也是算PoA(权威证明)的一种特色吧,如下图:

xff0c may be asked by a small partner; why the trade in GAS PRICE is 0Gwei? in the above figure; remember the Min-gas-price set to 0 in the HyperLedger Besu Cluster Services in the [block chain] & #xff0c; i.e. xff0c; this is also PoA( #xff09; a special feature of #xff0c; #xff1a below;

image.png

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • DDO在新加坡上市真假,欧意交易所能交易数字期权吗?

    DDO在新加坡上市真假,欧意交易所能交易数字期权吗?
    然而,对于DDO在新加坡的列名是否真实存在争议。 据报道,有人质疑DDO的数字选项是否真的上市,其背景是否经过了彻底调查。 首先,有报告说,DDO数字选项清单仅仅是一种宣传手段,没有找到DDO交易的平台,这就对DDO的真正清单提出了疑问。 其次,一些媒体调查了DDO数字选项的背景。 报告显示DDO数字选项发行人声称其数字选项是国家赞助的,但实际上,根据中国人民银行,虚拟货币相关业务是非法金融活动。 此外,DDO数字选项在视频号码等平台上广为传播,吸引了许多信徒的注意,然...
  • Griffin Gaming Partners计划为其第三支基金筹集5亿美元

    Griffin Gaming Partners计划为其第三支基金筹集5亿美元
    Pitchbook引用的6月8日《快链头条新闻》作为监管文件, 指出游戏风险投资公司Griffin赌博伙伴计划为其第三个旗舰基金筹集5亿美元, 比第二个基金少33%。 2021年,格里芬赌博伙伴从Web3游戏开发者Forte获得A回合资金1.85亿美元,并于2022年筹集了第二个旗舰基金,金额达7.5亿美元,此时风险资本家对Web3和加密游戏的热情达到顶峰。...
  • 比过山车还狠!比特币价格再次暴跌

    比过山车还狠!比特币价格再次暴跌
      上周日,比特币的价格创造了3000美元的历史新高,随后就开始各种高台跳水了。Last Sunday, the price of Bitcoin created a record high of $3,000, and then began to dive on all the high platforms.   据外媒报道,本周一,比特币价格一度下跌到2526.4美元,最高跌幅高达14.5%,这创造了2015年1月以来最大跌幅。According to external...
  • 加密货币之王重回王位:比特币飙升至 71,000 美元,还能再涨多少?

    加密货币之王重回王位:比特币飙升至 71,000 美元,还能再涨多少?
    比特币是市场上最大的加密货币,它再次打破了重要的7万美元门槛。 在短短的四舍五入(67,000美元到69,000美元之间)之后,价格在这一水平上遇到了强烈的抵制。 然而,势头的不断增强表明,比特币可能形成一个超过70 000美元的板块,为重新测试下一个抵抗阵地71 300美元和3月份可能攀升到历史最高点73 700美元铺平了道路。 问题仍然是:比特币能否维持预期的上升趋势并继续大幅上升?    分析家预计比特币价格将上升到74,400美元。 加密货币分析师Ali M...
  • 几张图看懂区块链技术到底是什么?https://www.cnblogs.com/behindman/p/8873191.html

    几张图看懂区块链技术到底是什么?https://www.cnblogs.com/behindman/p/8873191.html
    “区块链”的概念可以说是异常火爆,好像互联网金融峰会上没人谈一谈区块链技术就out了,BAT以及各大银行还有什么金融机构都在开始自己的区块链研究工作,就连IBM最近也成立了自己的区块链研究实验室,但其实区块链到底是什么?大家或许并不清楚,停留在雾里看花的状态。从今天开始,就让我们一起走进区块链,揭开区块链的神秘面纱吧!The concept of a block chain can be described as an unusually hot one, as if no...
标签列表