mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-20 16:45:09 +00:00
Add filepath check for invoke (#222)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
This commit is contained in:
parent
8b54e14ee4
commit
fd98ec650a
1 changed files with 4 additions and 0 deletions
|
|
@ -14,6 +14,10 @@ async function main() {
|
||||||
try {
|
try {
|
||||||
// load the network configuration
|
// load the network configuration
|
||||||
const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');
|
const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');
|
||||||
|
const fileExists = fs.existsSync(ccpPath);
|
||||||
|
if (!fileExists) {
|
||||||
|
throw new Error(`no such file or directory: ${ccpPath}`);
|
||||||
|
}
|
||||||
let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));
|
let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));
|
||||||
|
|
||||||
// Create a new file system based wallet for managing identities.
|
// Create a new file system based wallet for managing identities.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue