Changes for backend server for Bank B

To create the backend server for Bank B, duplicate the backend server code for Bank A, and change the following details:

  1.  The ipfs object to the client port for Bank B, as follows:
const ipfs = ipfsClient('http://localhost:5002')
  1. postgres client values to the following code:
const conString = "postgres://bankb:bankb@localhost:5432/bankb";
  1. The server port to the following, to avoid conflict:
var server = app.listen(process.env.PORT || 8001, function () {
var port = server.address().port;
console.log("App now running on port", port);
});

  1.  The ccpPath object to the connection profile for bankb, as follows:
const ccpPath = '~/fabric-samples/bankchain/connection-bankb.json';
  1. The wallet path for BankB, as follows:
const wallet = new FileSystemWallet('~/fabric-samples/bankchain/wallet-BankB');
  1. Bring both the servers online by running the following commands on separate Terminals:
$node backend-BankA.js
$node backend-BankB.js

You should now have the backend servers online at the 8000 and 8001 ports, for Bank A and Bank B respectively.

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

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