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, 1335🔥, 0💬
Popular Posts:
How to use the "send-one-way-request" Policy statement to call an extra web service for an Azure API...
Where to find tutorials on PHP language? I want to know how to learn PHP. Here is a large collection...
What properties and functions are supported on requests.models.Response objects? "requests" module s...
How to convert a JSON text string to an XML document with PHP language? Currently, there is no built...
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...