当前位置: 首页 > news >正文

咸宁哪个企业没有做网站外链论坛

咸宁哪个企业没有做网站,外链论坛,深圳市官网网站建设哪家好,外贸建站推广多少钱目录 一、参考文档二、环境依赖三、Fabric源码安装3.1、创建链目录3.2、下载源码3.3、修改安装脚本3.4、开始安装3.4.1、执行安装脚本3.4.2、手动下载ca和二进制配置包 四、启动测试网络五、使用测试网络5.1、创建应用通道5.2、部署链码5.3、发送交易 六、关闭测试网络 一、参考…

目录

  • 一、参考文档
  • 二、环境依赖
  • 三、Fabric源码安装
    • 3.1、创建链目录
    • 3.2、下载源码
    • 3.3、修改安装脚本
    • 3.4、开始安装
      • 3.4.1、执行安装脚本
      • 3.4.2、手动下载ca和二进制配置包
  • 四、启动测试网络
  • 五、使用测试网络
    • 5.1、创建应用通道
    • 5.2、部署链码
    • 5.3、发送交易
  • 六、关闭测试网络

一、参考文档

  • hyperledger超级账本官方文档地址:https://hyperledger-fabric.readthedocs.io/en/release-2.2/

  • hyperledger中文文档:https://hyperledgercn.github.io/hyperledgerDocs/

二、环境依赖

  • ubuntu 20.04.1
  • go version go1.16.3 linux/amd64
  • git version 2.25.1
  • docker 20.10.17
  • docker-compose 1.29.2

三、Fabric源码安装

3.1、创建链目录

mkdir -p $GOPATH/src/github.com/hyperledger

3.2、下载源码

cd $GOPATH/src/github.com/hyperledger
git clone https://gitee.com/hyperledger/fabric.git -b v2.2.0

3.3、修改安装脚本

vim $GOPATH/src/github.com/hyperledger/fabric/scripts/bootstrap.sh
  1. https://github.com/hyperledger/fabric-samples.git 修改为 https://gitee.com/hyperledger/fabric-samples.git
  2. 注释 pullBinaries

3.4、开始安装

3.4.1、执行安装脚本

cd $GOPATH/src/github.com/hyperledger/fabric/scripts/
./bootstrap.sh

若报错:

Pull Hyperledger Fabric docker imagesFABRIC_IMAGES: peer orderer ccenv tools nodeenv baseos javaenv
===> Pulling fabric Images
====> hyperledger/fabric-peer:2.2.0
Error response from daemon: error parsing HTTP 408 response body: invalid character '<' looking for beginning of value: "<html><body><h1>408 Request Time-out</h1>\nYour browser didn't send a complete request in time.\n</body></html>\n"
Error response from daemon: No such image: hyperledger/fabric-peer:2.2.0
Error response from daemon: No such image: hyperledger/fabric-peer:2.2.0
====> hyperledger/fabric-orderer:2.2.0
2.2.0: Pulling from hyperledger/fabric-orderer
error parsing HTTP 408 response body: invalid character '<' looking for beginning of value: "<html><body><h1>408 Request Time-out</h1>\nYour browser didn't send a complete request in time.\n</body></html>\n"
Error response from daemon: No such image: hyperledger/fabric-orderer:2.2.0
Error response from daemon: No such image: hyperledger/fabric-orderer:2.2.0
====> hyperledger/fabric-ccenv:2.2.0

则尝试调整/etc/docker/daemon.json

{"registry-mirrors": ["http://hub-mirror.c.163.com","https://registry.docker-cn.com","https://docker.mirrors.ustc.edu.cn"]
}
sudo systemctl daemon-reload
sudo systemctl restart docker

3.4.2、手动下载ca和二进制配置包

下载bootstrap.sh中指定的对应版本ca和二进制配置的包:

# VERSION=2.2.0
wget https://github.com/hyperledger/fabric/releases/download/v2.2.0/hyperledger-fabric-linux-amd64-2.2.0.tar.gz
# CA_VERSION=1.4.7
wget https://github.com/hyperledger/fabric-ca/releases/download/v1.4.7/hyperledger-fabric-ca-linux-amd64-1.4.7.tar.gz

复制到fabric-samples目录:

tar -zxvf hyperledger-fabric-linux-amd64-2.2.0.tar.gz
tar -zxvf hyperledger-fabric-ca-linux-amd64-1.4.7.tar.gz
cp -r bin fabric-samples/
cp -r config fabric-samples/

四、启动测试网络

cd $GOPATH/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network
# cryptogen启动方式
./network.sh up
# ca-server启动方式
# ./network.sh up -ca

日志:

Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' with crypto from 'cryptogen'
LOCAL_VERSION=2.2.0
DOCKER_IMAGE_VERSION=2.2.0
/usr/local/software/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network/../bin/cryptogen
Generating certificates using cryptogen tool
Creating Org1 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output=organizations
org1.example.com
+ res=0
Creating Org2 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output=organizations
org2.example.com
+ res=0
Creating Orderer Org Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output=organizations
+ res=0
Generating CCP files for Org1 and Org2
/usr/local/software/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network/../bin/configtxgen
Generating Orderer Genesis block
+ configtxgen -profile TwoOrgsOrdererGenesis -channelID system-channel -outputBlock ./system-genesis-block/genesis.block
2023-11-01 16:23:18.229 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2023-11-01 16:23:18.244 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: etcdraft
2023-11-01 16:23:18.244 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216 
2023-11-01 16:23:18.244 CST [common.tools.configtxgen.localconfig] Load -> INFO 004 Loaded configuration: /usr/local/software/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network/configtx/configtx.yaml
2023-11-01 16:23:18.246 CST [common.tools.configtxgen] doOutputBlock -> INFO 005 Generating genesis block
2023-11-01 16:23:18.247 CST [common.tools.configtxgen] doOutputBlock -> INFO 006 Writing genesis block
+ res=0
Creating network "fabric_test" with the default driver
Creating volume "docker_orderer.example.com" with default driver
Creating volume "docker_peer0.org1.example.com" with default driver
Creating volume "docker_peer0.org2.example.com" with default driver
Creating peer0.org1.example.com ... done
Creating orderer.example.com    ... done
Creating peer0.org2.example.com ... done
Creating cli                    ... done
CONTAINER ID   IMAGE                               COMMAND             CREATED         STATUS                  PORTS                                                                                                NAMES
677082ab5dc4   hyperledger/fabric-tools:latest     "/bin/bash"         1 second ago    Up Less than a second                                                                                                        cli
9e567df423f2   hyperledger/fabric-peer:latest      "peer node start"   3 seconds ago   Up 1 second             0.0.0.0:9051->9051/tcp, :::9051->9051/tcp, 7051/tcp, 0.0.0.0:19051->19051/tcp, :::19051->19051/tcp   peer0.org2.example.com
30248ff4a8c7   hyperledger/fabric-orderer:latest   "orderer"           3 seconds ago   Up Less than a second   0.0.0.0:7050->7050/tcp, :::7050->7050/tcp, 0.0.0.0:17050->17050/tcp, :::17050->17050/tcp             orderer.example.com
884783874fcc   hyperledger/fabric-peer:latest      "peer node start"   3 seconds ago   Up 1 second             0.0.0.0:7051->7051/tcp, :::7051->7051/tcp, 0.0.0.0:17051->17051/tcp, :::17051->17051/tcp             peer0.org1.example.com

看到docker的2个peer节点容器、1个orderer节点容器和客户端tools容器都正常运行,测试网络启动成功。

五、使用测试网络

5.1、创建应用通道

使用network.sh脚本在org1和org2之间创建通道并加入他们的对等节点,执行以下命令创建一个通道:

./network.sh createChannel -c mychannel

5.2、部署链码

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-java -ccl java

5.3、发送交易

配置环境变量:

cd $GOPATH/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-networkexport PATH=${PWD}/../bin:$PATH
# 该目录下包含peer节点的core.yaml
export FABRIC_CFG_PATH=$PWD/../config/# 客户端连接peer0
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=localhost:7051

发交易,初始化资产(调用链码的初始化方法InitLedger):

peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"InitLedger","Args":[]}'

查询初始化后的资产(调用链码的GetAllAssets方法):

peer chaincode query -C mychannel -n basic -c '{"Args":["GetAllAssets"]}'

六、关闭测试网络

./network.sh down
http://www.hkea.cn/news/337754/

相关文章:

  • 网站建设评价东莞谷歌推广
  • php网站后台进不去百度推广入口官网
  • 个人网站一键生成免费推广网站有哪些
  • 厦门做网站设计电商seo优化
  • wordpress视频点播seo技术是干什么的
  • 网站推广是怎么做的网络营销专业如何
  • 平面设计线上兼职上海网站seo
  • 个性化网站定制价格今日热点
  • 做网站的艰辛免费个人网站申请
  • 网站改版需要多久网站设计与制作毕业论文范文
  • 深圳横岗网站建设网站建设的推广渠道
  • 有没有什么网站免费做名片2023年新闻小学生摘抄
  • 新网金商网站外链查询工具
  • 网站建设的进度竞价托管选择微竞价
  • 网站快速网站推广怎么做一个公司网站
  • 旅游网站模板htmlseo品牌优化整站优化
  • 方圆网站建设aso优化重要吗
  • 做购实惠网站的意义好用的搜索引擎有哪些
  • 怎么把自己笔记本做服务器做个网站搭建网站基本步骤
  • jeecms做企业网站成都网站建设公司排名
  • 沈阳招聘网站开发地推项目平台
  • 798艺术区成都seo达人
  • 平度网站建设抖音代运营收费详细价格
  • 株洲网站优化找哪家seo优化的价格
  • 找印度人做网站sem竞价推广公司
  • 山西网站推广公司网站关键词优化怎么弄
  • 微信分销是什么重庆优化seo
  • 武汉企业网站推广方案永久免费无代码开发平台网站
  • 网站开发岗位群怎样推广产品
  • 桐城市美丽乡村建设专题网站石家庄整站优化技术