Hyperledger Fabric: Load -> CRIT 002 Error reading configuration: Unsupported Config Type “”

Problem I was following this Hyperledger Fabric tutorial: Building Your First Network It explains about two ways to build and start your network. One is via a shell script called byfn.sh which is simple to use and runs all the commands at once. The other approach is running each and every command manually. This way, … Read more

Hyperledger Fabric: Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded

Problem I was following this Hyperledger Fabric tutorial: Building Your First Network There’s a shell script called byfn.sh which stands for Build Your First Network. I ran the following command which generates the required certificates and genesis block: ./byfn.sh generate And then, ran this command which brings up the network with docker-compose up: ./byfn.sh up … Read more

Node.js: Pass Arguments/Parameters to Programs in Command Line

This article shows how you can pass command line arguments/parameters to any Node.js programs or .js file. Here’s an example: node index.js This will execute the index.js file program. Suppose, you can to pass some arguments and values to the index.js file program via command line. For example, in the below command, we are trying … Read more

Hyperledger Fabric: Unable to build Chaincode

Problem Scenario: You are working on Hyperledger Fabric and you are following this tutorial: Chaincode for Developers and when you try building your chaincode, it hungs up forever. You run the following command on your terminal to build the chaincode you wrote: go get -u –tags nopkcs11 github.com/hyperledger/fabric/core/chaincode/shim But, you get no result (either success … Read more

Hyperledger Fabric: sendPeersProposal – Promise is rejected: Error: 2 UNKNOWN: chaincode error (status: 500, message: Invalid Smart Contract function name.)

This is a solution to one problem scenario while working on Hyperledger Fabric. I was working on modifying a Hyperledger Fabric Sample Application called fabcar. You can face this issue with other sample apps as well. The issue occurred when I tried modifying the function name in the chaincode file of the sample app. Problem: … Read more

Base64 encode/decode in Nodejs and Javascript

This article shows how you can base64 encode and decode string using both Nodejs and Javascript. Javascript: Base64 encode/decode string Encode String btoa() function creates a base-64 encoded ASCII string from the given String object. var encodedData = window.btoa("Hello World!"); console.log(encodedData); // output: SGVsbG8gV29ybGQh Decode String atob() function decoded the base-64 encoded string. var encodedData … Read more

Magento 2: Get Simple Product ID & Quantity in Configurable Product using Swatches

This article shows how you can get the associated Simple Product ID and Quantity (Qty) / inventory from a Configurable Product in frontend product detail page in Magento 2.x. – The below code assumes that Swatches have been used in the product detail page. – Suppose you have two configurable attributes (color and size) for … Read more

SSH/SCP: Copy Files & Folders from Local to Remote & Remote to Local

This article shows how you can copy files and folders from your local machine to remote server. Also, how you can copy files and folders from the remote server to your local machine. We will use SCP protocol for this purpose. SCP stands for Secure Copy Protocol. It’s a means of securely transferring computer files. … Read more

Javascript: Set object & Loop

A Set object holds the unique values of any type like array or object. An array or any other iterable object can be passed to Set. – It’s a new data structure introduced in JavaScript ECMAScript 6 (ES6). – It has useful methods for iteration over the Set values. var mySet = new Set(); mySet.add(11); … Read more