January 2020
Intermediate to advanced
530 pages
11h 11m
English
Open the TransListener-BankA.js file in a code editor, and proceed as follows:
We start by importing the dependencies for building our transaction listener, like this:
const { FileSystemWallet, Gateway } = require('fabric-network');const ipfsClient = require('ipfs-http-client')const ipfs = ipfsClient('http://localhost:5001')const fs = require("fs");const pg = require('pg');
The fabric-network module is used to connect to the blockchain network and listen to events triggered by our corprem smart contract.
The IPFS client allows us to publish to and fetch files from the IPFS network. It is set to the client port of Bank A, which is 5001.
The fs module allows interaction with the local filesystem.
The
Read now
Unlock full access