// In-memory card store for testing so cards are not persisted to the file system
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
...
adminConnection = new AdminConnection({ cardStore: cardStore });
NetworkCardStoreManager is not a documented api and the docs show this
const credentials = CertificateUtil.generate({ commonName: 'admin' });
// PeerAdmin identity used with the admin connection to deploy business networks
const deployerMetadata = {
version: 1,
userName: 'PeerAdmin',
roles: [ 'PeerAdmin', 'ChannelAdmin' ]
};
const deployerCard = new IdCard(deployerMetadata, connectionProfile);
const deployerCardName = 'PeerAdmin';
deployerCard.setCredentials(credentials);
but CertificateUtil is not documented and you don't need to use certs for the embedded connector
// PeerAdmin identity used with the admin connection to deploy business networks
const deployerMetadata = {
version: 1,
userName: 'admin',
enrollmentSecret: 'adminpw',
roles: [ 'PeerAdmin', 'ChannelAdmin' ]
};
const deployerCard = new IdCard(deployerMetadata, connectionProfile);
const deployerCardName = 'PeerAdmin';
Would be the right way.
CertificateUtil works because its used inside the embedded connector to generate the certs for the admin identity and so this bit of code will work
NetworkCardStoreManager is not a documented api and the docs show this
Also
but CertificateUtil is not documented and you don't need to use certs for the embedded connector
Would be the right way. CertificateUtil works because its used inside the embedded connector to generate the certs for the admin identity and so this bit of code will work
because the issuer is the same as that used to deploy.