Tools, FAQ, Tutorials:
Create "PeerAdmin@hlfv1" Card Manually
How to create the "PeerAdmin@hlfv1" card manually?
✍: FYIcenter.com
If you don't want to use the "createPeerAdminCard.sh" script
to create the "PeerAdmin@hlfv1" card automatically,
you can follow this tutorial to create it manually.
1. Create connection profile "connection.json":
$ mkdir ~/card
$ cd ~/card
$ vi connection.json
{
"name": "hlfv1",
"x-type": "hlfv1",
"x-commitTimeout": 300,
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {}
},
"channels": {
"composerchannel": {
"orderers": ["orderer.example.com"],
"peers": {"peer0.org1.example.com": {}}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": ["peer0.org1.example.com"],
"certificateAuthorities": ["ca.org1.example.com"]
}
},
"orderers": {
"orderer.example.com": {
"url": "grpc:\/\/localhost:7050"
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpc:\/\/localhost:7051"
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "http:\/\/localhost:7054",
"caName": "ca.org1.example.com"
}
}
}
2. Copy the certificate and the private of admin user, "Admin@org1.example.com" included in the installation package:
$ cd ~/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config \ /peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp $ cp admincerts/Admin@org1.example.com-cert.pem ~/card/cert.pem $ cp keystore/114a...4457_sk ~/card/key.pem
3. Build the card file, PeerAdmin.card:
$ cd ~/card
$ composer card create -p connection.json -u PeerAdmin@hlfv1 \
-c cert.pem -k key.pem -r PeerAdmin -r ChannelAdmin -f PeerAdmin.card
Successfully created business network card file to
Output file: PeerAdmin.card
Command succeeded
$ ls -l
-rw-rw-r-- 1 fyicenter 1977 Apr 1 02:00 PeerAdmin.card
-rw-r--r-- 1 fyicenter 790 Apr 1 01:32 cert.pem
-rw-rw-r-- 1 fyicenter 419 Apr 1 01:15 connection.json
-rwxr-xr-x 1 fyicenter 241 Apr 1 01:33 key.pem
4. Import the card file to wallet, ~/.composer/cards:
$ composer card import -f PeerAdmin@fabric-network.card
Successfully imported business network card
Card file: PeerAdmin.card
Card name: PeerAdmin@hlfv1@hlfv1
Command succeeded
5. Check access cards in wallet:
$ composer card list The following Business Network Cards are available: Connection Profile: hlfv1 ┌───────────────────────┬─────────────────┬──────────────────┠│ Card Name │ UserId │ Business Network │ ├───────────────────────┼─────────────────┼──────────────────┤ │ PeerAdmin@hlfv1 │ PeerAdmin │ │ ├───────────────────────┼─────────────────┼──────────────────┤ │ PeerAdmin@hlfv1@hlfv1 │ PeerAdmin@hlfv1 │ │ └───────────────────────┴─────────────────┴──────────────────┘
There are 2 cards now in the Composer wallet:
Â
⇠"PeerAdmin@hlfv1" - Peer Admin Access Card
2020-07-14, ∼1451🔥, 0💬
Popular Posts:
Where to find tutorials on Microsoft Azure services? Here is a large collection of tutorials to answ...
How to read RSS validation errors at w3.org? If your RSS feed has errors, the RSS validator at w3.or...
How To Read the Entire File into a Single String in PHP? If you have a file, and you want to read th...
How to add a new operation to an API on the Publisher Dashboard of an Azure API Management Service? ...
How To Set session.gc_divisor Properly in PHP? As you know that session.gc_divisor is the frequency ...