Giter VIP home page Giter VIP logo

wefantasy / fabriclearn Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 17.0 17.03 MB

本项目虚拟了一个工作室联盟链需求并将逐步实现,致力于提供一个易理解、可复现的Fabric学习项目,其中项目部署步骤的各个环节都拆解至清晰可见,并且将所有实验打包为脚本使之能够被快速复现在任何一台具备基础环境的主机上。

Home Page: https://ifantasy.net/tags/fabriclearn/

Shell 67.38% Go 32.62%
golang hyperledger-fabric

fabriclearn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fabriclearn's Issues

2_FabricNetworkUpdate 案例中 fabric-contract-api-go v1.1.1 加载失败

background

无法在 arm64 环境中启动 CA 容器

goal

一个 鲲鹏架构主机中可以快速检验 HLF 智能合约的环境

error

根据提示: [如何用 peer channel 替代 osnadmin 完成通道加入?](#3 (comment))
切换为使用 peer channel 指令的案例:
2_FabricNetworkUpdate

但是, 在最后尝试使用 6_ContractGatewayAndSDK 中提供的 chinacode: contract 时出错,

在 ~/.bashrc 中追加代理配置:

export GO111MODULE=on
export GOPROXY=https://proxy.golang.com.cn,direct
export GO_SOURCE_URL=https://github.com/golang/go.git

然后, 删除 go.mod, go.sum
重建新路径中的 mod

$ go mod init
$ go mod tidy

go: finding module for package github.com/hyperledger/fabric-contract-api-go/contractapi
go: downloading github.com/hyperledger/fabric-contract-api-go v1.1.1
go: found github.com/hyperledger/fabric-contract-api-go/contractapi in github.com/hyperledger/fabric-contract-api-go v1.1.1
go: github.com/hyperledger/[email protected] requires
        github.com/cucumber/[email protected]/go.mod: verifying module: checksum mismatch
        downloaded: h1:FQ2MobPXycdSajAK3inNgLSAKGFmZqbE4S/CExz41Ys=
        sum.golang.org: h1:Cp3tEV1LRAyH/RuCThcxHS/+9ORZ+FMzPva2AZ5Ki+A=

SECURITY ERROR
This download does NOT match the one reported by the checksum server.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

For more information, see 'go help module-auth'.

发生认证失败...
这应该是 fabric-contract-api-go 模块的问题?

无法在 arm64 环境中启动 CA 容器

background

之前都是在 intel 芯片环境中进行的,
最近被迫要在 鲲鹏架构 arm64 环境中进行,
有很多不同;

$ neofetch
            .-/+oossssoo+/-.               ...
        `:+ssssssssssssssssss+:`           --------------------
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 18.04.6 LTS aarch64
    .ossssssssssssssssssdMMMNysssso.       Host: OpenStack Nova 13.2.1-20220425155324_61248d6
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 4.15.0-188-generic
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 37 days, 20 hours, 6 mins
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 994
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 4.4.20
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Terminal: /dev/pts/0
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   CPU: (4)
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   GPU: Red Hat, Inc. Virtio GPU
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Memory: 452MiB / 7974MiB
.ssssssssdMMMNhsssssssssshNMMMdssssssss.
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
  +sssssssssdmydMMMMMMMMddddyssssssss+
   /ssssssssssshdmNNNNmyNMMMMhssssss/
    .ossssssssssssssssssdMMMNysssso.
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.

goal

系统资源不够, 想精简实验网络为:

  • council 组织
    • ca +1
    • orderer +3
  • soft 组织
    • ca +1
    • peer +1

0_Restart.sh 也修订启动指令为

docker-compose -f $LOCAL_ROOT_PATH/compose/docker-compose.yaml up -d council.ifantasy.net soft.ifantasy.net

error

FabricLearn/6_ContractGatewayAndSDK$ ./0_Restart.sh
820002e25d32
de75eec7ccbf
820002e25d32
de75eec7ccbf
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.

Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
[+] Running 2/2
 ⠿ Container council.ifantasy.net  Started                                                                                                                2.0s
 ⠿ Container soft.ifantasy.net     Started

看起来一切正常,
但是, $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

没有启动起来任何容器
但是, 相关认证看起来已经生成:
FabricLearn/6_ContractGatewayAndSDK$ sudo tree orgs/

guess

为此准备好的所有镜像

$docker images

REPOSITORY                          TAG            IMAGE ID       CREATED       SIZE
hyperledger/fabric-couchdb          arm64-0.4.22   284ed5657573   2 weeks ago   469MB
hyperledger/fabric-couchdb          latest         284ed5657573   2 weeks ago   469MB
srikanthkarre/fabric-couchdb        arm64-0.4.22   284ed5657573   2 weeks ago   469MB
hyperledger/fabric-ca               arm64-1.5.2    8aca3a668cbe   3 weeks ago   69.9MB
hyperledger/fabric-ca               latest         8aca3a668cbe   3 weeks ago   69.9MB
srikanthkarre/fabric-ca-1.5.2       arm64-1.5.2    8aca3a668cbe   3 weeks ago   69.9MB
srikanthkarre/fabric-tools-v2.3     2.3.3          a4990349e345   3 weeks ago   872MB
hyperledger/fabric-tools            arm64-2.3.3    a4990349e345   3 weeks ago   872MB
hyperledger/fabric-tools            latest         a4990349e345   3 weeks ago   872MB
hyperledger/fabric-peer             arm64-2.3.3    4414399b5383   3 weeks ago   775MB
hyperledger/fabric-peer             latest         4414399b5383   3 weeks ago   775MB
srikanthkarre/fabric-peer-v2.3      2.3.3          4414399b5383   3 weeks ago   775MB
hyperledger/fabric-orderer          arm64-2.3.3    0b42fb15d1be   3 weeks ago   33.4MB
hyperledger/fabric-orderer          latest         0b42fb15d1be   3 weeks ago   33.4MB
srikanthkarre/fabric-orderer-v2.3   2.3.3          0b42fb15d1be   3 weeks ago   33.4MB
hyperledger/fabric-baseos           arm64-2.3.3    877e3ca5a0cf   3 weeks ago   6.66MB
hyperledger/fabric-baseos           latest         877e3ca5a0cf   3 weeks ago   6.66MB
srikanthkarre/fabric-baseos-v2.3    2.3.3          877e3ca5a0cf   3 weeks ago   6.66MB

应该还有其它隐藏行为,没有被理解...
那么现在应该如何继续?

无法安装 chaincode: hyperledger/fabric-ccenv:2.1: no matching manifest for linux/arm64/v8 in the manifest list entries

background

2_FabricNetworkUpdate 案例中 fabric-contract-api-go v1.1.1 加载失败

goal

先在 arm64 环境中, 可以完整跑完一个基本的 HLF 案例,

error

因为不知道哪一步可能出错, 所以,
手工逐一执行 4_TestChaincode.sh 中的指令

第一步就出错:
$ peer lifecycle chaincode install basic.tar.gz

Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Failed to pull hyperledger/fabric-ccenv:2.1: no matching manifest for linux/arm64/v8 in the manifest list entries

guess

对应 core.yaml 中有关版本的配置使用的是: $(TWO_DIGIT_VERSION)
但是, 其它 .yam 中使用的是 ${DOCKER_CA_PATH}

前者 在 bash 中无法用 echo 指令打印出内容, 后者可以...

也许是这个问题?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.