Skip to content

Commit db36c50

Browse files
committed
Fix the typos and code expression.
Fix the typos and code expression in the block-listener doc. Change-Id: I059ce8dca2d919839d046ac037ef47dd87b10c07 Signed-off-by: Baohua Yang <[email protected]>
1 parent 69345fa commit db36c50

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed
+13-1
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,56 @@
11
# What is block-listener
2-
block-listener.go will connect to a peer and recieve blocks. For every transaction in the block, it will test the ErrorCode field and print success/failure.
2+
block-listener.go will connect to a peer and receive blocks. For every transaction in the block, it will test the ErrorCode field and print success/failure.
33

44
# To Run
5+
```sh
56
1. go build
67

78
2. ./block-listener -events-address=< event address >
9+
```
810

911
# Example with PBFT
1012

1113
## Run 4 docker peers with PBFT
14+
```sh
1215
docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start
1316

1417
docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start
1518

1619
docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp2 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start
1720

1821
docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp3 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start
22+
```
1923

2024
## Attach event client to a Peer
25+
```sh
2126
./block-listener -events-address=172.17.0.2:31315
27+
```
2228

2329
Event client should output "Event Address: 172.17.0.2:31315" and wait for events.
2430

2531
## Create a deploy transaction
2632
Submit a transaction to deploy chaincode_example02.
2733

34+
```sh
2835
CORE_PEER_ADDRESS=172.17.0.2:30303 peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'
36+
```
2937

3038
Notice success transaction in the events client.
3139

3240
## Create an invoke transaction - good
3341
Send a valid invoke transaction to chaincode_example02.
3442

43+
```sh
3544
CORE_PEER_ADDRESS=172.17.0.2:30303 peer chaincode invoke -n 1edd7021ab71b766f4928a9ef91182c018dffb86fef7a4b5a5516ac590a87957e21a62d939df817f5105f524abddcddfc7b1a60d780f02d8235bd7af9db81b66 -c '{"Function":"invoke", "Args": ["a","b","10"]}'
45+
```
3646

3747
Notice success transaction in events client.
3848

3949
## Create an invoke transaction - bad
4050
Send an invoke transaction with invalid parameters to chaincode_example02.
4151

52+
```sh
4253
CORE_PEER_ADDRESS=172.17.0.2:30303 peer chaincode invoke -n 1edd7021ab71b766f4928a9ef91182c018dffb86fef7a4b5a5516ac590a87957e21a62d939df817f5105f524abddcddfc7b1a60d780f02d8235bd7af9db81b66 -c '{"Function":"invoke", "Args": ["a","b"]}'
54+
```
4355

4456
Notice error transaction in events client.

0 commit comments

Comments
 (0)