<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anushka Agarwal</title>
    <description>The latest articles on DEV Community by Anushka Agarwal (@agarwalanushka).</description>
    <link>https://dev.to/agarwalanushka</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1111449%2F5bfe8b25-0a9f-4cc3-98ae-f38e92b18fd2.jpeg</url>
      <title>DEV Community: Anushka Agarwal</title>
      <link>https://dev.to/agarwalanushka</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/agarwalanushka"/>
    <language>en</language>
    <item>
      <title>Step-by-Step Dockerization of a Node.js App Connecting to AWS CloudHSM with PKCS#11 SDK</title>
      <dc:creator>Anushka Agarwal</dc:creator>
      <pubDate>Thu, 23 Jan 2025 08:57:16 +0000</pubDate>
      <link>https://dev.to/agarwalanushka/step-by-step-dockerization-of-a-nodejs-app-connecting-to-aws-cloudhsm-with-pkcs11-sdk-dbl</link>
      <guid>https://dev.to/agarwalanushka/step-by-step-dockerization-of-a-nodejs-app-connecting-to-aws-cloudhsm-with-pkcs11-sdk-dbl</guid>
      <description>&lt;p&gt;Recently, I worked on a Node.js application that required integration with AWS CloudHSM for secure cryptographic operations. After successfully implementing the application, the next challenge was to dockerize it so it could run efficiently in an air-gapped environment. This presented its own set of hurdles, as information on how to combine Docker, Node.js, and AWS CloudHSM using the PKCS#11 SDK was scarce.&lt;/p&gt;

&lt;p&gt;To save others the time and effort I invested, I decided to document the process step-by-step in this blog. If you're facing a similar use case, this guide will walk you through how to efficiently dockerize a Node.js application that connects to AWS CloudHSM using the PKCS#11 SDK. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenges of an Air-Gapped Environment
&lt;/h2&gt;

&lt;p&gt;In an air-gapped environment, external internet access is often restricted, which means we can't simply pull down images or install packages directly from the web. In our case, we also needed to integrate the AWS CloudHSM PKCS#11 client, which requires specific dependencies. To overcome this, we started by identifying all the necessary dependencies that needed to be baked into the Docker image.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Setting Up the Base Docker Image
&lt;/h3&gt;

&lt;p&gt;We began with an Ubuntu base image (version 20.04) and started by installing a few critical packages, including wget, python3, python3-pip, and curl. These were needed for installing the PKCS#11 SDK and other dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use the Ubuntu image&lt;/span&gt;
FROM ubuntu:20.04 AS builder

&lt;span class="c"&gt;# Install necessary packages and clean up&lt;/span&gt;
RUN apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    wget &lt;span class="se"&gt;\&lt;/span&gt;
    python3 &lt;span class="se"&gt;\&lt;/span&gt;
    python3-pip &lt;span class="se"&gt;\&lt;/span&gt;
    curl &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Installing Node.js and NPM
&lt;/h3&gt;

&lt;p&gt;Next, we needed Node.js and npm to run our application. Since the environment was air-gapped, we had to manually fetch and install the packages. We added the Node.js 16.x setup script and installed it along with npm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install Node.js and npm&lt;/span&gt;
RUN curl &lt;span class="nt"&gt;-sL&lt;/span&gt; https://deb.nodesource.com/setup_16.x | bash - &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Installing AWS CloudHSM PKCS#11 Client
&lt;/h3&gt;

&lt;p&gt;At this point, the main challenge was integrating the AWS CloudHSM PKCS#11 client, which is essential for securely connecting to CloudHSM. We manually downloaded the .deb package for the CloudHSM PKCS#11 client and installed it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install CloudHSM PKCS #11 client&lt;/span&gt;
RUN wget https://s3.amazonaws.com/cloudhsmv2-software/CloudHsmClient/Focal/cloudhsm-pkcs11_latest_u20.04_amd64.deb &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; ./cloudhsm-pkcs11_latest_u20.04_amd64.deb &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; cloudhsm-pkcs11_latest_u20.04_amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Setting Up the Application Code
&lt;/h3&gt;

&lt;p&gt;Once we had the dependencies installed, we created a working directory for our Node.js application. We copied over the package.json files to install the required npm dependencies and then copied the rest of the application code into the container. Finally, we built the application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create a work directory&lt;/span&gt;
WORKDIR /app

&lt;span class="c"&gt;# Copy package.json files and install npm dependencies&lt;/span&gt;
COPY package&lt;span class="k"&gt;*&lt;/span&gt;.json ./
RUN npm cache clean &lt;span class="nt"&gt;--force&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm cache clean &lt;span class="nt"&gt;--force&lt;/span&gt;

&lt;span class="c"&gt;# Copy the rest of the application code&lt;/span&gt;
COPY &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;

RUN npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Preparing the Final Image
&lt;/h3&gt;

&lt;p&gt;After building the application, we transitioned to the final image stage. At this point, we removed unnecessary files and dependencies that weren't needed for the final container. The CloudHSM PKCS#11 client files were copied from the builder stage, and we also ensured that the correct file permissions were set for the libcloudhsm_pkcs11.so file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Prepare application code for the final stage&lt;/span&gt;
FROM ubuntu:20.04

&lt;span class="c"&gt;# Copy the CloudHSM PKCS #11 client files from the builder stage&lt;/span&gt;
COPY &lt;span class="nt"&gt;--from&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;builder /opt/cloudhsm /opt/cloudhsm

&lt;span class="c"&gt;# Create a work directory&lt;/span&gt;
WORKDIR /app

COPY &lt;span class="nt"&gt;--from&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;builder /app/dist /app/dist
COPY &lt;span class="nt"&gt;--from&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;builder /app/node_modules /app/node_modules
&lt;span class="c"&gt;#COPY --from=builder /app/deployment /app/deployment&lt;/span&gt;

&lt;span class="c"&gt;# Permissions to .so file&lt;/span&gt;
&lt;span class="c"&gt;# Optional step&lt;/span&gt;
RUN &lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 777 /opt/cloudhsm/lib
RUN &lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 777 /opt/cloudhsm/lib/libcloudhsm_pkcs11.so

RUN apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    curl &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="c"&gt;# Install Node.js and npm&lt;/span&gt;
RUN curl &lt;span class="nt"&gt;-sL&lt;/span&gt; https://deb.nodesource.com/setup_16.x | bash - &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6: Running the Application
&lt;/h3&gt;

&lt;p&gt;Finally, you’ll want to run the application. This can be done using a CMD or ENTRYPOINT directive to start your Node.js app within the container. This step depends on how you want to manage your process (whether through a script, direct command, etc.).&lt;/p&gt;

&lt;h2&gt;
  
  
  The Complete Dockerfile
&lt;/h2&gt;

&lt;p&gt;Here’s the complete Dockerfile that puts everything together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use the Ubuntu image&lt;/span&gt;
FROM ubuntu:20.04 AS builder

&lt;span class="c"&gt;# Install necessary packages and clean up&lt;/span&gt;
RUN apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    wget &lt;span class="se"&gt;\&lt;/span&gt;
    python3 &lt;span class="se"&gt;\&lt;/span&gt;
    python3-pip &lt;span class="se"&gt;\&lt;/span&gt;
    curl &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="c"&gt;# Install Node.js and npm&lt;/span&gt;
RUN curl &lt;span class="nt"&gt;-sL&lt;/span&gt; https://deb.nodesource.com/setup_16.x | bash - &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="c"&gt;# Install CloudHSM PKCS #11 client&lt;/span&gt;
RUN wget https://s3.amazonaws.com/cloudhsmv2-software/CloudHsmClient/Focal/cloudhsm-pkcs11_latest_u20.04_amd64.deb &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; ./cloudhsm-pkcs11_latest_u20.04_amd64.deb &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; cloudhsm-pkcs11_latest_u20.04_amd64.deb

&lt;span class="c"&gt;# Create a work directory&lt;/span&gt;
WORKDIR /app

&lt;span class="c"&gt;# Copy package.json files and install npm dependencies&lt;/span&gt;
COPY package&lt;span class="k"&gt;*&lt;/span&gt;.json ./
RUN npm cache clean &lt;span class="nt"&gt;--force&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm cache clean &lt;span class="nt"&gt;--force&lt;/span&gt;

&lt;span class="c"&gt;# Copy the rest of the application code&lt;/span&gt;
COPY &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;

RUN npm run build

&lt;span class="c"&gt;# Prepare application code for the final stage&lt;/span&gt;
FROM ubuntu:20.04

&lt;span class="c"&gt;# Copy the CloudHSM PKCS #11 client files from the builder stage&lt;/span&gt;
COPY &lt;span class="nt"&gt;--from&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;builder /opt/cloudhsm /opt/cloudhsm

&lt;span class="c"&gt;# Create a work directory&lt;/span&gt;
WORKDIR /app

COPY &lt;span class="nt"&gt;--from&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;builder /app/dist /app/dist
COPY &lt;span class="nt"&gt;--from&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;builder /app/node_modules /app/node_modules
&lt;span class="c"&gt;#COPY --from=builder /app/deployment /app/deployment&lt;/span&gt;

&lt;span class="c"&gt;# Permissions to .so file&lt;/span&gt;
RUN &lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 777 /opt/cloudhsm/lib
RUN &lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 777 /opt/cloudhsm/lib/libcloudhsm_pkcs11.so

RUN apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    curl &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="c"&gt;# Install Node.js and npm&lt;/span&gt;
RUN curl &lt;span class="nt"&gt;-sL&lt;/span&gt; https://deb.nodesource.com/setup_16.x | bash - &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By following these steps, you can successfully dockerize a Node.js application that connects to AWS CloudHSM using the PKCS#11 SDK, even in an air-gapped environment. The key was to manually manage dependencies and take advantage of Docker’s multi-stage builds to ensure a clean and efficient final image.&lt;/p&gt;

&lt;p&gt;I hope this guide saves you some time and frustration, just as it did for me! If you have any questions or run into issues, feel free to leave a comment or reach out. Happy coding!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloudhsm</category>
      <category>node</category>
      <category>docker</category>
    </item>
    <item>
      <title>Decoding the Challenge: Investigating a Common Deployment Hitch "Error: failed to create deliver client for orderer"</title>
      <dc:creator>Anushka Agarwal</dc:creator>
      <pubDate>Fri, 19 Jan 2024 14:33:53 +0000</pubDate>
      <link>https://dev.to/agarwalanushka/decoding-the-challenge-investigating-a-common-deployment-hitch-error-failed-to-create-deliver-client-for-orderer-1l9c</link>
      <guid>https://dev.to/agarwalanushka/decoding-the-challenge-investigating-a-common-deployment-hitch-error-failed-to-create-deliver-client-for-orderer-1l9c</guid>
      <description>&lt;p&gt;In the vast realm of blockchain technology, setting up a network can be a complex task. Recently, I faced an issue while deploying a minifabric network on a virtual machine.  The error message&lt;br&gt;
&lt;code&gt;"Error: failed to create deliver client for orderer: orderer client failed to connect to 123.456.789.012:5013: failed to create new connection: context deadline exceeded,"&lt;/code&gt; disrupted what should have been a routine process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmt85dloijrbpjmv0apzf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmt85dloijrbpjmv0apzf.png" alt="Screenshot of the issue" width="800" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For those familiar with blockchain deployment, encountering errors is expected. However, comprehending and resolving these issues is where the real journey begins. In this blog, I aim to demystify the aforementioned error, sharing the troubleshooting steps that led to its resolution. Join me as we figure out the details of this deployment problem and solve the mystery behind the error that momentarily halted progress.&lt;/p&gt;
&lt;h3&gt;
  
  
  Troubleshooting steps:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Make sure no other app or service is using the port where minifab is deploying the orderer. In my case, it was port 5013. You can check with any one of these commands
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsof &lt;span class="nt"&gt;-i&lt;/span&gt; :&amp;lt;port_number&amp;gt;
netstat &lt;span class="nt"&gt;-tlnp&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &amp;lt;port_number&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;If you find another application on the needed port, you can choose a different port range by using the -e flag in the minifab command. Just use
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;minifab up &lt;span class="nt"&gt;-e&lt;/span&gt; &amp;lt;port_number&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;If you are using an old minifab version, try updating the version
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker pull hyperledgerlabs/minifab:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;The last crucial step that finally fixed the issue was discovering a firewall on the VM causing trouble with communication between the docker containers and the host. The problem was the firewall rules set up using &lt;strong&gt;Uncomplicated Firewall (UFW)&lt;/strong&gt;. To tackle this, I examined the firewall's status and rules by using the command
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30ny3hzyegdh7yawz5kf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30ny3hzyegdh7yawz5kf.jpg" alt="Screenshot of the ufw status output" width="663" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It became evident from the output that the firewall was not allowing the port range (5000). To fix this, I added a rule permitting this port range using the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ufw allow &amp;lt;start_port_number&amp;gt;:&amp;lt;end_port_number&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I cleaned everything up by these commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;minifab down
minifab cleanup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, I brought the network back up. Hooray! Problem solved, and the network was up and running smoothly! XD&lt;/p&gt;

&lt;p&gt;Through this shared experience, I want to help others save time fixing common problems. This blog is like a guide to help troubleshoot issues and show the way for people facing similar problems. Let's make it easier for enthusiasts to understand and fix things when setting up their fabric deployments. Together, we can navigate through these challenges more smoothly and enjoy a hassle-free deployment experience.&lt;br&gt;&lt;br&gt;
Happy Learning :)&lt;/p&gt;

</description>
      <category>hyperledgerfabric</category>
      <category>blockchain</category>
      <category>minifabric</category>
      <category>devops</category>
    </item>
    <item>
      <title>Deploying Hyperledger Fabric Network on Kubernetes using Falcon</title>
      <dc:creator>Anushka Agarwal</dc:creator>
      <pubDate>Thu, 02 Nov 2023 18:36:25 +0000</pubDate>
      <link>https://dev.to/agarwalanushka/deploying-hyperledger-fabric-network-on-kubernetes-using-falcon-2ebc</link>
      <guid>https://dev.to/agarwalanushka/deploying-hyperledger-fabric-network-on-kubernetes-using-falcon-2ebc</guid>
      <description>&lt;p&gt;Before diving into how to deploy Hyperledger Fabric on Kubernetes we need to understand some basics about Hyperledger Fabric.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Hyperledger Fabric
&lt;/h2&gt;

&lt;p&gt;Hyperledger Fabric is an open source enterprise-grade permissioned distributed ledger technology (DLT) platform. Fabric has a very modular and configurable architecture and it is the first DLT platform to support smart contracts authored in general-purpose programming languages.&lt;br&gt;
It is a restricted access blockchain designed to maintain transparency among a network of organizations that lack complete mutual trust.&lt;/p&gt;
&lt;h3&gt;
  
  
  Network Topology of HLF
&lt;/h3&gt;

&lt;p&gt;Hyperledger Fabric (HLF) is primarily composed of the following key elements:&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/" rel="noopener noreferrer"&gt;Certificate Authority (CA)&lt;/a&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;It plays a vital role in managing digital identities and maintaining the security and integrity of the network by issuing, validating, and managing certificates.&lt;br&gt;
Typically CA nodes form a tree-like topology with &lt;strong&gt;Root CA&lt;/strong&gt; at the top.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Root CA&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is a self-signed instance which issues certificates to all other organisations in the network.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Certificate Authority (ICA)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;CAs that belong to other organisations, essentially the Intermediate Certificate Authority (ICA) are signed by the Root CA. All the other nodes and users in the network are signed by the ICA.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;TLS CA&lt;/strong&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It issues certificates to orderer and peers to enable the TLS communication in the network.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://hyperledger-fabric.readthedocs.io/en/release-2.5/orderer/ordering_service.html" rel="noopener noreferrer"&gt;Orderers&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;It forms an ordering service which is responsible for keeping the blockchain state consistent and final. Orderers maintain access to the channels and keep a system channel that contains access control lists (ACLs) of organizations that can create channels. They restrict who can configure, read, and write data to particular channels.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://hyperledger-fabric.readthedocs.io/en/release-2.5/peers/peers.html" rel="noopener noreferrer"&gt;Peers&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;They are the fundamental elements in a HLF Network as they manage ledgers and smart contracts.&lt;br&gt;
Peers take care of proposal, endorsement, validation and commitment of a transaction in the HLF network. A peer belongs to one organization, can belong to multiple channels, and can host multiple ledgers and smart contracts. &lt;br&gt;
They forward smart contract calls to dedicated chaincode containers in the network and update the network state on the basis of smart contract results. They also connect to the orderers to receive new blocks for transactions or can do p2p communication through gossip protocol.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;a href="https://hyperledger-fabric.readthedocs.io/en/release-2.5/channels.html" rel="noopener noreferrer"&gt;Channels&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;A HLF channel is a private “subnet” of communication between two or more specific network members, for the purpose of conducting private and confidential transactions. All peers belonging to a channel have access to the same data and smart contracts. There is no access to it outside the channel.&lt;/p&gt;

&lt;p&gt;Now, since we have a basic idea about HLF and its key components we can move on to deploying HLF on kubernetes using Falcon.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Falcon
&lt;/h2&gt;

&lt;p&gt;Falcon is an open source, hyperledger fabric deployment helper designed to streamline the deployment and management of Hyperledger Fabric based blockchain networks on Kubernetes clusters.&lt;br&gt;
The key features provided by Falcon are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; CA Management (Root CA, TLS CA &amp;amp; Intermediate CAs)&lt;/li&gt;
&lt;li&gt; Peer Creation &lt;/li&gt;
&lt;li&gt; Orderer Creation&lt;/li&gt;
&lt;li&gt; Channel Management&lt;/li&gt;
&lt;li&gt; Chaincode Lifecycle Management (Install, Approve, Commit and CC Upgrades)&lt;/li&gt;
&lt;li&gt; Cryptographic operations support and certification management&lt;/li&gt;
&lt;li&gt; Domain Name support and SNI Based Routing&lt;/li&gt;
&lt;li&gt; Ingress resource provisioning&lt;/li&gt;
&lt;li&gt; File Registry support for centralised config files&lt;/li&gt;
&lt;li&gt; Support for Hyperledger Fabric 2.3+&lt;/li&gt;
&lt;li&gt; Multi-zone, Multi-DC, Private Network (On-prem DCs) deployment support.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Steps to deploy a HLF Network on kubernetes cluster
&lt;/h2&gt;
&lt;h4&gt;
  
  
  Prerequisites
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deploy nginx ingress with the ingress service exposed by two Nodeports for Ports: 80/TCP, 443/TCP&lt;/strong&gt;
Depending on whether you are deploying on a public cloud or on your infrastructure in a data center, you can deploy an ingress service with a cloud native load-balancer or NodePort to allow access to the Ingress Controller.
You can refer to &lt;a href="https://platform9.com/learn/v1.0/tutorials/nginix-controller-via-yaml" rel="noopener noreferrer"&gt;https://platform9.com/learn/v1.0/tutorials/nginix-controller-via-yaml&lt;/a&gt; for a detailed explanation on the deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edit the ingress deployment to enable the ssl passthrough&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;kubectl edit deployments.apps -n ingress-nginx ingress-nginx-controller&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdgle9w7vjn5tkf8soka.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdgle9w7vjn5tkf8soka.png" alt="Image description" width="712" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add Configurable DNS&lt;/strong&gt;
You need to add custom DNS zones that are resolvable from the pods. If you're using CoreDNS, follow this guide to add custom zones on your Kubernetes cluster &lt;a href="https://coredns.io/2017/05/08/custom-dns-entries-for-kubernetes/" rel="noopener noreferrer"&gt;https://coredns.io/2017/05/08/custom-dns-entries-for-kubernetes/&lt;/a&gt;. If deploying to GKE on GCP, you can make use of CloudDNS private zones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add the &lt;code&gt;A record(s)&lt;/code&gt; that points to the server(s) where the Ingress is listening.&lt;/strong&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj48ugwfsv24t4r8gbtaq.png" alt="Image description" width="800" height="324"&gt;
It must be a wildcard DNS entry. Eg, If your domain name is &lt;code&gt;my-hlf-domain.com&lt;/code&gt; and you have the worker node as &lt;code&gt;172.100.1.2&lt;/code&gt;. Then you need to create a DNS entry *.my-hlf-domain.com to point to above IP. This is a must have configuration and make sure that wildcard DNS queries are resolving properly.
If you're in any public cloud platform, then hard coding the worker node IP in the DNS is not a reliable approach since the worker node can be changed at any time. In that case, you can deploy an Internal Cloud LB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provision a &lt;code&gt;storageclass&lt;/code&gt;&lt;/strong&gt; that supports dynamic volume provisioning like rook-ceph or standard.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  HLF Network
&lt;/h4&gt;

&lt;p&gt;Clone the &lt;a href="https://github.com/npci/falcon" rel="noopener noreferrer"&gt;falcon repository&lt;/a&gt; and navigate to the root directory to begin the deployment using the sample example.`&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deploy a filestore server&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The filestore server is the nginx deployment with custom rules to support uploading over curl which stores common artifacts like chaincode, collection config file etc.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install filestore -n filestore helm-charts/filestore/ -f examples/filestore/values.yaml --create-namespace&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
You can check if your filestore server is up and running with &lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;kubectl get pods -n filestore&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
The output should be something like&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkxvnreh7hwskjyftrler.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkxvnreh7hwskjyftrler.png" alt="Image description" width="645" height="43"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deploy Root CA&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create the orderer namespace in which we will deploy the Root CA. Also create a kubernetes secret with user and password as keys for this ROOTCA server.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;kubectl create ns orderer&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;kubectl -n orderer create secret generic rca-secret --from-literal=user=rca-admin --from-literal=password=rcaComplexPassword&lt;/code&gt;&lt;code&gt;&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy the Root CA Server&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install root-ca -n orderer helm-charts/fabric-ca -f examples/fabric-ca/root-ca.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
This will deploy the root-ca server for you and the server will be available at &lt;code&gt;https://root-ca.my-hlf-domain.com&lt;/code&gt;. To verify the server, you can get into any running pod in the cluster and send a curl request as below;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;curl https://root-ca.my-hlf-domain.com:&amp;lt;HTTPS-INGRESS-PORT&amp;gt;/cainfo --insecure&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwgv3n3mqhl5dhd216h4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwgv3n3mqhl5dhd216h4.png" alt="Image description" width="800" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deploy TLS CA&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create a kubernetes secret for the TLSCA and deploy the tls ca server.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;kubectl -n orderer create secret generic tlsca-secret --from-literal=user=tls-admin --from-literal=password=TlsComplexPassword&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install tls-ca -n orderer helm-charts/fabric-ca -f examples/fabric-ca/tls-ca.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
This will deploy a tls ca server for you and the server will be available at &lt;code&gt;https://tls-ca.my-hlf-domain.com&lt;/code&gt; which can be verified in the same way as root ca by hitting a curl request.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create Root CA Identitites&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install rootca-ops -n orderer helm-charts/fabric-ops/ -f examples/fabric-ops/rootca/rootca-identities.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
This step will register your initialpeerorg, orderer and org1, org2 identities with the Root CA.&lt;br&gt;
Check the pods and wait for the jobs to successfully get completed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create TLS CA Identities&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install tlsca-ops -n orderer helm-charts/fabric-ops/ -f examples/fabric-ops/tlsca/tlsca-identities.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
This step will register your orderer0, orderer1, orderer2 and peer0, peer1, peer2 of initialpeerorg, org1 and org2 with the TLS CA.&lt;br&gt;
Check the pods here as well and wait for the jobs to successfully get completed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deploy Orderer ICA&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will deploy the Orderer ICA server which registers itself with Root CA.&lt;br&gt;
Before deploying the Orderer ICA you need to create a secret with same username and password as being used while registering the ica-orderer identity with the root ca.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;kubectl -n orderer create secret generic orderer-secret --from-literal=user=ica-orderer --from-literal=password=icaordererSamplePassword&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Now we need to apply the helm chart to deploy Orderer ICA.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install ica-orderer -n orderer helm-charts/fabric-ca -f examples/fabric-ca/ica-orderer.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deploy Initial peer org ICA&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will deploy the Initial Peer Org ICA server which registers itself with Root CA.&lt;br&gt;
Similar to Orderer ICA we need to create the namespace and the secret here as well.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;kubectl create ns initialpeerorg&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;kubectl -n initialpeerorg create secret generic initialpeerorg-secret --from-literal=user=ica-initialpeerorg --from-literal=password=initialpeerorgSamplePassword&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Now we need to apply the helm chart to deploy the Initial Peer Org ICA.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install ica-initialpeerorg -n initialpeerorg helm-charts/fabric-ca -f examples/fabric-ca/ica-initialpeerorg.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Check the init container logs to make sure the authentication and ica enrollment is successful.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create Orderer identities with ica-orderer&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This step will register orderer identities i.e. orderer0, orderer1, orderer2 with the orderer-ica.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install orderer-ops -n orderer helm-charts/fabric-ops/ -f examples/fabric-ops/orderer/orderer-identities.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create Initialpeerorg identities with ica-initialpeerorg&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This step will register the initialpeerorg identities i.e admin, peer0, peer1, peer2 identities with the initialpeerorg-ica.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install initialpeerorg-ops -n initialpeerorg helm-charts/fabric-ops/ -f examples/fabric-ops/initialpeerorg/identities.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Generate Genesis block &amp;amp; Channel transaction file&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This step will create the &lt;code&gt;Genesis block&lt;/code&gt; which is the first block in any blockchain based system and a &lt;code&gt;channel transaction&lt;/code&gt; file which contains channel name and the consortium which is allowed to use the channel.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install cryptogen -n orderer helm-charts/fabric-ops/ -f examples/fabric-ops/orderer/orderer-cryptogen.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deploy Orderers&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will deploy your network's orderer.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install orderer -n orderer helm-charts/fabric-orderer/ -f examples/fabric-orderer/orderer.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Note: Disable metrics in the yaml if you do not have CRDs and ServiceMonitor installed on your kubernetes cluster.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deploy Peers on Initial peer org&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install peer -n initialpeerorg helm-charts/fabric-peer/ -f examples/fabric-peer/initialpeerorg/values.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
After successful deployment of the Peers, you will get 3 peers in initialpeerorg namespace. Each of these peers will have 1 Init container and 3 app containers (Fabric Peer, Dind &amp;amp; CouchDB). If everything went fine, then you'll see some successful connectivity logs in the peer0-initialpeerorg-0.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create channel&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This step creates a channel named &lt;code&gt;mychannel&lt;/code&gt;&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install channelcreate -n initialpeerorg helm-charts/fabric-ops/ -f examples/fabric-ops/initialpeerorg/channel-create.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
You will be able to see similar logs after the successful completion of the job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsa8jk4d57qigi88f0rs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsa8jk4d57qigi88f0rs.png" alt="Image description" width="800" height="35"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Update Anchor peers of Initial peer org&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install updateanchorpeer -n initialpeerorg helm-charts/fabric-ops/ -f examples/fabric-ops/initialpeerorg/update-anchor-peer.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
This updates the anchor peers of the initialpeerorg which enable communication between peers of different organizations and discover all active participants of the channel.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Install chaincode on Initialpeerorg Peers&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before you install chaincode , you need to upload the packaged chaincode file to the filestore under your project directory and give the rwx permission to the file.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;kubectl cp &amp;lt;chaincode.tar.gz&amp;gt; filestore/&amp;lt;filestore-pod-name&amp;gt;:/usr/share/nginx/html/yourproject&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Change the name of the chaincode tar file accordingly in the &lt;code&gt;install-chaincode.yaml&lt;/code&gt; helm values file at &lt;code&gt;Values.cc_tar_file&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To install chaincode run &lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install installchaincode -n initialpeerorg helm-charts/fabric-ops/ -f examples/fabric-ops/initialpeerorg/install-chaincode.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Once your job is completed you can check the logs to assure successful installation&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpwfhk4n57acic5esxqu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpwfhk4n57acic5esxqu.png" alt="Image description" width="800" height="42"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Deploy Org1 Environment&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Deploying more organisations has the similar steps as the initialpeerorg as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deploy Org1 ICA&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add Org1 to the network&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Once the new organisation ica has been deployed successfully we need to add this new org to the network. For that, you need to run the following Job in initialpeerorg. Comment out the org2 section from the Values.organizatons array in the values file examples/fabric-ops/initialpeerorg/configure-org-channel.yaml for now since we have not deployed the Org2 yet.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install configorgchannel -n initialpeerorg helm-charts/fabric-ops/ -f examples/fabric-ops/initialpeerorg/configure-org-channel.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Create Org1 identities with ica-org1&lt;/li&gt;
&lt;li&gt;Deploy Peers on Org1&lt;/li&gt;
&lt;li&gt;Install ChainCode on Org1 Peers&lt;/li&gt;
&lt;li&gt;Update Anchor peers of Org1 &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Similarly you can deploy org2 environment as well.&lt;/p&gt;

&lt;h4&gt;
  
  
  Approve &amp;amp; Commit Chain Code
&lt;/h4&gt;

&lt;p&gt;Approve &amp;amp; Commit requires collection-config optionally. You can manage it through the variable require_collection_config: "true". If you make it as true, then you must upload a collection config file to the filestore under your project directory.&lt;/p&gt;

&lt;p&gt;Sample chaincode lies at &lt;code&gt;examples/files/collection-config.json&lt;/code&gt;&lt;br&gt;
Note :- if you're changing the collection-config, then kindly update the sha256sum value under Values.collection_config_file_hash.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Approve Chaincode on Initialpeerorg&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Ensure that you have updated the name, version and package id of the chaincode in &lt;code&gt;examples/fabric-ops/initialpeerorg/approve-chaincode.yaml&lt;/code&gt; if you have uploaded your own collection-config file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cc_name&lt;/li&gt;
&lt;li&gt;cc_version&lt;/li&gt;
&lt;li&gt;cc_package_id&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run the below command to approve chaincode:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install approvechaincode -n initialpeerorg helm-charts/fabric-ops/ -f examples/fabric-ops/initialpeerorg/approve-chaincode.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
Similarly you need to approve the chaincode from all deployed orgs using their respective approve scripts.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Commit Chaincode on Initialpeerorg&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Ensure that you have updated the name, version and package id of the chaincode in &lt;code&gt;examples/fabric-ops/initialpeerorg/commit-chaincode.yaml&lt;/code&gt; if you have uploaded your own collection-config file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cc_name&lt;/li&gt;
&lt;li&gt;cc_version&lt;/li&gt;
&lt;li&gt;cc_package_id&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run below command to commit the chaincode:&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;helm install commitchaincode -n initialpeerorg helm-charts/fabric-ops/ -f examples/fabric-ops/initialpeerorg/commit-chaincode.yaml&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Voila!!! You have your HLF Network Setup up and running...&lt;/p&gt;

&lt;p&gt;To sum up, this comprehensive guide has taken you through a detailed journey, unraveling the essence of Hyperledger Fabric (HLF), its pivotal components, and the powerful tool Falcon. &lt;/p&gt;

&lt;p&gt;Remember, diving into the Falcon repository (&lt;a href="https://github.com/npci/falcon" rel="noopener noreferrer"&gt;https://github.com/npci/falcon&lt;/a&gt;) can provide deeper insights and support as you venture further into this transformative realm. Embrace the possibilities, implement the steps outlined, and witness the empowerment that Falcon brings to the deployment of Hyperledger Fabric on Kubernetes.&lt;/p&gt;

&lt;p&gt;Happy Learning.&lt;/p&gt;

</description>
      <category>hyperledgerfabric</category>
      <category>kubernetes</category>
      <category>falcon</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
