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也好没什么分别,拿来就用.为什么他 ...
随机推荐
- Unity调试外部DLL
1.更改DLL的.csproj工程配置文件,在里面添加如下属性:<PropertyGroup Condition=" '$(OS)' == 'Unix' "> ...
- [BUUOJ记录] [极客大挑战 2019]RCE ME
前面考察取反或者异或绕过,后面读Flag那里我用脏方法过了,没看出来考察啥 进入题目给出源码: <?php error_reporting(0); if(isset($_GET['code']) ...
- ORA-01033错误解决方案-九五小庞
Microsoft Windows [版本 6.3.9600](c) 2013 Microsoft Corporation.保留所有权利. C:\Users\Administrator>sqlp ...
- 07_Python语法示例(基础语法,文件操作,异常处理)
1.写程序在终端输出图形 ######## # # # # ######## print("#" * 8) print("#" + " " ...
- 仿VISIO连线
说明: 1.未实现障碍物自动避让功能: 2.未实现添加图元到连线之间,连线自动避开新增图元功能: 后续再完善... version 1: package com.sunsheen.jfids.stud ...
- 封装React AntD的dialog弹窗组件
前一段时间分享了基于vue和element所封装的弹窗组件(封装Vue Element的dialog弹窗组件),今天就来分享一个基于react和antD所封装的弹窗组件,反正所使用的技术还是那个技术, ...
- Tooltip鼠标hover放上时文字提示
使用content属性来决定hover时的提示信息. 由placement属性决定展示效果: placement属性值为: 方向-对齐位置: 四个方向:top.left ...
- Hexo + Github Pages搭建个人网站主页
1.GitHub创建个人仓库 登录GitHub创建账号,同时拥有一个自己设定的用户名(username).点击New Repositories创建仓库.仓库名必须为username.github.io ...
- css常用属性之绝对定位、相对定位、滚动条属性、背景图属性、字体、鼠标、超链接跳转页面
1.绝对定位position: fixed(比如广告页面向下滑动的时候,页面最上方有个标题不能随之滑动,就需要用到position: fixed,同时还需要用到一个标签(标签高度很高才会出现滚动的情况 ...
- 故事:坐在我隔壁的小王问我什么是HyperLogLog
1 最近坐我隔壁的小王同志,心情真是糟透了.不但工作不顺心,被老板狠狠的批了一顿,连女朋友也跟别人跑了(Y 的让你天天在我面前秀). 真是不可谓不惨,我都快要同情他了. 看着他萎靡又迷离的眼神,我实在 ...