Commit b7f4a474 authored by Waleed El Sayed's avatar Waleed El Sayed

add channel commands

parent 93fe3e0c
......@@ -47,3 +47,8 @@ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./Org2MSPanchors.tx
# start docker containers
docker-compose up -d
sleep 10
# prepare network (create channel & join peers to channel & install chaincode)
docker exec cli script/script.sh
......@@ -2,4 +2,41 @@
CHANNEL_NAME="mychannel"
# create Channel
peer channel create -o orderer.bitbrain.com:7050 -c $CHANNEL_NAME -f ./mynetwork/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/bitbrain.com/orderers/orderer.bitbrain.com/msp/tlscacerts/tlsca.bitbrain.com-cert.pem
# Join peer0.org1 to channnel
CORE_PEER_ADDRESS=peer0.org1.bitbrain.com:7051
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.bitbrain.com/peers/peer0.org1.bitbrain.com/tls/server.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.bitbrain.com/peers/peer0.org1.bitbrain.com/tls/server.key
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.bitbrain.com/peers/peer0.org1.bitbrain.com/tls/ca.crt
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.bitbrain.com/users/Admin@org1.bitbrain.com/msp
peer channel join -b $CHANNEL_NAME.block
# Join peer1.org1 to channnel
CORE_PEER_ADDRESS=peer1.org1.bitbrain.com:7051
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.bitbrain.com/peers/peer1.org1.bitbrain.com/tls/server.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.bitbrain.com/peers/peer1.org1.bitbrain.com/tls/server.key
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.bitbrain.com/peers/peer1.org1.bitbrain.com/tls/ca.crt
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.bitbrain.com/users/Admin@org1.bitbrain.com/msp
peer channel join -b $CHANNEL_NAME.block
# Join peer0.org2 to channnel
CORE_PEER_ADDRESS=peer0.org2.bitbrain.com:7051
CORE_PEER_LOCALMSPID=Org2MSP
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.bitbrain.com/peers/peer0.org2.bitbrain.com/tls/server.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.bitbrain.com/peers/peer0.org2.bitbrain.com/tls/server.key
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.bitbrain.com/peers/peer0.org2.bitbrain.com/tls/ca.crt
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.bitbrain.com/users/Admin@org2.bitbrain.com/msp
peer channel join -b $CHANNEL_NAME.block
# Join peer1.org2 to channnel
CORE_PEER_ADDRESS=peer1.org2.bitbrain.com:7051
CORE_PEER_LOCALMSPID=Org2MSP
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.bitbrain.com/peers/peer1.org2.bitbrain.com/tls/server.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.bitbrain.com/peers/peer1.org2.bitbrain.com/tls/server.key
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.bitbrain.com/peers/peer1.org2.bitbrain.com/tls/ca.crt
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.bitbrain.com/users/Admin@org2.bitbrain.com/msp
peer channel join -b $CHANNEL_NAME.block
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment