Closed dwusiq closed 4 years ago
Which version did you used? Please use the latest version 1.0.5 for 'fabric-explorer-spring-boot-strater'
Which version did you used? Please use the latest version 1.0.5 for 'fabric-explorer-spring-boot-strater'
yes,i use this:'io.github.ecsoya:fabric-explorer-spring-boot-starter:1.0.5' This is my configuration:
But can't find user admin:
It seems that your network config file has errors for loading the peer admin for Org1.
please check the 'connection-Org1.yml' and make sure that:
client: logging: level: debug connection: timeout: peer: endorser: 30000 eventHub: 30000 eventReg: 30000 orderer: 30000 organization: Org1 channels: ... organizations: Org1: mspid: Org1MSP certificateAuthorities:
ca.Org1.example.com adminPrivateKey: pem: | -----BEGIN PRIVATE KEY----- xxx -----END PRIVATE KEY-----
signedCert: pem: | -----BEGIN CERTIFICATE----- xxx -----END CERTIFICATE----- peers:
It seems that your network config file has errors for loading the peer admin for Org1.
please check the 'connection-Org1.yml' and make sure that:
- client.organization = Org1
- organizations.Org1: the 'adminPrivateKey' and 'signedCert' pem of 'Org1' has been correctly loaded.
client: logging: level: debug connection: timeout: peer: endorser: 30000 eventHub: 30000 eventReg: 30000 orderer: 30000 organization: Org1 channels: ... organizations: Org1: mspid: Org1MSP certificateAuthorities:
- ca.Org1.example.com adminPrivateKey: pem: | -----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY----- **signedCert**: pem: | -----BEGIN CERTIFICATE----- -----END CERTIFICATE----- peers: - peer0.Org1.example.com - peer1.Org1.example.com
The channel I built based on the online tutorial, found that the connection-org1.yaml file does not have adminPrivateKey. Is there any way to generate adminPrivateKey?
You must build your fabric network firstly.
https://ecsoya.github.io/fabric/pages/demo.html
Fabric 网络搭建 1- 运行first-network文件夹中的byfn.sh脚本,此方法为官方的fabric-samples中的示例,做了少量修改。
./byfn.sh up -a -s couchdb 2- 具体的修改如下: 为了安装通用链码,几处修改如下。
a. 由于将链码放到了src/chaincode
目录下,所以在scripts/script.sh
中对链码的位置做了相应的修改。
CC_SRC_PATH="github.com/chaincode/common/"
b. 同样的,将docker-composite-cli.yaml
中关于链码的映射路径(83行)做了修改。
- ./../src/chaincode/:/opt/gopath/src/github.com/chaincode
c. 修改了utils.sh
中执行Chaincode的默认的init
、invoke
和query
方法。
1. invoke -> create
2. query -> get
3- 生成Fabric网络配置文件
运行src/main/test中的NetworkGenerator文件,在src/main/resource/network中生成connection-Org1.yml及connection-Org2.yml文件。
关于Fabric网络配置文件的相关信息,请参考文档Fabric Network Config。
connection-org1.yaml的organizations这样配置就可以启动了,但是页面没有数据 organizations: Org1: mspid: Org1MSP peers:
这个看起来还是证书加载的问题。
我看你加载证书用的是路径path,没有用pem,这样Fabric SDK在加载证书时会遇到证书加载不上的问题。
pem其实就是证书的内容,你可以直接把你的证书里面的文本粘贴到里面就可以了。
是证书问题,可能是因为我昨天换了个命令重启fabric网络导致证书变了,我从服务器重新下载证书就可以了。非常感谢哈
不客气,解决了就好,每次部署完证书都会变。
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fabricService' defined in class path resource [io/github/ecsoya/fabric/boot/SpringFabricGatewayAutoConfigure.class]: Unsatisfied dependency expressed through method 'fabricService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fabricContext': Invocation of init method failed; nested exception is java.lang.IllegalStateException: The gateway identity must be set