Tools, FAQ, Tutorials:
Deploy peer0.org1.example.com Manually
How to Deploy peer0.org1.example.com as a Docker container manually?
✍: FYIcenter.com
You can follow this tutorial to
Deploy peer0.org1.example.com as a Docker container manually.
1. Verify the configuration of the peer0.org1.example.com container defined in the docker-compose.yml file:
$ cd ~/hyperledger-binaries/fabric-samples/basic-network
$ more docker-compose.yml
...
peer0.org1.example.com:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.org1.example.com
- FABRIC_LOGGING_SPEC=info
- CORE_CHAINCODE_LOGGING_LEVEL=info
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
# # the following setting starts chaincode containers on the same
# # bridge network as the peers
# # https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_basic
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984
# The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD
# provide the credentials for ledger to connect to CouchDB. The username and password must
# match the username and password set for the associated CouchDB.
- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
- CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start
# command: peer node start --peer-chaincodedev=true
ports:
- 7051:7051
- 7053:7053
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/msp/peer
- ./crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
- ./config:/etc/hyperledger/configtx
depends_on:
- orderer.example.com
- couchdb
networks:
- basic
...
As you can see, the peer0.org1.example.com container will be using the "latest" version of "hyperledger/fabric-peer" docker image.
2. Bring down all containers defined docker-compose.yml file:
$ docker-compose -f docker-compose.yml down
3. Bring up the orderer.example.com container defined in docker-compose.yml file. If container is not there, create it from the image. If the image is not there, download it from the Internet.
$ docker-compose -f docker-compose.yml up -d peer0.org1.example.com Creating network "net_basic" with the default driver Creating order.example.com ... done Creating couchdb ... done Creating peer0.org1.example.com ... done
4. Verify the container and the image:
$ docker container list IMAGE STATUS NAMES hyperledger/fabric-peer Up About a minute peer0.org1.example.com hyperledger/fabric-orderer Up About a minute order.example.com hyperledger/fabric-couchdb Up About a minute couchdb $ docker images | grep fabric-couchdb IMAGE TAG SIZE hyperledger/fabric-peer latest 178MB
As you can see, the peer0.org1.example.com container has been manually deployed and started with the latest version of "hyperledger/fabric-peer" image. If the image is not available on the Docker, it will be automatically downloaded from the Docker image repository on the Internet.
Note that starting peer0.org1.example.com also brings up order.example.com and couchdb containers, because they are configured as dependencies.
⇒ Deploy couchdb Container Manually
⇐ Deploy orderer.example.com Manually
2020-03-25, ∼1218🔥, 0💬
Popular Posts:
How to use the "forward-request" Policy Statement to call the backend service for an Azure API servi...
Where can I download the EPUB 2.0 sample book "The Problems of Philosophy" by Lewis Theme? You can f...
How to run CMD Commands in Dockerfile to change Windows Docker images? When building a new Windows i...
How to add request body examples to my Azure API operation to make it more user friendly? If you hav...
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...