Fabric samples
Fabric samples¶
How to add new user¶
registerEnroll.sh
function createOrg1()
infoln "Registering user 2"
set -x
fabric-ca-client register --caname ca-org1 --id.name user2 --id.secret user2pw --id.type client --tls.certfiles "${PWD}/organizations/fabric-ca/org1/ca-cert.pem"
{ set +x; } 2>/dev/null
infoln "Registering user 3"
set -x
fabric-ca-client register --caname ca-org1 --id.name user3 --id.secret user3pw --id.type client --tls.certfiles "${PWD}/organizations/fabric-ca/org1/ca-cert.pem"
{ set +x; } 2>/dev/null
infoln "Generating the user 2 msp"
set -x
fabric-ca-client enroll -u https://user2:user2pw@localhost:7054 --caname ca-org1 -M "${PWD}/organizations/peerOrganizations/org1.example.com/users/User2@org1.example.com/msp" --tls.certfiles "${PWD}/organizations/fabric-ca/org1/ca-cert.pem"
{ set +x; } 2>/dev/null
cp "${PWD}/organizations/peerOrganizations/org1.example.com/msp/config.yaml" "${PWD}/organizations/peerOrganizations/org1.example.com/users/User2@org1.example.com/msp/config.yaml"
infoln "Generating the user 3 msp"
set -x
fabric-ca-client enroll -u https://user2:user2pw@localhost:7054 --caname ca-org1 -M "${PWD}/organizations/peerOrganizations/org1.example.com/users/User3@org1.example.com/msp" --tls.certfiles "${PWD}/organizations/fabric-ca/org1/ca-cert.pem"
{ set +x; } 2>/dev/null
cp "${PWD}/organizations/peerOrganizations/org1.example.com/msp/config.yaml" "${PWD}/organizations/peerOrganizations/org1.example.com/users/User3@org1.example.com/msp/config.yaml"
How to add additional user to org¶
crypto-config-org1.yaml