Changes for the Bank B utility

Replicate the code for registerUser-BankA.js to registerUser-BankB.js. Save the code file in the Bankchain repository.

Make the following changes to the code so that it works for the Bank B organization:

  1. Change the ccpPath object to the connection profile for Bank B, like this:
const ccpPath = path.resolve(__dirname, 'connection-bankb.json');
  1. Change the walletPath object to the wallet for Bank B, like this:
const walletPath = path.join(process.cwd(), 'wallet-BankB');
  1. Change the affiliation to bankb.department1 at both places, like this:
let affiliation = 'bankb.department1'

const secret = await ca.register({ affiliation: 'banka.department1', enrollmentID: 'user1', role: 'client' }, adminIdentity);
  1. Change the MSP to bankbMSP, like this:
const userIdentity = X509WalletMixin.createIdentity('bankbMSP', enrollment.certificate, enrollment.key.toBytes());

After you've made the changes, save the files. Let's register both of the users.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.233.58