【区块链】HyperLedger Besu EthSigner集群服务

这篇具有很好参考价值的文章主要介绍了【区块链】HyperLedger Besu EthSigner集群服务。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

说完了Besu客户端,Tessera隐私交易,是时候也说一下“三剑客”中的最后一位EthSigner。关于EthSigner在《【区块链】HyperLedger Besu Vault密钥服务》一文中稍微有提及过,它主要用作私有链(或联盟链)的区块签署使用的。

之前都没有跟大家详细说一下区块链组件之间是怎么交互的。为了方便说明,我引用官网上用一个隐私交易的交易过程进行说明,如下图:
image.png
从Dapp触发一个隐私交易请求(调用eea_sendTransaction接口)给EthSigner,EthSigner会根据Dapp传送的密钥信息找到链上用户签署密钥。接下来EthSigner会通过调用eea_sendRawTransaction接口将交易数据提交Besu上链,Besu会先判断这个交易是普通交易还是隐私交易,若是隐私交易的情况下会转发给Tessera进行隐私交易存证(对双方交易内容包括账号,数据进行隐私处理)后再回传给Besu进行上链。与此同时EthSigner生成的密钥会对上链区块进行数字封存,至此完成了隐私交易的数据上链。至于节点之间同步的我就不再多说了,看过前几篇文章的同学应该都清楚了。

在这里再补充一点信息,如下图:
image.png
如上图所示,EthSigner并不是必须的区块链组件。若Dapp足够优秀可以直接取代EthSigner,只不过目前“三剑客”组合仍然是官方推荐的实施方案而已。

说了这么多,下面我们就来看一下关于EthSigner的部署吧。由于我已经废弃了Vault方案,因此这里将直接采用本地密钥存储的方案实行。本地签署密钥需要用到nodejs生成,因此要先安装npm和cnpm(这是因为签署密钥需要通过web3.js生成)。

# 安装npm
apt-get install npm

# 安装cnpm
npm config set registry https://registry.npm.taobao.org
npm install -g cnpm --registry=https://registry.npm.taobao.org

在安装cnpm后执行cnpm install web3的时候有机会会报错:

root@node203:~# cnpm install web3
internal/modules/cjs/loader.js:638
    throw err;
    ^


Error: Cannot find module 'fs/promises'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js:10:12)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

这是因为安装的cnpm版本过高引起的,这个时候需要手动降级。先删除原来的版本

root@node203:~# npm uninstall -g cnpm
removed 550 packages in 2.009s

然后重新安装一个低版本即可(我这里安装7.1.0版本)

root@node203:~# npm install cnpm@7.1.0 -g
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/usr/local/bin/cnpm -> /usr/local/lib/node_modules/cnpm/bin/cnpm
npm WARN notsup Unsupported engine for open@8.4.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: open@8.4.0


+ cnpm@7.1.0
added 845 packages from 995 contributors in 17.895s

之后通过cnpm install web3即可完成安装

root@node203:/home/yzh/Documents/blockchain/ethsigner/shell/nodejs# cnpm install web3
✔ Installed 1 packages
✔ Linked 340 latest versions
[1/8] scripts.postinstall web3@1.7.4 › web3-shh@1.7.4 run "echo \"WARNING: the web3-shh api will be deprecated in the next version\"", root: "/home/yzh/Documents/blockchain/ethsigner/shell/nodejs/node_modules/_web3-shh@1.7.4@web3-shh"
WARNING: the web3-shh api will be deprecated in the next version
[1/8] scripts.postinstall web3@1.7.4 › web3-shh@1.7.4 finished in 7ms
[2/8] scripts.install web3@1.7.4 › web3-core@1.7.4 › web3-core-requestmanager@1.7.4 › web3-providers-ws@1.7.4 › websocket@1.0.34 › bufferutil@^4.0.1 run "node-gyp-build", root: "/home/yzh/Documents/blockchain/ethsigner/shell/nodejs/node_modules/_bufferutil@4.0.6@bufferutil"
[2/8] scripts.install web3@1.7.4 › web3-core@1.7.4 › web3-core-requestmanager@1.7.4 › web3-providers-ws@1.7.4 › websocket@1.0.34 › bufferutil@^4.0.1 finished in 744ms
[3/8] scripts.install web3@1.7.4 › web3-core@1.7.4 › web3-core-requestmanager@1.7.4 › web3-providers-ws@1.7.4 › websocket@1.0.34 › utf-8-validate@^5.0.2 run "node-gyp-build", root: "/home/yzh/Documents/blockchain/ethsigner/shell/nodejs/node_modules/_utf-8-validate@5.0.9@utf-8-validate"
[3/8] scripts.install web3@1.7.4 › web3-core@1.7.4 › web3-core-requestmanager@1.7.4 › web3-providers-ws@1.7.4 › websocket@1.0.34 › utf-8-validate@^5.0.2 finished in 741ms
[4/8] scripts.postinstall web3@1.7.4 › web3-bzz@1.7.4 run "echo \"WARNING: the web3-bzz api will be deprecated in the next version\"", root: "/home/yzh/Documents/blockchain/ethsigner/shell/nodejs/node_modules/_web3-bzz@1.7.4@web3-bzz"
WARNING: the web3-bzz api will be deprecated in the next version
[4/8] scripts.postinstall web3@1.7.4 › web3-bzz@1.7.4 finished in 5ms
[5/8] scripts.install web3@1.7.4 › web3-utils@1.7.4 › ethereumjs-util@7.1.5 › ethereum-cryptography@0.1.3 › keccak@^3.0.0 run "node-gyp-build || exit 0", root: "/home/yzh/Documents/blockchain/ethsigner/shell/nodejs/node_modules/_keccak@3.0.2@keccak"
[5/8] scripts.install web3@1.7.4 › web3-utils@1.7.4 › ethereumjs-util@7.1.5 › ethereum-cryptography@0.1.3 › keccak@^3.0.0 finished in 750ms
[6/8] scripts.install web3@1.7.4 › web3-utils@1.7.4 › ethereumjs-util@7.1.5 › ethereum-cryptography@0.1.3 › secp256k1@^4.0.1 run "node-gyp-build || exit 0", root: "/home/yzh/Documents/blockchain/ethsigner/shell/nodejs/node_modules/_secp256k1@4.0.3@secp256k1"
[6/8] scripts.install web3@1.7.4 › web3-utils@1.7.4 › ethereumjs-util@7.1.5 › ethereum-cryptography@0.1.3 › secp256k1@^4.0.1 finished in 740ms
[7/8] scripts.postinstall web3@1.7.4 › web3-core@1.7.4 › web3-core-requestmanager@1.7.4 › web3-providers-ws@1.7.4 › websocket@1.0.34 › es5-ext@^0.10.50 run " node -e \"try{require('./_postinstall')}catch(e){}\" || exit 0", root: "/home/yzh/Documents/blockchain/ethsigner/shell/nodejs/node_modules/_es5-ext@0.10.61@es5-ext"
[7/8] scripts.postinstall web3@1.7.4 › web3-core@1.7.4 › web3-core-requestmanager@1.7.4 › web3-providers-ws@1.7.4 › websocket@1.0.34 › es5-ext@^0.10.50 finished in 376ms
[8/8] scripts.postinstall web3@latest run "echo \"WARNING: the web3-shh and web3-bzz api will be deprecated in the next version\"", root: "/home/yzh/Documents/blockchain/ethsigner/shell/nodejs/node_modules/_web3@1.7.4@web3"
WARNING: the web3-shh and web3-bzz api will be deprecated in the next version
[8/8] scripts.postinstall web3@latest finished in 5ms
✔ Run 8 scripts
anti semver web3@1.7.4 › web3-core@1.7.4 › @types/bn.js@5.1.0 › @types/node@* delcares @types/node@*(resolved as 18.0.3) but using ancestor(web3-core)'s dependency @types/node@^12.12.6(resolved as 12.20.55)
deprecate web3@1.7.4 › web3-bzz@1.7.4 › swarm-js@0.1.40 › mkdirp-promise@^5.0.1 This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
deprecate web3@1.7.4 › web3-eth@1.7.4 › web3-eth-accounts@1.7.4 › uuid@3.3.2 Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
deprecate web3@1.7.4 › web3-eth@1.7.4 › web3-eth-ens@1.7.4 › content-hash@2.5.2 › multicodec@^0.5.5 This module has been superseded by the multiformats module
deprecate web3@1.7.4 › web3-bzz@1.7.4 › swarm-js@0.1.40 › eth-lib@0.1.29 › servify@0.1.12 › request@^2.79.0 request has been deprecated, see https://github.com/request/request/issues/3142
deprecate web3@1.7.4 › web3-eth@1.7.4 › web3-eth-ens@1.7.4 › content-hash@2.5.2 › multihashes@0.4.21 › multibase@^0.7.0 This module has been superseded by the multiformats module
deprecate web3@1.7.4 › web3-bzz@1.7.4 › swarm-js@0.1.40 › eth-lib@0.1.29 › servify@0.1.12 › request@2.88.2 › har-validator@~5.1.3 this library is no longer supported
deprecate web3@1.7.4 › web3-bzz@1.7.4 › swarm-js@0.1.40 › eth-lib@0.1.29 › servify@0.1.12 › request@2.88.2 › uuid@^3.3.2 Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
deprecate web3@1.7.4 › web3-eth@1.7.4 › web3-eth-ens@1.7.4 › content-hash@2.5.2 › cids@^0.7.1 This module has been superseded by the multiformats module
deprecate web3@1.7.4 › web3-eth@1.7.4 › web3-eth-ens@1.7.4 › content-hash@2.5.2 › cids@0.7.5 › multicodec@^1.0.0 This module has been superseded by the multiformats module
deprecate web3@1.7.4 › web3-eth@1.7.4 › web3-eth-ens@1.7.4 › content-hash@2.5.2 › cids@0.7.5 › multibase@~0.6.0 This module has been superseded by the multiformats module
✔ All packages installed (362 packages installed from npm registry, used 6s(network 3s), speed 0B/s, json 0(0B), tarball 0B, manifests cache hit 340, etag hit 0 / miss 0)

再之后就就要安装jq插件。安装jq插件的目的是解析http请求返回使用的,譬如:启动区块链服务后我需要通过curl访问restful接口并解析返回json字符串,这个时候通过jq插件就能够轻松解析出结果,就不需要一层一层去反解返回的json字符串了(因为自己是开发出身,所以不经意会以开发的思路解决问题,如果有更好的解决方式jq插件其实可以不安装)。

root@node203:/home/yzh/Documents/blockchain/ethsigner/shell# apt-get install jq
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libjq1 libonig5
The following NEW packages will be installed:
  jq libjq1 libonig5
0 upgraded, 3 newly installed, 0 to remove and 153 not upgraded.
Need to get 313 kB of archives.
After this operation, 1,062 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.ustc.edu.cn/ubuntu focal/universe amd64 libonig5 amd64 6.9.4-1 [142 kB]
Get:2 http://mirrors.ustc.edu.cn/ubuntu focal-updates/universe amd64 libjq1 amd64 1.6-1ubuntu0.20.04.1 [121 kB]
Get:3 http://mirrors.ustc.edu.cn/ubuntu focal-updates/universe amd64 jq amd64 1.6-1ubuntu0.20.04.1 [50.2 kB]
Fetched 313 kB in 0s (812 kB/s)
Selecting previously unselected package libonig5:amd64.
(Reading database ... 328030 files and directories currently installed.)
Preparing to unpack .../libonig5_6.9.4-1_amd64.deb ...
Unpacking libonig5:amd64 (6.9.4-1) ...
Selecting previously unselected package libjq1:amd64.
Preparing to unpack .../libjq1_1.6-1ubuntu0.20.04.1_amd64.deb ...
Unpacking libjq1:amd64 (1.6-1ubuntu0.20.04.1) ...
Selecting previously unselected package jq.
Preparing to unpack .../jq_1.6-1ubuntu0.20.04.1_amd64.deb ...
Unpacking jq (1.6-1ubuntu0.20.04.1) ...
Setting up libonig5:amd64 (6.9.4-1) ...
Setting up libjq1:amd64 (1.6-1ubuntu0.20.04.1) ...
Setting up jq (1.6-1ubuntu0.20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.7) ...

最后就要准备好一个密钥创建脚本(create_keyfile.js),如下:

var args = process.argv.splice(2);
const Web3 = require('web3');

//Web3初始化(指向JSON-RPC节点)
const web3 = new Web3(new Web3.providers.HttpProvider('http://127.0.0.1:8545'));

var V3KeyStore = web3.eth.accounts.encrypt(args[0], args[1]);
console.log(JSON.stringify(V3KeyStore));
process.exit();

至此全部前期准备都已经做好,接下来可以通过脚本创建用户了。事不宜迟我们可以先写个脚本(ethsigner_run.sh):

# 节点安装路径
deploy_path=/home/yzh/Documents/blockchain/docker/ethsigner
# nodejs生成用户密钥文件路径
createkey_path=/home/yzh/Documents/blockchain/config/ethsigner/nodejs/create_keyfile.js
# ethsigner docker镜像名称
docker_image=consensys/ethsigner:21.10.0
# 签署用户(虚拟账号)生成个数
signer_counter=2000
# 区块链id(可以在创世块配置文件中获取)
chain_id=12345
# 自定义校验节点名称
custom_name=node202_signer
# 校验节点静态ip
ethsigner_ip=192.18.0.212
# 签署节点ip
signer_node_ip=192.18.0.202
# 签署用户(虚拟账号)存档路径
has_users=/home/yzh/Documents/blockchain/config/ethsigner/users
# 分多少个线程并发
thread_num=100

if [ ! -d $deploy_path ]; then

	# 1. 判断是否存在部署目录和是否已经存在用户了
	if [ ! -d $has_users ]; then

		# 临时文件名称
		tmpfifo="tmpfifo"
		mkfifo ${tmpfifo}
		exec 6<>${tmpfifo}
		rm -f ${tmpfifo}

		for ((i = 1; i <= ${thread_num}; i++)); do
			{
				echo
			}
		done >&6

		# 2. 若不存在则创建部署目录和用户目录
		mkdir -p $deploy_path && mkdir -p $deploy_path/signer_address
		mkdir -p $has_users && chmod 777 -R $has_users

		# 3. 将密码信息转换成数组并通过循环读取每一个密码信息
		for ((i = 1; i <= $signer_counter; i++)); do
			{
				read -u6
				{
					echo "Currently $i accounts have been generated"

					# 4. 生成签署账号64位的私钥
					hex_address=$(openssl rand -hex 32)

					# 5. 然后通过执行createkey.js生成密钥信息
					keyfile=$(node $createkey_path "0x"$hex_address $i"_BCA")

					# 6. 通过解析返回的json获取到签署节点的加密密文
					address_val=$(echo $keyfile | jq '.address')
					address_val=$(echo $address_val | sed 's/\"//g')

					# 7. 根据上面收集的内容生成keyFile、passwordFile和配置用的toml文件
					keyFilePath=$deploy_path/$address_val/keyFile
					passwordFilePath=$deploy_path/$address_val/passwordFile
					tomlFilePath=$deploy_path/signer_address/$address_val".toml"

					# 8. 将信息按照要求写入到指定的文件里面,这里需要注意的配置文件中关于路径的写法一定要按照镜像中机器的写法不然是没有找到对应路径的
					mkdir -p $deploy_path/$address_val
					touch $keyFilePath &&  touch $passwordFilePath && touch $tomlFilePath
					chmod 777 -R $deploy_path

					# 9. 将密码写入到passwordFile
					echo -e $i"_BCA" >>$passwordFilePath

					# 10. 将生成的key内容写入keyFile
					echo -e "$keyfile" >>$keyFilePath

					# 11. 将权限配置文件写入toml配置
					echo -e "[metadata]" >>$tomlFilePath
					echo -e "createdAt = $(date "+%Y-%m-%d %H:%M:%S")" >>$tomlFilePath
					echo -e "description = \"$hex_address account configuration\" \n" >>$tomlFilePath
					echo -e "[signing] \ntype = \"file-based-signer\"" >>$tomlFilePath
					echo -e "key-file = \"/var/lib/ethsigner/$address_val/keyFile\"" >>$tomlFilePath
					echo -e "password-file = \"/var/lib/ethsigner/$address_val/passwordFile\"" >>$tomlFilePath
					echo "" >&6
				} &
			}
		done
		wait
		exec 6>&-
		echo "All accounts are generated"

		# 12. 将配置信息进行备份
		find $deploy_path -name "*" -exec cp -rf {} $has_users \;
	else
		mkdir -p $deploy_path
		find $has_users -name "*" -exec cp -rf {} $deploy_path \;

	fi
	# 13. 使用docker来启动eth_signer
	docker run --name $custom_name --network=besu_swarm --ip $ethsigner_ip -p 8945:8545 --mount type=bind,source=$deploy_path,target=/var/lib/ethsigner -d $docker_image --chain-id=$chain_id --downstream-http-host=$signer_node_ip --downstream-http-port=8545 --http-listen-host=0.0.0.0 multikey-signer --directory=/var/lib/ethsigner/signer_address
fi

以上是通过shell模拟多线程执行的脚本用来创建多个区块链签署密钥,脚本上带有注释应该能够看得明白的,但是脚本中关于配置文件的读取其实需要按照一定的规则进行放置,这里由于涉及到不可描述的原因这里就没有提供,并且为了使分享内容不牵扯到知识产权的纠纷问题,脚本内容我也是有做调整。所以脚本不能直接使用,这里只是给各位一个实现思路。

直接执行脚本即可生成本地密钥,如下:

root@node203:/home/yzh/Documents/blockchain/config/ethsigner/shell# ./ethsigner_run.sh 
Currently 1 accounts have been generated
Currently 2 accounts have been generated
Currently 3 accounts have been generated
Currently 4 accounts have been generated
Currently 6 accounts have been generated
Currently 5 accounts have been generated
Currently 7 accounts have been generated
Currently 8 accounts have been generated
Currently 9 accounts have been generated
Currently 10 accounts have been generated
Currently 11 accounts have been generated
Currently 13 accounts have been generated
Currently 15 accounts have been generated
Currently 16 accounts have been generated
Currently 21 accounts have been generated
Currently 17 accounts have been generated
Currently 18 accounts have been generated
Currently 14 accounts have been generated
Currently 19 accounts have been generated
Currently 25 accounts have been generated
Currently 23 accounts have been generated
Currently 28 accounts have been generated
Currently 35 accounts have been generated
Currently 12 accounts have been generated
Currently 22 accounts have been generated
Currently 30 accounts have been generated
Currently 29 accounts have been generated
…… 

由于生成过程采用了快速分片模拟多线程的情况,因此看到的输出不是顺序输出

Currently 1995 accounts have been generated
Currently 1994 accounts have been generated
Currently 1996 accounts have been generated
Currently 1997 accounts have been generated
Currently 1998 accounts have been generated
Currently 1999 accounts have been generated
Currently 2000 accounts have been generated
All accounts are generated
5d17812000e480798ef96264a88df76681d92c3f9db8f0baef81035929a1b589

看到这样输出后证明脚本已经执行完成,这个时候可以通过docker logs -f查看服务的输出情况

root@node203:/home/yzh/Documents/blockchain/config/ethsigner/shell# docker logs -f 5d17812000e4
Setting logging level to INFO
2022-07-07 10:05:08.875+00:00 | main | INFO  | SignerSubCommand | Version = ethsigner/v21.10.0/linux-x86_64/-na-openjdk64bitservervm-java-11
2022-07-07 10:05:09.438+00:00 | main | INFO  | Runner | Server is up, and listening on 8545

看到这样的输出证明启动已经成功。

由于签署密钥还要提供给应用程序(Dapp)使用用于与系统账号绑定,我这边是选择将密钥同步到Redis中由应用程序直接跟Redis对接获取密钥信息,于是我又写了一个shell脚本用于将密钥同步到Redis,如下:

scan_path=/home/yzh/Documents/blockchain/config/ethsigner/users
# redis微服务ip地址和端口
redis_mic_ip=192.168.100.138
redis_mic_port=6379
# 当前节点编码
node_code=YZH

declare -i count=0

# 1. 初始化setup变量为后面拼接字符串做准备
setup=""

# 2. 遍历指定的文件目录获取到所有后缀为toml文件
for file in $(ls $scan_path)
do 
    if [ "${file##*.}" = "toml" ]; then
        param="${file%%.*}"
        
          # 3. 开始拼接字符串
      	setup="$setup $param"
	
      	# 4. 由于redis对于传入参数的长度有限制,因此需要分批进行这里面将按照设定进行计数
      	count=$((${count} + 1))
    fi
   
   	# 5. 每当循环了100次的时候就保存一次到redis中
    if (( $count ==  100 )); then
				docker run --rm --name redis-cli -it goodsmileduck/redis-cli redis-cli -h $redis_mic_ip -p $redis_mic_port RPUSH ETH_ACCOUNTS"_"$node_code $setup
				count=0
				setup=""
    fi
done

这个脚本其实说白了就是将磁盘中的文件读取然后通过redis-cli镜像写入到目标redis里面而已。效果如下:

root@node203:/home/yzh/Documents/blockchain/config/ethsigner/shell# ./setup_account_to_redis.sh 
(integer) 100
(integer) 200
(integer) 300
(integer) 400
(integer) 500
(integer) 600
(integer) 700
(integer) 800
(integer) 900
(integer) 1000
(integer) 1100
(integer) 1200
(integer) 1300
(integer) 1400
(integer) 1500
(integer) 1600
(integer) 1700
(integer) 1800
(integer) 1900
(integer) 2000

执行脚本后就能够在redis客户端中看到数据存储的情况,如下图:
1AA6EAC7-6514-42A6-BC2C-AE8CD3055596.png
至此,Besu区块链的基础组件部署就演示完毕了,接下来就需要看看实际效果了。文章来源地址https://www.toymoban.com/news/detail-422893.html

到了这里,关于【区块链】HyperLedger Besu EthSigner集群服务的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 区块链hyperledger fabric部署

      新建目录、下载、解压 配置环境   将指定版本的 Hyperledger Fabric 平台特定二进制文件和配置文件安装到 fabric-samples 下的  /bin 和  /config  目录中,下载指定版本的 Hyperledger Fabric docker 镜像 2.2.1 配置镜像源 注:以上curl主要是为了获得一个 bootstrap.sh 的脚本文件并执行,可能

    2024年02月11日
    浏览(32)
  • 搭建 Hyperledger Fabric区块链网络

    这里以下载最新版为例,得益于官网文档;网址为:教程 或者使用该命令下载指定版本  wget https://studygolang.com/dl/golang/go1.19.linux-amd64.tar.gz 之后解压到指定文件,一般为 /usr/local/下 ,需要配置环境变量

    2024年01月20日
    浏览(50)
  • Hyperledger Fabric项目搭建区块链浏览器Hyperledger-blockchain-explorer

    区块链浏览器官网:https://github.com/hyperledger/blockchain-explorer 如果虚拟机没有联网,导致下载不下来,也可以前往Fabric-explorer附件下载进行下载,之后在本地根据需要修改,修改后上传到虚拟机 此时目录结构如下图所示 3.1修改test-network.json—— 网络配置文件,包含身份的指定

    2024年02月08日
    浏览(35)
  • 区块链技术和Hyperledger Fabric介绍

    1.1.1 起源 在比特币诞生之时,技术专家们开始研究比特币的底层技术,并抽象提取出来,形成区块链技术,或者称分布式账本技术。 1.1.2 定义 简称BT(Blockchain technology),也称为分布式账本技术,是一种互联网数据库技术,其特点是去中心化、公开透明,让每个人均可参与

    2024年02月22日
    浏览(33)
  • 区块链 2.0:Hyperledger Fabric学习(一)

    参考链接1 操作系统 : Ubuntu 22.04 一、启动命令 1.进入文件夹目录,启动网络(fabric-samples/fabcar) 2.可能错误: 没有配置JAVA_HOME环境变量 使用JAVA 18会出现无法编译的错误,更换为JAVA 8之后成功解决 二、脚本解析

    2024年02月12日
    浏览(28)
  • 【Hyperledger Fabric】学习笔记1—— 区块链介绍

    目录 1. 区块链介绍 1.1 区块链技术起源 1.1.1 区块链技术 1.1.2 区块链技术发展 1.2 区块链核心技术 1.2.1 定义 1.2.2 区块链技术原理 1.2.3 区块链工作过程 1.3 区块链开发平台 1.3.1 公有链平台 1.3.2 联盟链系统 1.3.3 应用场景 1.1.1 区块链技术 1.1.2 区块链技术发展 1.2.1 定义 1.2.2 区块链

    2023年04月23日
    浏览(31)
  • 区块链——Hyperledger Fabric2.2多机搭建及区块链浏览器

    1、设置网络 2、安装docker和docker-compose 3、安装golang环境 1、编写证书文件 2、生成证书文件 3、复制证书文件到节点 1、编写创世块文件 2、生成创世块文件和通道文件 1、生成创世区块 2、生成通道文件 3、为 Org1 定义锚节点 4、为 Org2 定义锚节点 5、将生成的文件拷贝到另两台

    2024年02月11日
    浏览(29)
  • 【跟小嘉学习区块链】二、Hyperledger Fabric 架构详解

    【跟小嘉学习区块链】一、区块链基础知识与关键技术解析 【跟小嘉学习区块链】二、区块链基础知识与关键技术解析 本系列章节主要讲解 Hyperledger 社区、Hyperledger项目、Hyperledger 社区工作流程、Hyperledger Fabric 架构详解 [参考资料] Fabric技术概览 Fabric智能合约 Fabric架构初探

    2024年02月08日
    浏览(28)
  • Hyperledger Fabric explorer区块链浏览器搭建

    https://github.com/hyperledger-labs/blockchain-explorer 官方浏览器的github地址 根据文档,采用docker容器的方法搭建explorer。 根据官方提供的文件,需要创建的目录结构如下: 这是官网提供的模板 这里的organizations就是你搭建区块链网络的证书配置文件crypto-config文件,因为之前的网络创建

    2024年02月11日
    浏览(38)
  • 基于区块链技术的超级账本(Hyperledger) - 从理论到实战

    什么是区块链?简单来说区块链就是一个分布式的记账本,或者分布式的数据库。 区块链的数据结构是一个链表,交易数据被存储到链表的区块中,区块链的第一个区块叫创世区块,除了创世块以外,每个区块还包含前一个区块的哈希指针,这个哈希指针的值是根据前一个区

    2024年01月18日
    浏览(36)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包