mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
remove dependency on deprecated system-channel. Signed-off-by: Arkadi Piven <arkadi.piven@ibm.com> Signed-off-by: arkadipiven <arkadi7770@gmail.com>
22 lines
1.4 KiB
Bash
Executable file
22 lines
1.4 KiB
Bash
Executable file
#!/usr/bin/env sh
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
|
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
|
|
|
|
|
. peer1admin.sh
|
|
|
|
# Install Chaincode on Peer1
|
|
peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-go --lang golang --label basic_1 >> ./logs/install\&approve\&commit_chaincode_peer_1.log 2>&1
|
|
peer lifecycle chaincode install basic.tar.gz >> ./logs/install\&approve\&commit_chaincode_peer_1.log 2>&1
|
|
|
|
# Extract the CHAINCODE_ID from the logs
|
|
id=$(sed -n '2s/.*Chaincode code package identifier: //p' ./logs/install\&approve\&commit_chaincode_peer_1.log)
|
|
export CHAINCODE_ID="$id"
|
|
|
|
# Approve the chaincode using Peer1Admin
|
|
peer lifecycle chaincode approveformyorg -o 127.0.0.1:6050 --channelID mychannel --name basic --version 1 --package-id "${CHAINCODE_ID}" --sequence 1 --tls --cafile "${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt >> ./logs/install\&approve\&commit_chaincode_peer_1.log 2>&1
|
|
peer lifecycle chaincode commit -o 127.0.0.1:6050 --channelID mychannel --name basic --version 1 --sequence 1 --tls --cafile "${PWD}"/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt >> ./logs/install\&approve\&commit_chaincode_peer_1.log 2>&1
|