From f99870d7744dfbd8822be32b0c923ff18809f90d Mon Sep 17 00:00:00 2001 From: Gari Singh Date: Sat, 15 Apr 2017 06:55:42 -0400 Subject: [PATCH] [FAB-3158] CORE_PEER_COMMITTER_LEDGER_ORDERER not valid CORE_PEER_COMMITTER_LEDGER_ORDERER is no longer a valid parameter and while commented out in the e2e_cli Docker Compose files, it leads to confusion. Additionally, I found that there are leftover docs from the sfhackfest / preview release which still show up in search and contain this variable and even worse outdated commands. This change also deletes those file as well Change-Id: I18e66c7cde460631a65a3ac26c0ad5875ef33b36 Signed-off-by: Gari Singh --- docs/source/asset_cli.rst | 96 ---- docs/source/asset_sdk.rst | 43 -- docs/source/asset_setup.rst | 483 -------------------- docs/source/asset_trouble.rst | 168 ------- docs/source/channel-setup.rst | 179 -------- docs/source/docker-2peer.yml | 111 ----- docs/source/docker-compose-channel.yml | 86 ---- examples/e2e_cli/docker-compose-no-tls.yaml | 5 - examples/e2e_cli/docker-compose.yaml | 5 - 9 files changed, 1176 deletions(-) delete mode 100644 docs/source/asset_cli.rst delete mode 100644 docs/source/asset_sdk.rst delete mode 100644 docs/source/asset_setup.rst delete mode 100644 docs/source/asset_trouble.rst delete mode 100644 docs/source/channel-setup.rst delete mode 100644 docs/source/docker-2peer.yml delete mode 100644 docs/source/docker-compose-channel.yml diff --git a/docs/source/asset_cli.rst b/docs/source/asset_cli.rst deleted file mode 100644 index 78f1a47b62b..00000000000 --- a/docs/source/asset_cli.rst +++ /dev/null @@ -1,96 +0,0 @@ -Manually create and join peers to a new channel ------------------------------------------------ - -Use the cli container to manually exercise the create channel and join -channel APIs. - -Channel - ``myc1`` already exists, so let's create a new channel named -``myc2``. - -Exec into the cli container: - -.. code:: bash - - docker exec -it cli bash - -If successful, you should see the following in your terminal: - -.. code:: bash - - /opt/gopath/src/github.com/hyperledger/fabric/peer # - -Send createChannel API to Ordering Service: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc2 - -This will return a genesis block - ``myc2.block`` - that you can issue -join commands with. Next, send a joinChannel API to ``peer0`` and pass -in the genesis block as an argument. The channel is defined within the -genesis block: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer0:7051 peer channel join -b myc2.block - -To join the other peers to the channel, simply reissue the above command -with ``peer1`` or ``peer2`` specified. For example: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer1:7051 peer channel join -b myc2.block - -Once the peers have all joined the channel, you are able to issues -queries against any peer without having to deploy chaincode to each of -them. - -Use cli to deploy, invoke and query ------------------------------------ - -Run the deploy command. This command is deploying a chaincode named -``mycc`` to ``peer0`` on the Channel ID ``myc2``. The constructor -message is initializing ``a`` and ``b`` with values of 100 and 200 -respectively. - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer chaincode deploy -C myc2 -n mycc -p github.com/hyperledger/fabric/examples -c '{"Args":["init","a","100","b","200"]}' - -Run the invoke command. This invocation is moving 10 units from ``a`` to -``b``. - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer chaincode invoke -C myc2 -n mycc -c '{"function":"invoke","Args":["move","a","b","10"]}' - -Run the query command. The invocation transferred 10 units from ``a`` to -``b``, therefore a query against ``a`` should return the value 90. - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer chaincode query -C myc2 -n mycc -c '{"function":"invoke","Args":["query","a"]}' - -You can issue an ``exit`` command at any time to exit the cli container. - -Creating your initial channel through the cli ---------------------------------------------- - -If you want to manually create the initial channel through the cli -container, you will need to edit the Docker Compose file. Use an editor -to open ``docker-compose-gettingstarted.yml`` and comment out the -``channel_test.sh`` command in your cli image. Simply place a ``#`` to -the left of the command. (Recall that this script is executing the -create and join channel APIs when you run ``docker-compose up``) For -example: - -.. code:: bash - - cli: - container_name: cli - - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - # command: sh -c './channel_test.sh; sleep 1000' - # command: /bin/sh - -Then use the cli commands from above. diff --git a/docs/source/asset_sdk.rst b/docs/source/asset_sdk.rst deleted file mode 100644 index 96779d313f6..00000000000 --- a/docs/source/asset_sdk.rst +++ /dev/null @@ -1,43 +0,0 @@ -Use node SDK to register/enroll user, followed by deploy/invoke ---------------------------------------------------------------- - -The individual javascript programs will exercise the SDK APIs to -register and enroll the client with the provisioned Certificate -Authority. Once the client is properly authenticated, the programs will -demonstrate basic chaincode functionalities - deploy, invoke, and query. -Make sure you are in the working directory where you pulled the source -code before proceeding. - -Upon success of each node program, you will receive a "200" response in -the terminal. - -Register/enroll & deploy chaincode (Linux or OSX): - -.. code:: bash - - # Deploy initializes key value pairs of "a","100" & "b","200". - GOPATH=$PWD node deploy.js - -Register/enroll & deploy chaincode (Windows): - -.. code:: bash - - # Deploy initializes key value pairs of "a","100" & "b","200". - SET GOPATH=%cd% - node deploy.js - -Issue an invoke. Move units 100 from "a" to "b": - -.. code:: bash - - node invoke.js - -Query against key value "b": - -.. code:: bash - - # this should return a value of 300 - node query.js - -Explore the various node.js programs, along with ``example_cc.go`` to -better understand the SDK and APIs. diff --git a/docs/source/asset_setup.rst b/docs/source/asset_setup.rst deleted file mode 100644 index 33f27610fa8..00000000000 --- a/docs/source/asset_setup.rst +++ /dev/null @@ -1,483 +0,0 @@ -Getting Setup -============= - -- `Go `__ - most recent version -- `Docker `__ - v1.13 or - higher -- `Docker Compose `__ - v1.8 - or higher -- `Node.js & npm `__ - node v6.9.5 and - npm v3.10.10 -- `xcode `__ - only required for OS - X users -- `nvm `__ - - if you want to use ``nvm install`` command If you already have node - on your machine, use the node website to install v6.9.5 or issue the - following command in your terminal: - - .. code:: bash - - nvm install v6.9.5 - - then execute the following to see your versions: - - .. code:: bash - - # should be 6.9.5 - node -v - - AND - - .. code:: bash - - # should be 3.10.10 - npm -v - -**Curl the source code to create network entities** - -- Download the `cURL `__ tool if - not already installed. -- Determine a location on your local machine where you want to place - the Fabric artifacts and application code. - - .. code:: bash - - mkdir -p /hackfest - cd /hackfest - - Next, execute the following command: - - .. code:: bash - - curl -L https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sfhackfest/sfhackfest.tar.gz -o sfhackfest.tar.gz 2> /dev/null; tar -xvf sfhackfest.tar.gz - - This command pulls and extracts all of the necessary artifacts to set - up your network - Docker Compose script, channel generate/join - script, crypto material for identity attestation, etc. In the - ``/src/github.com/example_cc`` directory you will find the chaincode - that will be deployed. - -Your directory should contain the following: - -.. code:: bash - - JDoe-mbp: JohnDoe$ pwd - /Users/JohnDoe - JDoe-mbp: JohnDoe$ ls - sfhackfest.tar.gz channel_test.sh src - ccenv docker-compose-gettingstarted.yml tmp - -**Using Docker** - -You do not need to manually pull any images. The images for - -``fabric-peer``, ``fabric-orderer``, ``fabric-ca``, and ``cli`` are -specified in the .yml file and will automatically download, extract, and -run when you execute the ``docker-compose`` command. - -**Commands** - -The channel commands are: - -- ``create`` - create and name a channel in the ``orderer`` and get - back a genesis block for the channel. The genesis block is named in - accordance with the channel name. -- ``join`` - use the genesis block from the ``create`` command to issue - a join request to a peer. - -**Use Docker to spawn network** - -Ensure the hyperledger/fabric-ccenv image is tagged as latest: - -.. code:: bash - - docker-compose -f docker-compose-gettingstarted.yml build - -Create network entities, create channel, join peers to channel: - -.. code:: bash - - docker-compose -f docker-compose-gettingstarted.yml up -d - -Behind the scenes this started six containers (3 peers, a "solo" -orderer, cli and CA) in detached mode. A script - ``channel_test.sh`` - -embedded within the ``docker-compose-gettingstarted.yml`` issued the -create channel and join channel commands within the CLI container. In -the end, you are left with a network and a channel containing three -peers - peer0, peer1, peer2. - -View your containers: - -.. code:: bash - - # if you have no other containers running, you will see six - docker ps - -Ensure the channel has been created and peers have successfully joined: - -.. code:: bash - - docker exec -it cli bash - -You should see the following in your terminal: - -.. code:: bash - - /opt/gopath/src/github.com/hyperledger/fabric/peer # - -To view results for channel creation/join: - -.. code:: bash - - more results.txt - -You're looking for: - -.. code:: bash - - SUCCESSFUL CHANNEL CREATION - SUCCESSFUL JOIN CHANNEL on PEER0 - SUCCESSFUL JOIN CHANNEL on PEER1 - SUCCESSFUL JOIN CHANNEL on PEER2 - -To view genesis block: - -.. code:: bash - - more myc1.block - -Exit the cli container: - -.. code:: bash - - exit - -**Curl the application source code and SDK modules** - -- Prior to issuing the command, make sure you are in the same working - directory where you curled the network code. AND make sure you have - exited the cli container. -- Execute the following command: - - .. code:: bash - - curl -OOOOOO https://raw.githubusercontent.com/hyperledger/fabric-sdk-node/v1.0-alpha/examples/balance-transfer/{config.json,deploy.js,helper.js,invoke.js,query.js,package.json} - -This command pulls the javascript code for issuing your deploy, invoke -and query calls. It also retrieves dependencies for the node SDK -modules. - -- Install the node modules: - - .. code:: bash - - # You may be prompted for your root password at one or more times during this process. - npm install - - You now have all of the necessary prerequisites and Fabric artifacts. - -Asset Transfer with SDK ---------------------------------------------------------------- - -The individual javascript programs will exercise the SDK APIs to -register and enroll the client with the provisioned Certificate -Authority. Once the client is properly authenticated, the programs will -demonstrate basic chaincode functionalities - deploy, invoke, and query. -Make sure you are in the working directory where you pulled the source -code before proceeding. - -Upon success of each node program, you will receive a "200" response in -the terminal. - -Register/enroll & deploy chaincode (Linux or OSX): - -.. code:: bash - - # Deploy initializes key value pairs of "a","100" & "b","200". - GOPATH=$PWD node deploy.js - -Register/enroll & deploy chaincode (Windows): - -.. code:: bash - - # Deploy initializes key value pairs of "a","100" & "b","200". - SET GOPATH=%cd% - node deploy.js - -Issue an invoke. Move units 100 from "a" to "b": - -.. code:: bash - - node invoke.js - -Query against key value "b": - -.. code:: bash - - # this should return a value of 300 - node query.js - -Explore the various node.js programs, along with ``example_cc.go`` to -better understand the SDK and APIs. - -Asset transfer with CLI ------------------------------------------------ - -Use the cli container to manually exercise the create channel and join -channel APIs. - -Channel - ``myc1`` already exists, so let's create a new channel named -``myc2``. - -Exec into the cli container: - -.. code:: bash - - docker exec -it cli bash - -If successful, you should see the following in your terminal: - -.. code:: bash - - /opt/gopath/src/github.com/hyperledger/fabric/peer # - -Send createChannel API to Ordering Service: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc2 - -This will return a genesis block - ``myc2.block`` - that you can issue -join commands with. Next, send a joinChannel API to ``peer0`` and pass -in the genesis block as an argument. The channel is defined within the -genesis block: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer0:7051 peer channel join -b myc2.block - -To join the other peers to the channel, simply reissue the above command -with ``peer1`` or ``peer2`` specified. For example: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer1:7051 peer channel join -b myc2.block - -Once the peers have all joined the channel, you are able to issues -queries against any peer without having to deploy chaincode to each of -them. - -**Deploy, invoke and query** - - -Run the deploy command. This command is deploying a chaincode named -``mycc`` to ``peer0`` on the Channel ID ``myc2``. The constructor -message is initializing ``a`` and ``b`` with values of 100 and 200 -respectively. - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer chaincode deploy -C myc2 -n mycc -p github.com/hyperledger/fabric/examples -c '{"Args":["init","a","100","b","200"]}' - -Run the invoke command. This invocation is moving 10 units from ``a`` to -``b``. - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer chaincode invoke -C myc2 -n mycc -c '{"function":"invoke","Args":["move","a","b","10"]}' - -Run the query command. The invocation transferred 10 units from ``a`` to -``b``, therefore a query against ``a`` should return the value 90. - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer chaincode query -C myc2 -n mycc -c '{"function":"invoke","Args":["query","a"]}' - -You can issue an ``exit`` command at any time to exit the cli container. - -**Create the initial channel** - -If you want to manually create the initial channel through the cli -container, you will need to edit the Docker Compose file. Use an editor -to open ``docker-compose-gettingstarted.yml`` and comment out the -``channel_test.sh`` command in your cli image. Simply place a ``#`` to -the left of the command. (Recall that this script is executing the -create and join channel APIs when you run ``docker-compose up``) For -example: - -.. code:: bash - - cli: - container_name: cli - - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - # command: sh -c './channel_test.sh; sleep 1000' - # command: /bin/sh - -Then use the cli commands from above. - -Troubleshooting ---------------- - -If you have existing containers running, you may receive an error -indicating that a port is already occupied. If this occurs, you will -need to kill the container that is using said port. - -If a file cannot be located, make sure your curl commands executed -successfully and make sure you are in the directory where you pulled the -source code. - -If you are receiving timeout or GRPC communication errors, make sure you -have the correct version of Docker installed - v1.13.0. Then try -restarting your failing docker process. For example: - -.. code:: bash - - docker stop peer0 - -Then: - -.. code:: bash - - docker start peer0 - -Another approach to GRPC and DNS errors (peer failing to resolve with -orderer and vice versa) is to hardcode the IP addresses for each. You -will know if there is a DNS issue, because a ``more results.txt`` -command within the cli container will display something similar to: - -.. code:: bash - - ERROR CREATING CHANNEL - PEER0 ERROR JOINING CHANNEL - -Issue a ``docker inspect `` to ascertain the IP address. -For example: - -.. code:: bash - - docker inspect peer0 | grep IPAddress - -AND - -.. code:: bash - - docker inspect orderer | grep IPAddress - -Take these values and hard code them into your cli commands. For -example: - -.. code:: bash - - CORE_PEER_COMMITTER_LEDGER_ORDERER=172.21.0.2:7050 peer channel create -c myc1 - -AND THEN - -.. code:: bash - - CORE_PEER_COMMITTER_LEDGER_ORDERER= CORE_PEER_ADDRESS= peer channel join -b myc1.block - -If you are seeing errors while using the node SDK, make sure you have -the correct versions of node.js and npm installed on your machine. You -want node v6.9.5 and npm v3.10.10. - -If you ran through the automated channel create/join process (i.e. did -not comment out ``channel_test.sh`` in the -``docker-compose-gettingstarted.yml``), then channel - ``myc1`` - and -genesis block - ``myc1.block`` - have already been created and exist on -your machine. As a result, if you proceed to execute the manual steps in -your cli container: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 - -Then you will run into an error similar to: - -:: - - UTC [msp] Sign -> DEBU 064 Sign: digest: 5ABA6805B3CDBAF16C6D0DCD6DC439F92793D55C82DB130206E35791BCF18E5F - Error: Got unexpected status: BAD_REQUEST - Usage: - peer channel create [flags] - -This occurs because you are attempting to create a channel named -``myc1``, and this channel already exists! There are two options. Try -issuing the peer channel create command with a different channel name - -``myc2``. For example: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc2 - -Then join: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer0:7051 peer channel join -b myc2.block - -If you do choose to create a new channel, and want to run -deploy/invoke/query with the node.js programs, you also need to edit the -"channelID" parameter in the ``config.json`` file to match the new -channel's name. For example: - -:: - - { - "chainName":"fabric-client1", - "chaincodeID":"mycc", - "channelID":"myc2", - "goPath":"../../test/fixtures", - "chaincodePath":"github.com/example_cc", - -OR, if you want your channel called - ``myc1`` -, remove your docker -containers and then follow the same commands in the **Manually create -and join peers to a new channel** topic. - -**Clean up** - -Shut down your containers: - -.. code:: bash - - docker-compose -f docker-compose-gettingstarted.yml down - -**Helpful Docker tips** - -Remove a specific docker container: - -.. code:: bash - - docker rm - -Force removal: - -.. code:: bash - - docker rm -f - -Remove all docker containers: - -.. code:: bash - - docker rm -f $(docker ps -aq) - -This will merely kill docker containers (i.e. stop the process). You -will not lose any images. - -Remove an image: - -.. code:: bash - - docker rmi - -Forcibly remove: - -.. code:: bash - - docker rmi -f - -Remove all images: - -.. code:: bash - - docker rmi -f $(docker images -q) diff --git a/docs/source/asset_trouble.rst b/docs/source/asset_trouble.rst deleted file mode 100644 index f8e31aaed42..00000000000 --- a/docs/source/asset_trouble.rst +++ /dev/null @@ -1,168 +0,0 @@ -Troubleshooting ---------------- - -If you have existing containers running, you may receive an error -indicating that a port is already occupied. If this occurs, you will -need to kill the container that is using said port. - -If a file cannot be located, make sure your curl commands executed -successfully and make sure you are in the directory where you pulled the -source code. - -If you are receiving timeout or GRPC communication errors, make sure you -have the correct version of Docker installed - v1.13.0. Then try -restarting your failing docker process. For example: - -.. code:: bash - - docker stop peer0 - -Then: - -.. code:: bash - - docker start peer0 - -Another approach to GRPC and DNS errors (peer failing to resolve with -orderer and vice versa) is to hardcode the IP addresses for each. You -will know if there is a DNS issue, because a ``more results.txt`` -command within the cli container will display something similar to: - -.. code:: bash - - ERROR CREATING CHANNEL - PEER0 ERROR JOINING CHANNEL - -Issue a ``docker inspect `` to ascertain the IP address. -For example: - -.. code:: bash - - docker inspect peer0 | grep IPAddress - -AND - -.. code:: bash - - docker inspect orderer | grep IPAddress - -Take these values and hard code them into your cli commands. For -example: - -.. code:: bash - - CORE_PEER_COMMITTER_LEDGER_ORDERER=172.21.0.2:7050 peer channel create -c myc1 - -AND THEN - -.. code:: bash - - CORE_PEER_COMMITTER_LEDGER_ORDERER= CORE_PEER_ADDRESS= peer channel join -b myc1.block - -If you are seeing errors while using the node SDK, make sure you have -the correct versions of node.js and npm installed on your machine. You -want node v6.9.5 and npm v3.10.10. - -If you ran through the automated channel create/join process (i.e. did -not comment out ``channel_test.sh`` in the -``docker-compose-gettingstarted.yml``), then channel - ``myc1`` - and -genesis block - ``myc1.block`` - have already been created and exist on -your machine. As a result, if you proceed to execute the manual steps in -your cli container: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 - -Then you will run into an error similar to: - -:: - - UTC [msp] Sign -> DEBU 064 Sign: digest: 5ABA6805B3CDBAF16C6D0DCD6DC439F92793D55C82DB130206E35791BCF18E5F - Error: Got unexpected status: BAD_REQUEST - Usage: - peer channel create [flags] - -This occurs because you are attempting to create a channel named -``myc1``, and this channel already exists! There are two options. Try -issuing the peer channel create command with a different channel name - -``myc2``. For example: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc2 - -Then join: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer0:7051 peer channel join -b myc2.block - -If you do choose to create a new channel, and want to run -deploy/invoke/query with the node.js programs, you also need to edit the -"channelID" parameter in the ``config.json`` file to match the new -channel's name. For example: - -:: - - { - "chainName":"fabric-client1", - "chaincodeID":"mycc", - "channelID":"myc2", - "goPath":"../../test/fixtures", - "chaincodePath":"github.com/example_cc", - -OR, if you want your channel called - ``myc1`` -, remove your docker -containers and then follow the same commands in the **Manually create -and join peers to a new channel** topic. - -Clean up --------- - -Shut down your containers: - -.. code:: bash - - docker-compose -f docker-compose-gettingstarted.yml down - -Helpful Docker tips -------------------- - -Remove a specific docker container: - -.. code:: bash - - docker rm - -Force removal: - -.. code:: bash - - docker rm -f - -Remove all docker containers: - -.. code:: bash - - docker rm -f $(docker ps -aq) - -This will merely kill docker containers (i.e. stop the process). You -will not lose any images. - -Remove an image: - -.. code:: bash - - docker rmi - -Forcibly remove: - -.. code:: bash - - docker rmi -f - -Remove all images: - -.. code:: bash - - docker rmi -f $(docker images -q) diff --git a/docs/source/channel-setup.rst b/docs/source/channel-setup.rst deleted file mode 100644 index 4a7dbc66158..00000000000 --- a/docs/source/channel-setup.rst +++ /dev/null @@ -1,179 +0,0 @@ -Multichannel Setup -================== - -This document describe the CLI for creating channels and directing peers -to join channels. The CLI uses channel APIs that are also available in -the SDK. - -The channel commands are \* create - create a channel in the ``orderer`` -and get back a genesis block for the channel \* join - use genesis block -from create command to issue a join request to a Peer - -:: - - NOTE - The main JIRA items for the work are - https://jira.hyperledger.org/browse/FAB-1022 - https://jira.hyperledger.org/browse/FAB-1547 - - The commands are work in progress. In particular, there will be more configuration parameters to the commands. Some relevant JIRA items - https://jira.hyperledger.org/browse/FAB-1642 - https://jira.hyperledger.org/browse/FAB-1639 - https://jira.hyperledger.org/browse/FAB-1580 - -Using docker ------------- - -Pull the latest images from https://github.com/rameshthoomu/ - -Create a channel -~~~~~~~~~~~~~~~~ - -Copy ```docker-compose-channel.yml`` `__ to -your current directory. - -*Bring up peer and orderer* - -:: - - cd docs - docker-compose -f docker-compose-channel.yml up - -``docker ps`` should show containers ``orderer`` and ``peer0`` running. - -*Ask orderer to create a channel* Start the CLI container. - -:: - - docker-compose -f docker-compose-channel.yml run cli - -In the above shell execute the create command - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 peer channel create -c myc1 - -This will create a channel genesis block file ``myc1.block`` to issue -join commands with. If you want to specify anchor peers, you can create -anchor peer files in the following format: peer-hostname port PEM file -of peer certificate - -See CORE\_PEER\_COMMITTER\_LEDGER\_ORDERER=orderer:5005 peer channel -create -h for an anchor-peer file example And pass the anchor peer files -as a comma-separated argument with flag -a: in example: - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 peer channel create -c myc1 -a anchorPeer1.txt,anchorPeer2.txt - -Join a channel -~~~~~~~~~~~~~~ - -Execute the join command to peer0 in the CLI container. - -:: - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 CORE_PEER_ADDRESS=peer0:7051 peer channel join -b myc1.block - -Use the channel to deploy and invoke chaincodes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Run the deploy command - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 peer chaincode deploy -C myc1 -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args":["init","a","100","b","200"]}' - -Run the invoke command - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 peer chaincode invoke -C myc1 -n mycc -c '{"Args":["invoke","a","b","10"]}' - -Run the query command - -:: - - CORE_PEER_ADDRESS=peer0:7051 CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 peer chaincode query -C myc1 -n mycc -c '{"Args":["query","a"]}' - -Using Vagrant -------------- - -Build the executables with ``make orderer`` and ``make peer`` commands. -Switch to build/bin directory. - -Create a channel -~~~~~~~~~~~~~~~~ - -*Vagrant window 1 - start orderer* - -:: - - ORDERER_GENERAL_LOGLEVEL=debug ./orderer - -*Vagrant window 2 - ask orderer to create a chain* - -:: - - peer channel create -c myc1 - -On successful creation, a genesis block myc1.block is saved in build/bin -directory. - -Join a channel -~~~~~~~~~~~~~~ - -*Vagrant window 3 - start the peer in a "chainless" mode* - -:: - - #NOTE - clear the environment with rm -rf /var/hyperledger/* after updating fabric to get channel support. - - peer node start --peer-defaultchain=false - -:: - - "--peer-defaultchain=true" is the default. It allow users continue to work with the default "testchainid" without having to join a chain. - - "--peer-defaultchain=false" starts the peer with only the channels that were joined by the peer. If the peer never joined a channel it would start up without any channels. In particular, it does not have the default "testchainid" support. - - To join channels, a peer MUST be started with the "--peer-defaultchain=false" option. - -*Vagrant window 2 - peer to join a channel* - -:: - - peer channel join -b myc1.block - -where myc1.block is the block that was received from the ``orderer`` -from the create channel command. - -At this point we can issue transactions. ### Use the channel to deploy -and invoke chaincodes *Vagrant window 2 - deploy a chaincode to myc1* - -:: - - peer chaincode deploy -C myc1 -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args":["init","a","100","b","200"]}' - -Note the use of ``-C myc1`` to target the chaincode deployment against -the ``myc1`` channel. - -Wait for the deploy to get committed (e.g., by default the -``solo orderer`` can take upto 10 seconds to sends a batch of -transactions to be committed.) - -*Vagrant window 2 - invoke chaincode* - -:: - - peer chaincode invoke -C myc1 -n mycc -c '{"Args":["invoke","a","b","10"]}' - -Wait for upto 10 seconds for the invoke to get committed. - -*Vagrant window 2 - query chaincode* - -:: - - peer chaincode query -C myc1 -n mycc -c '{"Args":["query","a"]}' - -To reset, clear out the ``fileSystemPath`` directory (defined in -core.yaml) and myc1.block. diff --git a/docs/source/docker-2peer.yml b/docs/source/docker-2peer.yml deleted file mode 100644 index 8fdcaabc05f..00000000000 --- a/docs/source/docker-2peer.yml +++ /dev/null @@ -1,111 +0,0 @@ -version: '2' -networks: - bridge: - -services: - orderer: - container_name: orderer - image: hyperledger/fabric-orderer - environment: - - ORDERER_GENERAL_LEDGERTYPE=ram - - ORDERER_GENERAL_BATCHTIMEOUT=10s - - ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10 - - ORDERER_GENERAL_MAXWINDOWSIZE=1000 - - ORDERER_GENERAL_ORDERERTYPE=solo - - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - - ORDERER_GENERAL_LISTENPORT=5005 - - ORDERER_RAMLEDGER_HISTORY_SIZE=100 - - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/fabric/msp/sampleconfig - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer - command: orderer - ports: - - 5005:5005 - networks: - - bridge - - peer0: - container_name: peer0 - image: hyperledger/fabric-peer - environment: - - CORE_PEER_ADDRESSAUTODETECT=true - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - CORE_PEER_NETWORKID=peer0 - - CORE_NEXT=true - - CORE_PEER_ENDORSER_ENABLED=true - - CORE_PEER_ID=peer0 - - CORE_PEER_PROFILE_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 - - CORE_PEER_GOSSIP_ORGLEADER=true - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - command: peer node start --peer-defaultchain=false - links: - - orderer:orderer - volumes: - - /var/run/:/host/var/run/ - #in the "- :/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part - #should be modified to the path on the host. This will work as is in the Vagrant environment - - /opt/gopath/src/github.com/hyperledger/fabric/examples/:/opt/gopath/src/github.com/hyperledger/fabric/examples/ - depends_on: - - orderer - networks: - - bridge - - peer1: - container_name: peer1 - image: hyperledger/fabric-peer - environment: - - CORE_PEER_ADDRESSAUTODETECT=true - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - CORE_PEER_NETWORKID=peer1 - - CORE_NEXT=true - - CORE_PEER_ENDORSER_ENABLED=true - - CORE_PEER_ID=peer1 - - CORE_PEER_PROFILE_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 - - CORE_PEER_GOSSIP_ORGLEADER=true - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - command: peer node start --peer-defaultchain=false - links: - - orderer:orderer - volumes: - - /var/run/:/host/var/run/ - #in the "- :/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part - #should be modified to the path on the host. This will work as is in the Vagrant environment - - /opt/gopath/src/github.com/hyperledger/fabric/examples/:/opt/gopath/src/github.com/hyperledger/fabric/examples/ - depends_on: - - orderer - networks: - - bridge - - cli: - container_name: cli - image: hyperledger/fabric-peer - tty: true - environment: - - GOPATH=/opt/gopath - - CORE_PEER_ADDRESSAUTODETECT=true - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - CORE_NEXT=true - - CORE_PEER_ID=cli - - CORE_PEER_ENDORSER_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 - - CORE_PEER_ADDRESS=peer0:7051 - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - command: /bin/sh - links: - - orderer:orderer - - peer0:peer0 - volumes: - - /var/run/:/host/var/run/ - #in the "- :/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part - #should be modified to the path on the host. This will work as is in the Vagrant environment - - /opt/gopath/src/github.com/hyperledger/fabric/examples/:/opt/gopath/src/github.com/hyperledger/fabric/examples/ - depends_on: - - orderer - - peer0 - - peer1 - networks: - - bridge diff --git a/docs/source/docker-compose-channel.yml b/docs/source/docker-compose-channel.yml deleted file mode 100644 index 8d1667cecc1..00000000000 --- a/docs/source/docker-compose-channel.yml +++ /dev/null @@ -1,86 +0,0 @@ -version: '2' -networks: - bridge: - -services: - orderer: - container_name: orderer - image: hyperledger/fabric-orderer - environment: - - ORDERER_GENERAL_LEDGERTYPE=ram - - ORDERER_GENERAL_BATCHTIMEOUT=10s - - ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10 - - ORDERER_GENERAL_MAXWINDOWSIZE=1000 - - ORDERER_GENERAL_ORDERERTYPE=solo - - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - - ORDERER_GENERAL_LISTENPORT=5005 - - ORDERER_RAMLEDGER_HISTORY_SIZE=100 - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer - command: orderer - ports: - - 5005:5005 - networks: - - bridge - - peer0: - container_name: peer0 - image: hyperledger/fabric-peer - environment: - - CORE_PEER_ADDRESSAUTODETECT=true - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - CORE_LOGGING_LEVEL=DEBUG - - CORE_PEER_NETWORKID=peer0 - - CORE_NEXT=true - - CORE_PEER_ENDORSER_ENABLED=true - - CORE_PEER_ID=peer0 - - CORE_PEER_PROFILE_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 - - CORE_PEER_GOSSIP_ORGLEADER=true - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - ports: - - 7051:7051 - - 7053:7053 - command: peer node start --peer-defaultchain=false - links: - - orderer:orderer - volumes: - - /var/run/:/host/var/run/ - #in the "- :/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part - #should be modified to the path on the host. This will work as is in the Vagrant environment - - /opt/gopath/src/github.com/hyperledger/fabric/examples/:/opt/gopath/src/github.com/hyperledger/fabric/examples/ - depends_on: - - orderer - networks: - - bridge - - cli: - container_name: cli - image: hyperledger/fabric-peer - tty: true - environment: - - GOPATH=/opt/gopath - - CORE_PEER_ADDRESSAUTODETECT=true - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - CORE_LOGGING_LEVEL=DEBUG - - CORE_NEXT=true - - CORE_PEER_ID=cli - - CORE_PEER_ENDORSER_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:5005 - - CORE_PEER_ADDRESS=peer0:7051 - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - command: /bin/sh - links: - - orderer:orderer - - peer0:peer0 - volumes: - - /var/run/:/host/var/run/ - #in the "- :/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part - #should be modified to the path on the host. This will work as is in the Vagrant environment - - /opt/gopath/src/github.com/hyperledger/fabric/examples/:/opt/gopath/src/github.com/hyperledger/fabric/examples/ - depends_on: - - orderer - - peer0 - networks: - - bridge diff --git a/examples/e2e_cli/docker-compose-no-tls.yaml b/examples/e2e_cli/docker-compose-no-tls.yaml index 4ec49186e45..f934264871b 100644 --- a/examples/e2e_cli/docker-compose-no-tls.yaml +++ b/examples/e2e_cli/docker-compose-no-tls.yaml @@ -26,7 +26,6 @@ services: service: peer-base environment: - CORE_PEER_ID=peer0 - #- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_LOCALMSPID=Org0MSP volumes: - /var/run/:/host/var/run/ @@ -45,7 +44,6 @@ services: environment: - CORE_PEER_ID=peer1 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051 - #- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_LOCALMSPID=Org0MSP volumes: - /var/run/:/host/var/run/ @@ -65,7 +63,6 @@ services: environment: - CORE_PEER_ID=peer2 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051 - #- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_LOCALMSPID=Org1MSP volumes: - /var/run/:/host/var/run/ @@ -86,7 +83,6 @@ services: environment: - CORE_PEER_ID=peer3 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051 - #- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_LOCALMSPID=Org1MSP volumes: - /var/run/:/host/var/run/ @@ -112,7 +108,6 @@ services: - CORE_NEXT=true - CORE_PEER_ID=cli - CORE_PEER_ENDORSER_ENABLED=true - #- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_ADDRESS=peer0:7051 - CORE_PEER_GOSSIP_IGNORESECURITY=true - CORE_PEER_LOCALMSPID=Org0MSP diff --git a/examples/e2e_cli/docker-compose.yaml b/examples/e2e_cli/docker-compose.yaml index 678f895cdff..50cae9c3ab2 100644 --- a/examples/e2e_cli/docker-compose.yaml +++ b/examples/e2e_cli/docker-compose.yaml @@ -47,7 +47,6 @@ services: - CORE_PEER_ID=peer0 - CORE_PEER_ADDRESS=peer0:7051 - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0:7051 - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_LOCALMSPID=Org0MSP - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer0Signer.pem - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer0Signer.pem @@ -83,7 +82,6 @@ services: - CORE_PEER_ADDRESS=peer1:7051 - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051 - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_LOCALMSPID=Org0MSP - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer1Signer.pem - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer1Signer.pem @@ -120,7 +118,6 @@ services: - CORE_PEER_ADDRESS=peer2:7051 - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer2:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer2:7051 - #- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer2Signer.pem - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer2Signer.pem @@ -158,7 +155,6 @@ services: - CORE_PEER_ADDRESS=peer3:7051 - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer3:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051 - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/msp/sampleconfig/signcerts/peer3Signer.pem - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/msp/sampleconfig/keystore/peer3Signer.pem @@ -191,7 +187,6 @@ services: - CORE_NEXT=true - CORE_PEER_ID=cli - CORE_PEER_ENDORSER_ENABLED=true - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_ADDRESS=peer0:7051 - CORE_PEER_LOCALMSPID=Org0MSP - CORE_PEER_TLS_ENABLED=true