farbic-sdk-java 学习部署
准备工作
1.fabric基础网络环境
2.环境准备(jdk环境、maven环境)
3.启动fabric测试网络
4.在idea中测试java-sdk
1.fabric环境准备
1.fabric基础环境搭建可以参考
https://www.cnblogs.com/maobuji/p/7204446.html
2.farbic-sdk-java下载
1)Linux端下
使用git命令拉取fabric-sdk-java(可以参考下面的命令拉取fabric-sdk-java)
2)windows下
下载fabric-sdk-java到本地
fabric-sdk-java下载地址:
https://github.com/hyperledger/fabric-sdk-java
2.启动fabric测试网络
1.虚拟机操作
1)进入到hyperledger目录下
cd /opt/gopath/src/github.com/hyperledger/
2)拉取fabric-sdk-java
git clone https://github.com/hyperledger/fabric-sdk-java.git
3)fabric-sdk-java切换版本
前面配置fabric基础网络环境时版本是1.4,现在把fabric-sdk-java也切换到1.4
cd fabric-sdk-java/
git checkout release-1.4
进入到sdkimtergration目录下
cd fabric-sdk-java/src/test/fixture/sdkintegration
启动fabric运行网络
./fabric.sh up
3)查看网络是否启起来
[test@localhost sdkintegration]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8da8bace46ac dev-peer1.org2.example.com-example_cc_go-1-1dbf3702231b0531018ca9897a018aeeeda328baf3231fc954eab3e4782abc37 "chaincode -peer.add…" About an hour ago Up About an hour dev-peer1.org2.example.com-example_cc_go-1
bd7d2f82cb03 dev-peer0.org2.example.com-example_cc_go-1-3c2a2377e528f3aae999f225b6e8a89e740e3a9ee5b9403c5810bcca3cb0ba58 "chaincode -peer.add…" About an hour ago Up About an hour dev-peer0.org2.example.com-example_cc_go-1
3ddb7e0948a0 dev-peer0.org1.example.com-example_cc_go-1-9048c042a4f98161a88838372c92cf78946523a4efcf5c7707e9507e0419e48d "chaincode -peer.add…" About an hour ago Up About an hour dev-peer0.org1.example.com-example_cc_go-1
0f96b30335ad dev-peer1.org1.example.com-example_cc_go-1-0af7027a19fe7e81c60a641169dd1deffbbd214aa1463c9793db5cbde6374f82 "chaincode -peer.add…" About an hour ago Up About an hour dev-peer1.org1.example.com-example_cc_go-1
5f8f1a54bbeb hyperledger/fabric-peer:1.4 "peer node start" About an hour ago Up About an hour 0.0.0.0:7056->7056/tcp, 0.0.0.0:7058->7058/tcp peer1.org1.example.com
4593fd69c531 hyperledger/fabric-peer:1.4 "peer node start" About an hour ago Up About an hour 0.0.0.0:8056->8056/tcp, 0.0.0.0:8058->8058/tcp peer1.org2.example.com
ddb1504b45c0 hyperledger/fabric-peer:1.4 "peer node start" About an hour ago Up About an hour 0.0.0.0:8051->8051/tcp, 0.0.0.0:8053->8053/tcp peer0.org2.example.com
b3ab4e9410dc hyperledger/fabric-peer:1.4 "peer node start" About an hour ago Up About an hour 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
44f9ffae2175 hyperledger/fabric-tools:1.4 "/usr/local/bin/conf…" About an hour ago Up About an hour 0.0.0.0:7059->7059/tcp configtxlator
022fe88a7e7e hyperledger/fabric-ca:1.4 "bash -c 'cp -R /tmp…" About an hour ago Up About an hour 0.0.0.0:8054->7054/tcp ca_peerOrg2
ee1b66b3eb0d hyperledger/fabric-ca:1.4 "bash -c 'cp -R /tmp…" About an hour ago Up About an hour 0.0.0.0:7054->7054/tcp ca_peerOrg1
572dd38d767c hyperledger/fabric-orderer:1.4 "orderer" About an hour ago Up About an hour 0.0.0.0:7050->7050/tcp
fabric-sdk-java所需网络环境已经完成。
3.环境准备(windows环境要求)
1.jdk安装
找到cmd命令命令符,输入java -version
C:\Users\zzq>java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed m
2.maven安装
可以参考下面教程
https://www.jb51.net/article/149382.htm
查看maven是否安装成功
3.idea安装
4.idea导入fabric-sdk-java
把下载好的fabric-sdk-java包解压缩,然后把项目导入到idea中。
点击file->settting,设置maven仓库路径
进入到Maven,分别设置Maven安装目录,settings.xml文件和repository。
settings.xml文件在 安装的maven/conf目录下,如D:\apache-maven-3.6.3\conf
可以在maven目录下新建repository文件文件夹(首次使用maven)。
4.在idea中测试java-sdk
设置好maven仓库后,点击fabric-sdk-java下的pom.xml文件,把文件设置成maven项目
此时,点击右边项目栏中的maven,编译complie
编译完成后,会显示build success
找到fabric-sdk-java\src\test\java\org\hyperledger\fabric\sdk\testutils\路径下的TestConfig.java文件
修改TestConfig.java代码中配置IP(源码是localhost,改成虚拟机服务器的IP)
执行fabric-sdk-java\src\test\java\org\hyperledger\fabric\sdkintegration\End2endIT.java代码进行连接交易测试。
若控制台有下列输出,表示sdk测试成功。
"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:F:\Software\JetBrains\IntelliJ IDEA Community Edition 2020.2.2\lib\idea_rt.jar=54737:F:\Software\JetBrains\IntelliJ IDEA Community Edition 2020.2.2\bin" -Dfile.encoding=UTF-8 -classpath "F:\Software\JetBrains\IntelliJ IDEA Community Edition 2020.2.2\lib\idea_rt.jar;F:\Software\JetBrains\IntelliJ IDEA Community Edition 2020.2.2\plugins\junit\lib\junit5-rt.jar;F:\Software\JetBrains\IntelliJ IDEA Community Edition 2020.2.2\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\Users\zzq\Desktop\fabric-sdk-java-master\fabric-sdk-java-master\target\test-classes;C:\Users\zzq\Desktop\fabric-sdk-java-master\fabric-sdk-java-master\target\classes;D:\apache-maven-3.6.3\repository\org\mockito\mockito-core\3.3.3\mockito-core-3.3.3.jar;D:\apache-maven-3.6.3\repository\net\bytebuddy\byte-buddy\1.10.5\byte-buddy-1.10.5.jar;D:\apache-maven-3.6.3\repository\net\bytebuddy\byte-buddy-agent\1.10.5\byte-buddy-agent-1.10.5.jar;D:\apache-maven-3.6.3\repository\org\objenesis\objenesis\2.6\objenesis-2.6.jar;D:\apache-maven-3.6.3\repository\junit\junit\4.13\junit-4.13.jar;D:\apache-maven-3.6.3\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\apache-maven-3.6.3\repository\io\grpc\grpc-netty\1.31.0\grpc-netty-1.31.0.jar;D:\apache-maven-3.6.3\repository\io\grpc\grpc-core\1.31.0\grpc-core-1.31.0.jar;D:\apache-maven-3.6.3\repository\com\google\android\annotations\4.1.1.4\annotations-4.1.1.4.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-handler-proxy\4.1.48.Final\netty-handler-proxy-4.1.48.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-codec-socks\4.1.48.Final\netty-codec-socks-4.1.48.Final.jar;D:\apache-maven-3.6.3\repository\com\google\guava\guava\29.0-android\guava-29.0-android.jar;D:\apache-maven-3.6.3\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;D:\apache-maven-3.6.3\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;D:\apache-maven-3.6.3\repository\org\checkerframework\checker-compat-qual\2.5.5\checker-compat-qual-2.5.5.jar;D:\apache-maven-3.6.3\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;D:\apache-maven-3.6.3\repository\com\google\errorprone\error_prone_annotations\2.3.4\error_prone_annotations-2.3.4.jar;D:\apache-maven-3.6.3\repository\io\perfmark\perfmark-api\0.19.0\perfmark-api-0.19.0.jar;D:\apache-maven-3.6.3\repository\org\codehaus\mojo\animal-sniffer-annotations\1.18\animal-sniffer-annotations-1.18.jar;D:\apache-maven-3.6.3\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;D:\apache-maven-3.6.3\repository\io\grpc\grpc-protobuf\1.31.0\grpc-protobuf-1.31.0.jar;D:\apache-maven-3.6.3\repository\io\grpc\grpc-api\1.31.0\grpc-api-1.31.0.jar;D:\apache-maven-3.6.3\repository\io\grpc\grpc-context\1.31.0\grpc-context-1.31.0.jar;D:\apache-maven-3.6.3\repository\com\google\api\grpc\proto-google-common-protos\1.17.0\proto-google-common-protos-1.17.0.jar;D:\apache-maven-3.6.3\repository\io\grpc\grpc-protobuf-lite\1.31.0\grpc-protobuf-lite-1.31.0.jar;D:\apache-maven-3.6.3\repository\io\grpc\grpc-stub\1.31.0\grpc-stub-1.31.0.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-tcnative-boringssl-static\2.0.30.Final\netty-tcnative-boringssl-static-2.0.30.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-codec-http2\4.1.49.Final\netty-codec-http2-4.1.49.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-common\4.1.49.Final\netty-common-4.1.49.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-buffer\4.1.49.Final\netty-buffer-4.1.49.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-transport\4.1.49.Final\netty-transport-4.1.49.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-resolver\4.1.49.Final\netty-resolver-4.1.49.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-codec\4.1.49.Final\netty-codec-4.1.49.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-handler\4.1.49.Final\netty-handler-4.1.49.Final.jar;D:\apache-maven-3.6.3\repository\io\netty\netty-codec-http\4.1.49.Final\netty-codec-http-4.1.49.Final.jar;D:\apache-maven-3.6.3\repository\com\google\protobuf\protobuf-java\3.12.4\protobuf-java-3.12.4.jar;D:\apache-maven-3.6.3\repository\com\google\protobuf\protobuf-java-util\3.12.4\protobuf-java-util-3.12.4.jar;D:\apache-maven-3.6.3\repository\com\google\code\gson\gson\2.8.6\gson-2.8.6.jar;D:\apache-maven-3.6.3\repository\org\bouncycastle\bcpkix-jdk15on\1.62\bcpkix-jdk15on-1.62.jar;D:\apache-maven-3.6.3\repository\org\bouncycastle\bcprov-jdk15on\1.62\bcprov-jdk15on-1.62.jar;D:\apache-maven-3.6.3\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:\apache-maven-3.6.3\repository\commons-cli\commons-cli\1.4\commons-cli-1.4.jar;D:\apache-maven-3.6.3\repository\org\apache\commons\commons-compress\1.20\commons-compress-1.20.jar;D:\apache-maven-3.6.3\repository\commons-io\commons-io\2.6\commons-io-2.6.jar;D:\apache-maven-3.6.3\repository\org\apache\logging\log4j\log4j-core\2.13.3\log4j-core-2.13.3.jar;D:\apache-maven-3.6.3\repository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;D:\apache-maven-3.6.3\repository\org\apache\logging\log4j\log4j-1.2-api\2.13.3\log4j-1.2-api-2.13.3.jar;D:\apache-maven-3.6.3\repository\org\apache\httpcomponents\httpclient\4.5.12\httpclient-4.5.12.jar;D:\apache-maven-3.6.3\repository\org\apache\httpcomponents\httpcore\4.4.13\httpcore-4.4.13.jar;D:\apache-maven-3.6.3\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;D:\apache-maven-3.6.3\repository\org\apache\httpcomponents\httpmime\4.5.12\httpmime-4.5.12.jar;D:\apache-maven-3.6.3\repository\com\spotify\futures-extra\4.2.0\futures-extra-4.2.0.jar;D:\apache-maven-3.6.3\repository\com\google\api\api-common\1.9.0\api-common-1.9.0.jar;D:\apache-maven-3.6.3\repository\com\google\auto\value\auto-value-annotations\1.7\auto-value-annotations-1.7.jar;D:\apache-maven-3.6.3\repository\org\glassfish\javax.json\1.1.4\javax.json-1.1.4.jar;D:\apache-maven-3.6.3\repository\org\yaml\snakeyaml\1.26\snakeyaml-1.26.jar;D:\apache-maven-3.6.3\repository\org\miracl\milagro\amcl\milagro-crypto-java\0.4.0\milagro-crypto-java-0.4.0.jar;D:\apache-maven-3.6.3\repository\org\apache\commons\commons-math3\3.6.1\commons-math3-3.6.1.jar;D:\apache-maven-3.6.3\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;D:\apache-maven-3.6.3\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;D:\apache-maven-3.6.3\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 org.hyperledger.fabric.sdkintegration.End2endIT RUNNING: End2endIT. ***** Enrolling Users *****
Constructing channel foo
Created channel foo
Peer peer0.org1.example.com joined channel foo
Peer peer1.org1.example.com joined channel foo
Finished initialization channel foo
Running channel foo
Creating install proposal
Sending install proposal
Successful install proposal response Txid: c8be487fac4adc7e4b2815ed27b37cf3009bfb423af091be98bf0aebc8d34b27 from peer peer0.org1.example.com
Successful install proposal response Txid: c8be487fac4adc7e4b2815ed27b37cf3009bfb423af091be98bf0aebc8d34b27 from peer peer1.org1.example.com
Received 2 install proposal responses. Successful+verified: 2 . Failed: 0
Sending instantiateProposalRequest to all peers with arguments: a and b set to 100 and 200 respectively
Succesful instantiate proposal response Txid: 0ba00f3b8840ae638072e8b9817ece0d9c0d25c7e284dbf82a6707fe0490a4ff from peer peer0.org1.example.com
Succesful instantiate proposal response Txid: 0ba00f3b8840ae638072e8b9817ece0d9c0d25c7e284dbf82a6707fe0490a4ff from peer peer1.org1.example.com
Received 2 instantiate proposal responses. Successful+verified: 2 . Failed: 0
Sending instantiateTransaction to orderer with a and b set to 100 and 200 respectively
Finished instantiate transaction with transaction id 0ba00f3b8840ae638072e8b9817ece0d9c0d25c7e284dbf82a6707fe0490a4ff
sending transactionProposal to all peers with arguments: move(a,b,100)
Successful transaction proposal response Txid: 5f091bae842da7f71f3fde564808ce82567e52a7aa4ba38860c143b230cab944 from peer peer0.org1.example.com
Successful transaction proposal response Txid: 5f091bae842da7f71f3fde564808ce82567e52a7aa4ba38860c143b230cab944 from peer peer1.org1.example.com
Received 2 transaction proposal responses. Successful+verified: 2 . Failed: 0
Successfully received transaction proposal responses.
Sending chaincode transaction(move a,b,100) to orderer.
RECEIVED Chaincode event with handle: CHAINCODE_EVENTS_HANDLE6afeffb2-3a25-46ec-b3ca-de289e3c5803CHAINCODE_EVENTS_HANDLE, chaincode Id: example_cc_go, chaincode event name: event, transaction id: 5f091bae842da7f71f3fde564808ce82567e52a7aa4ba38860c143b230cab944, event payload: "!", from event source: peer1.org1.example.com
Finished transaction with transaction id 5f091bae842da7f71f3fde564808ce82567e52a7aa4ba38860c143b230cab944
Now query chaincode for the value of b.
RECEIVED Chaincode event with handle: CHAINCODE_EVENTS_HANDLE6afeffb2-3a25-46ec-b3ca-de289e3c5803CHAINCODE_EVENTS_HANDLE, chaincode Id: example_cc_go, chaincode event name: event, transaction id: 5f091bae842da7f71f3fde564808ce82567e52a7aa4ba38860c143b230cab944, event payload: "!", from event source: peer0.org1.example.com
Query payload of b from peer peer0.org1.example.com returned 300
Query payload of b from peer peer1.org1.example.com returned 300
Channel info for : foo
Channel height: 3
Chain current block hash: e4d428ec5db754024016d6124cdf49ee3a698acbf3e0fce419179b6a337ce884
Chainl previous block hash: f27c2826a28f7462ff57f39895379dd39a64c690b5982c0fd02cebb040499720
queryBlockByNumber returned correct block with blockNumber 2
previous_hash f27c2826a28f7462ff57f39895379dd39a64c690b5982c0fd02cebb040499720
queryBlockByHash returned block with blockNumber 1
queryBlockByTxID returned block with blockNumber 2
QueryTransactionByID returned TransactionInfo: txID 5f091bae842da7f71f3fde564808ce82567e52a7aa4ba38860c143b230cab944
validation code 0
Running for Channel foo done Constructing channel bar
Created channel bar
Peer peer0.org2.example.com joined channel bar
Peer peer1.org2.example.com joined channel bar
Finished initialization channel bar
Running channel bar
Creating install proposal
Sending install proposal
Successful install proposal response Txid: 807734440877031f3d77332b8cd05cd3cb5f51ec03ef8f0128318b8c99515c9f from peer peer0.org2.example.com
Successful install proposal response Txid: 807734440877031f3d77332b8cd05cd3cb5f51ec03ef8f0128318b8c99515c9f from peer peer1.org2.example.com
Received 2 install proposal responses. Successful+verified: 2 . Failed: 0
Sending instantiateProposalRequest to all peers with arguments: a and b set to 100 and 300 respectively
Succesful instantiate proposal response Txid: 8ef8145a3e98352c51a10a205f19f6f94e1bfe44ae058a59b5ded1c39b152bb9 from peer peer0.org2.example.com
Succesful instantiate proposal response Txid: 8ef8145a3e98352c51a10a205f19f6f94e1bfe44ae058a59b5ded1c39b152bb9 from peer peer1.org2.example.com
Received 2 instantiate proposal responses. Successful+verified: 2 . Failed: 0
Sending instantiateTransaction to orderer with a and b set to 100 and 300 respectively
Finished instantiate transaction with transaction id 8ef8145a3e98352c51a10a205f19f6f94e1bfe44ae058a59b5ded1c39b152bb9
sending transactionProposal to all peers with arguments: move(a,b,100)
Successful transaction proposal response Txid: f30c1517d84f5f6462b475dd62568dc289a16d31f61bead0817abfcc68e21fba from peer peer0.org2.example.com
Successful transaction proposal response Txid: f30c1517d84f5f6462b475dd62568dc289a16d31f61bead0817abfcc68e21fba from peer peer1.org2.example.com
Received 2 transaction proposal responses. Successful+verified: 2 . Failed: 0
Successfully received transaction proposal responses.
Sending chaincode transaction(move a,b,100) to orderer.
Finished transaction with transaction id f30c1517d84f5f6462b475dd62568dc289a16d31f61bead0817abfcc68e21fba
Now query chaincode for the value of b.
Query payload of b from peer peer0.org2.example.com returned 400
Query payload of b from peer peer1.org2.example.com returned 400
Channel info for : bar
Channel height: 3
Chain current block hash: 761e20919e01b1bdbb39add78eb2bfc31f52778dd29b69d3e60fd312d0f0f5bf
Chainl previous block hash: 89fd7081195a9b9bb25669305494ff95b975b8ba03eb3b99554b863af13e2322
queryBlockByNumber returned correct block with blockNumber 2
previous_hash 89fd7081195a9b9bb25669305494ff95b975b8ba03eb3b99554b863af13e2322
queryBlockByHash returned block with blockNumber 1
queryBlockByTxID returned block with blockNumber 2
QueryTransactionByID returned TransactionInfo: txID f30c1517d84f5f6462b475dd62568dc289a16d31f61bead0817abfcc68e21fba
validation code 0
Running for Channel bar done Traverse the blocks for chain bar
current block number 2 has data hash: 9ec16a9ef6e30cfe9c9d990cc8946f6916b08ab6e7712e1cc8585b028e36fc8d
current block number 2 has previous hash id: 89fd7081195a9b9bb25669305494ff95b975b8ba03eb3b99554b863af13e2322
current block number 2 has calculated block hash is 761e20919e01b1bdbb39add78eb2bfc31f52778dd29b69d3e60fd312d0f0f5bf
current block number 2 has 1 envelope count:
Transaction number 1 has transaction id: f30c1517d84f5f6462b475dd62568dc289a16d31f61bead0817abfcc68e21fba
Transaction number 1 has channel id: bar
Transaction number 1 has epoch: 0
Transaction number 1 has transaction timestamp: 十月 9, 2020 13:36:56 下午
Transaction number 1 has type id: TRANSACTION_ENVELOPE
Transaction number 1 has nonce : 471fb302f5be8e90dd84e35d41698ae8938673a3860d5302
Transaction number 1 has submitter mspid: Org2MSP, certificate: -----BEGIN CERTIFICATE-----
MIICjzCCAjWgAwIBAgIUJYFdzbksvZmpBfUP55tyP3wSuYgwCgYIKoZIzj0EAwIw
czELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNh
biBGcmFuY2lzY28xGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMT
E2NhLm9yZzIuZXhhbXBsZS5jb20wHhcNMjAxMDA5MDUzMjAwWhcNMjExMDA5MDUz
NzAwWjBCMTAwDQYDVQQLEwZjbGllbnQwCwYDVQQLEwRvcmcxMBIGA1UECxMLZGVw
YXJ0bWVudDExDjAMBgNVBAMTBXVzZXIxMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD
QgAEtM6c1ht7v7vLL19QxZKOpRLbHESCr9s6uR0slHZFYZhVfiHAHHj2eTzdE8Id
ZTpOBAqz1OloDfZDbg6IpuMmPqOB1zCB1DAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0T
AQH/BAIwADAdBgNVHQ4EFgQU3nDVR3zPl3rQWyjAB6LaheBe5RYwKwYDVR0jBCQw
IoAgeyt2U8RRLWzpU144FAY19Tm9ihML5UrJT34TG3Wg8j4waAYIKgMEBQYHCAEE
XHsiYXR0cnMiOnsiaGYuQWZmaWxpYXRpb24iOiJvcmcxLmRlcGFydG1lbnQxIiwi
aGYuRW5yb2xsbWVudElEIjoidXNlcjEiLCJoZi5UeXBlIjoiY2xpZW50In19MAoG
CCqGSM49BAMCA0gAMEUCIQCo0+RGjzobf5iuZBxSPa0FQRWuBigVRpRTzb39uYH5
MAIga87bG6a8X5WSrGcZ9f1Ace4dUUGUlqRAaSf0BgbmN1Q=
-----END CERTIFICATE----- Transaction number 1 has 1 actions
Transaction number 1 isValid true
Transaction number 1 validation code 0
Transaction action 1 has response status 352
Transaction action 1 has response message bytes as string:
Transaction action 1 has 2 endorsements
Endorser 0 signature: 3044022034fe757066fea4c092741d8c3f26435591db71302905baa99fe249bc549eb06d0220023c9b6e19a0b6384ddd1dc21580dca0c87987cf088c87c8b2d77d39512b551a
Endorser 0 endorser: mspid Org2MSP
certificate -----BEGIN CERTIFICATE-----
MIICGTCCAcCgAwIBAgIRAKoFq36AGyh9tmw1qzjKp2YwCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
Lm9yZzIuZXhhbXBsZS5jb20wHhcNMTgwMjI1MTI0MzI5WhcNMjgwMjIzMTI0MzI5
WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEfMB0GA1UEAxMWcGVlcjAub3JnMi5leGFtcGxlLmNvbTBZ
MBMGByqGSM49AgEGCCqGSM49AwEHA0IABFBM3gDUs/4Mp9DyF/uiUQkQk1UvqmmC
uhuAXJgeTAob/tzvsLGGRS78dsuPVSGVS3p4vtuPhUBMVKtrnscgjemjTTBLMA4G
A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIHsrdlPEUS1s
6VNeOBQGNfU5vYoTC+VKyU9+Ext1oPI+MAoGCCqGSM49BAMCA0cAMEQCIDbFc/hr
0RYfp0e9HqBW+tel9c9VCW7E+C7XO4e7ZYBJAiAVkjEFKpKadLUpA2cK0YHobNRH
zxIaKjL+wLVfr2wTzQ==
-----END CERTIFICATE----- Endorser 1 signature: 3045022100888b30e637e6f9c7daf2ff260672bb48fe3860f572d4a0abcdf32438f9d2d915022019724ba6846f8879763022725730c91c9e6f675b6b5f5f0482632a09a19c74d1
Endorser 1 endorser: mspid Org2MSP
certificate -----BEGIN CERTIFICATE-----
MIICGDCCAb+gAwIBAgIQKHCjvLJSTkKm5lsAG4StsTAKBggqhkjOPQQDAjBzMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
b3JnMi5leGFtcGxlLmNvbTAeFw0xODAyMjUxMjQzMjlaFw0yODAyMjMxMjQzMjla
MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMR8wHQYDVQQDExZwZWVyMS5vcmcyLmV4YW1wbGUuY29tMFkw
EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIPHSGaXYokkyDT7hjv7xR7qdr/4unay4
6ney+f+SaX3/+GS23ETzxjeZYyoKYy+nMjTGVtMx1k9m/KHHZUS4PaNNMEswDgYD
VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgeyt2U8RRLWzp
U144FAY19Tm9ihML5UrJT34TG3Wg8j4wCgYIKoZIzj0EAwIDRwAwRAIgRiUmbSDL
ZT4ETQzsS57MpfinlBo+WM/3ChUtTOL8BlgCIB8jfwjtaP22vH4w+V52ztTgQCnq
lCO/1jpx9z0ii78C
-----END CERTIFICATE----- Transaction action 1 has 4 chaincode input arguments
Transaction action 1 has chaincode input argument 0 is: move
Transaction action 1 has chaincode input argument 1 is: a
Transaction action 1 has chaincode input argument 2 is: b
Transaction action 1 has chaincode input argument 3 is: 100
Transaction action 1 proposal response status: 352
Transaction action 1 proposal response payload: :)
Transaction action 1 proposal chaincodeIDName: example_cc_go, chaincodeIDVersion: 1
Transaction action 1 has 2 name space read write sets
Namespace example_cc_go read set 0 key a version [1:0]
Namespace example_cc_go read set 1 key b version [1:0]
Namespace example_cc_go write set 0 key a has value '400'
Namespace example_cc_go write set 1 key b has value '400'
Namespace lscc read set 0 key example_cc_go version [1:0]
current block number 1 has data hash: f9b3b8287f9a165a2ac6d8d6599de8a130f6f92c09f52ecbfbdd27fb31cb6ab1
current block number 1 has previous hash id: ee9f35dbeb02a13bf436ccf2f7d00d43c19c463032548c907f2fe025c786572d
current block number 1 has calculated block hash is 89fd7081195a9b9bb25669305494ff95b975b8ba03eb3b99554b863af13e2322
current block number 1 has 1 envelope count:
Transaction number 1 has transaction id: 8ef8145a3e98352c51a10a205f19f6f94e1bfe44ae058a59b5ded1c39b152bb9
Transaction number 1 has channel id: bar
Transaction number 1 has epoch: 0
Transaction number 1 has transaction timestamp: 十月 9, 2020 13:36:52 下午
Transaction number 1 has type id: TRANSACTION_ENVELOPE
Transaction number 1 has nonce : b48e1ba3ee91a13c5abfdeea4677c19ce248cf847821ed4e
Transaction number 1 has submitter mspid: Org2MSP, certificate: -----BEGIN CERTIFICATE-----
MIICGjCCAcCgAwIBAgIRAIrZokP5xguxCqWjUeu0jnAwCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
Lm9yZzIuZXhhbXBsZS5jb20wHhcNMTgwMjI1MTI0MzI5WhcNMjgwMjIzMTI0MzI5
WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEfMB0GA1UEAwwWQWRtaW5Ab3JnMi5leGFtcGxlLmNvbTBZ
MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGDqXVD4yOX65oU0eY3j5UtD8Gr8n/s+
eODjPP76wNeBoSqljQYM+D953dBtzZ87udrwQ2uvcpUI1R1mHTMuNmSjTTBLMA4G
A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIHsrdlPEUS1s
6VNeOBQGNfU5vYoTC+VKyU9+Ext1oPI+MAoGCCqGSM49BAMCA0gAMEUCIQCojuxd
EqSDDDUUJstAmAqU65xkd1/Yf0BVpLdCe++WigIgLWC9rBPpUa+Yhe3yy00+BlqG
xZ0h2eeiHaMuF6Qawy4=
-----END CERTIFICATE----- Transaction number 1 has 1 actions
Transaction number 1 isValid true
Transaction number 1 validation code 0
Transaction action 1 has response status 200
Transaction action 1 has response message bytes as string:
Transaction action 1 has 2 endorsements
Endorser 0 signature: 3045022100944df7ca5d50ae92468046473adef0d101ddaa6423e0657fd606fd0fc4e23cc802203e9bad11bb673a0997aa18796efbf9ad91a16fc6fd56954bcc8aaafd0c28db6a
Endorser 0 endorser: mspid Org2MSP
certificate -----BEGIN CERTIFICATE-----
MIICGTCCAcCgAwIBAgIRAKoFq36AGyh9tmw1qzjKp2YwCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
Lm9yZzIuZXhhbXBsZS5jb20wHhcNMTgwMjI1MTI0MzI5WhcNMjgwMjIzMTI0MzI5
WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEfMB0GA1UEAxMWcGVlcjAub3JnMi5leGFtcGxlLmNvbTBZ
MBMGByqGSM49AgEGCCqGSM49AwEHA0IABFBM3gDUs/4Mp9DyF/uiUQkQk1UvqmmC
uhuAXJgeTAob/tzvsLGGRS78dsuPVSGVS3p4vtuPhUBMVKtrnscgjemjTTBLMA4G
A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIHsrdlPEUS1s
6VNeOBQGNfU5vYoTC+VKyU9+Ext1oPI+MAoGCCqGSM49BAMCA0cAMEQCIDbFc/hr
0RYfp0e9HqBW+tel9c9VCW7E+C7XO4e7ZYBJAiAVkjEFKpKadLUpA2cK0YHobNRH
zxIaKjL+wLVfr2wTzQ==
-----END CERTIFICATE----- Endorser 1 signature: 304502210093ae518f7c43d0abdcb5aa083957be222a117b49b9858d1fe3269fa9cfb158ee022010e6ef369698e82932f00a62970eedd13f426ac48ecc8a3ec95c89febc5a5426
Endorser 1 endorser: mspid Org2MSP
certificate -----BEGIN CERTIFICATE-----
MIICGDCCAb+gAwIBAgIQKHCjvLJSTkKm5lsAG4StsTAKBggqhkjOPQQDAjBzMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
b3JnMi5leGFtcGxlLmNvbTAeFw0xODAyMjUxMjQzMjlaFw0yODAyMjMxMjQzMjla
MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMR8wHQYDVQQDExZwZWVyMS5vcmcyLmV4YW1wbGUuY29tMFkw
EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIPHSGaXYokkyDT7hjv7xR7qdr/4unay4
6ney+f+SaX3/+GS23ETzxjeZYyoKYy+nMjTGVtMx1k9m/KHHZUS4PaNNMEswDgYD
VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgeyt2U8RRLWzp
U144FAY19Tm9ihML5UrJT34TG3Wg8j4wCgYIKoZIzj0EAwIDRwAwRAIgRiUmbSDL
ZT4ETQzsS57MpfinlBo+WM/3ChUtTOL8BlgCIB8jfwjtaP22vH4w+V52ztTgQCnq
lCO/1jpx9z0ii78C
-----END CERTIFICATE----- Transaction action 1 has 4 chaincode input arguments
Transaction action 1 has chaincode input argument 0 is: deploy
Transaction action 1 has chaincode input argument 1 is: bar
Transaction action 1 has chaincode input argument 2 is: ?E???)??github.com/example_cc??example_cc_go??1????init??a??500?...
Transaction action 1 has chaincode input argument 3 is: ? ??????????????????????????????????????Org1MSP??????Org2MSP????...
Transaction action 1 proposal response status: 200
Transaction action 1 proposal response payload: ??example_cc_go??1??escc"?vscc*Z? ??????????????????????????????...
Transaction action 1 proposal chaincodeIDName: lscc, chaincodeIDVersion: 1.4.9
Transaction action 1 has 2 name space read write sets
Namespace example_cc_go write set 0 key a has value '500'
Namespace example_cc_go write set 1 key b has value '300'
Namespace lscc read set 0 key example_cc_go version [0:0]
Namespace lscc write set 0 key example_cc_go has value '??example_cc_go??1??escc"?vscc*Z? ??????????????????????????????...'
current block number 0 has data hash: 342bc0f736574dffdc9009ef56e05d15fa330bb2ec4ef2d51553fd88445476de
current block number 0 has previous hash id:
current block number 0 has calculated block hash is ee9f35dbeb02a13bf436ccf2f7d00d43c19c463032548c907f2fe025c786572d
current block number 0 has 1 envelope count:
Transaction number 1 has transaction id:
Transaction number 1 has channel id: bar
Transaction number 1 has epoch: 0
Transaction number 1 has transaction timestamp: 十月 9, 2020 13:36:50 下午
Transaction number 1 has type id: ENVELOPE
Transaction number 1 has nonce : e4ad1608fd973bae02259c2ad9ee88dbcd0414a8e2ae2798
Transaction number 1 has submitter mspid: OrdererMSP, certificate: -----BEGIN CERTIFICATE-----
MIICCzCCAbKgAwIBAgIQUcfZvWT8UgJJ30cDzW15bDAKBggqhkjOPQQDAjBpMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w
bGUuY29tMB4XDTE4MDIyNTEyNDMyOVoXDTI4MDIyMzEyNDMyOVowWDELMAkGA1UE
BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz
Y28xHDAaBgNVBAMTE29yZGVyZXIuZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggq
hkjOPQMBBwNCAARQfP/qUmnEcXIlE5PlkR4RCMn2XykMsPFZN0k1XfpkSA4KP0nC
ALUgiITKLsOQohYA7oDaFQD/ZhaRswgwEgmNo00wSzAOBgNVHQ8BAf8EBAMCB4Aw
DAYDVR0TAQH/BAIwADArBgNVHSMEJDAigCAZtRU3kIVNroUKD5QVcPw8VpuHhyOT
OtWpwxnSk/LUkjAKBggqhkjOPQQDAgNHADBEAiApAQ0e/qdVsd5qtXGHqYKRt30Y
LPaGPmy8wbX8+/KDhwIgXtt1TL97Z0rfq7iKXzXLRNk8jNntsrmRFoLVstXr3dA=
-----END CERTIFICATE----- That's all folks! Process finished with exit code 0
参考资料:
https://github.com/hyperledger/fabric-sdk-java
https://blog.csdn.net/m0_37459945/article/details/85550676
farbic-sdk-java 学习部署的更多相关文章
- Java学习-032-JavaWeb_001 -- Tomcat环境部署及基本配置
首先到 Tomcat 官网,下载对应的版本,我本机的系统是 WIN7 64BIT 的,因而我选择的是64bit 的zip包,如下图所示:
- Java学习路径及练手项目合集
Java 在编程语言排行榜中一直位列前排,可知 Java 语言的受欢迎程度了. 实验楼上的[Java 学习路径]中将首先完成 Java基础.JDK.JDBC.正则表达式等基础实验,然后进阶到 J2SE ...
- 《Java学习笔记(第8版)》学习指导
<Java学习笔记(第8版)>学习指导 目录 图书简况 学习指导 第一章 Java平台概论 第二章 从JDK到IDE 第三章 基础语法 第四章 认识对象 第五章 对象封装 第六章 继承与多 ...
- 关于JAVA学习计划和感想
学习计划第一阶段: JAVA语言基础知识.包括异常.IO流.多线程.集合类. 要求:异常------掌握try-catch-finally的使用 IO流------掌握字 ...
- Java学习之路:不走弯路,就是捷径
1.如何学习程序设计? JAVA是一种平台,也是一种程序设计语言,如何学好程序设计不仅仅适用于JAVA,对C++等其他程序设计语言也一样管用.有编程高手认为,JAVA也好C也好没什么分别,拿来就用.为 ...
- Java学习——开端
学号 <Java程序设计>第1周学习总结(1) 教材学习内容总结(第一章) Java最早是由Sun公司研发,原称Oak(橡树),开发者之一的James Gosling被尊称为Java之父. ...
- Java学习-033-JavaWeb_002 -- 网页标记语言JSP基础知识
JSP 是 Sun 公司提倡的一门网页技术标准.在 HTML 文件中,加入 Java 代码就构成了 JSP 网页,当 Web 服务器访问 JSP 请求的时候,首先执行其中的 Java 程序源码,然后以 ...
- Java学习步骤
我们为什么选择Java 大多数人选择Java可能只是因为听说Java前景好.Java比较好找工作.Java语言在TIOBE排行榜上一直位于前三等等之类的原因,但是Java具体好在哪里,心里却是没有什么 ...
- Java学习笔记4
Java学习笔记4 1. JDK.JRE和JVM分别是什么,区别是什么? 答: ①.JDK 是整个Java的核心,包括了Java运行环境.Java工具和Java基础类库. ②.JRE(Java Run ...
- Java学习路径:不走弯路,这是一条捷径
1.如何学习编程? JAVA是一种平台.也是一种程序设计语言,怎样学好程序设计不只适用于JAVA,对C++等其它程序设计语言也一样管用.有编程高手觉得,JAVA也好C也好没什么分别,拿来就用.为什么他 ...
随机推荐
- 详细了解JS Map,它和传统对象有什么区别?
转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解决方案和服务,赋能开发者.原文出处:https://www.codeproject.com/Articles/5278387/Under ...
- python3笔记-函数
创建函数 def 函数名(参数列表): 函数语句 函数的命名规则:一个单词直接小写 # 多个单词,每个单词小写,以下划线分隔 文档化说明 函数首行加 '' 或 ''' ''' 使用函数名.__doc_ ...
- Activiti7 流程部署
首先先绘制一个流程图 创建bpmn文件 然后绘制好节点 然后修改节点信息 指定负责人 点击背景,修改ID和名称 保存 然后重命名成xml 使用diagram打开 导出png 然后包xml改回bpmn ...
- C:将算术表达式的符号和数分开
程序: #include <stdio.h> #include <string.h> static int pos=; static char* line; void test ...
- leetcode刷题-79单词搜索
题目 给定一个二维网格和一个单词,找出该单词是否存在于网格中. 单词必须按照字母顺序,通过相邻的单元格内的字母构成,其中“相邻”单元格是那些水平相邻或垂直相邻的单元格.同一个单元格内的字母不允许被重复 ...
- vueJs 安装
1.下载nodeJs 可前往 https://www.cnblogs.com/takeyblogs/p/13600124.html 这里下载 2.由于 npm 安装速度慢,本教程使用了淘宝的镜像及其命 ...
- 容器服务 TKE 上服务暴露的几种方式
预备知识 1. K8S 上 Service 类型 ClusterIP 通过集群的内部 IP 暴露服务,选择该值,服务只能够在集群内部可以访问,这也是默认的 ServiceType. NodePort ...
- CTF-BugKu-34-
2020.09.15 做得好慢,,,心不在焉的,赶紧的啊,还得做别的呢 做题 第三十四题 很普通的数独(ISCCCTF) https://ctf.bugku.com/challenges#很普通的数独 ...
- MIPS 架构流水线处理器
该项目系笔者大二时计算机组成课的课程设计,源代码及完整文档请移步 Github 仓库.
- 复习 | 彻底弄懂Flexbox之Demo篇
flexbox之前有接触,写项目时也用过,但也只是简单的,对其也是似懂非懂,所以今天下定决心把这个再学一遍,因为似懂非懂就是不懂 本文主要是的demo演示,想看flexbox语法 请移步flexbox ...