<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rushikesh Dinesh Acharya on Medium]]></title>
        <description><![CDATA[Stories by Rushikesh Dinesh Acharya on Medium]]></description>
        <link>https://medium.com/@acharyarushikesh?source=rss-829daf7d6d45------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Xxj0HAQN3t-SqFN4N_NDVw.jpeg</url>
            <title>Stories by Rushikesh Dinesh Acharya on Medium</title>
            <link>https://medium.com/@acharyarushikesh?source=rss-829daf7d6d45------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:37:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@acharyarushikesh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hyperledger Fabric Multi-Org Setup]]></title>
            <link>https://medium.com/@acharyarushikesh/hyperledger-fabric-multi-org-setup-9924eed38a1f?source=rss-829daf7d6d45------2</link>
            <guid isPermaLink="false">https://medium.com/p/9924eed38a1f</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[chaincode]]></category>
            <category><![CDATA[hyperledger-fabric]]></category>
            <dc:creator><![CDATA[Rushikesh Dinesh Acharya]]></dc:creator>
            <pubDate>Fri, 26 Apr 2019 18:11:50 GMT</pubDate>
            <atom:updated>2019-04-26T18:18:08.100Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_3DH5wm9Be-VxOq17bmKQ.png" /></figure><p>By the end of this post, you will learn how to setup Hyperledger Fabric Multi-Org Network on a single host machine.</p><p>You will also learn about the different.yaml files used for the setup.</p><p><strong>Prerequisites</strong></p><ul><li>Install <a href="https://curl.haxx.se/download.html">cURL</a></li><li>Install <a href="https://docs.docker.com/v17.09/engine/installation/linux/docker-ce/ubuntu/">docker</a></li><li>Install <a href="https://docs.docker.com/compose/install/">docker-compose</a></li><li>Install <a href="https://www.digitalocean.com/community/tutorials/how-to-install-go-on-ubuntu-18-04">Go</a></li></ul><p>Read <a href="https://hyperledger-fabric.readthedocs.io/en/release-1.4/getting_started.html">this</a> for more details.</p><p><strong>Getting started:</strong></p><p><strong>Network Setup:</strong></p><p>The network will contain two Organizations i.e Org1 &amp; Org2. To build this setup we are going to have only 1 Orderer and 1 CA but It is recommended that each Org should have its own CA and multiple orderers to avoid a single point of failure.</p><p><strong>Org1</strong> will have:</p><p>1 CA, 1 Orderer, 2 Peer nodes and 2 CouchDB as state database.</p><p><strong>Org2</strong> will have:</p><p>2 Peer nodes and 2 CouchDB.</p><p>and the Fabcar chaincode which is written in javascript.</p><p>Once you install all the prerequisites then follow below steps.</p><p>1.Clone the below git repository</p><pre><a href="https://github.com/rushikeshacharya/hyperledger-fabric">https://github.com/rushikeshacharya/hyperledger-fabric</a></pre><p>2. Change the branch to HLF_MultiOrgSetup</p><pre>cd hyperledger-fabric</pre><pre>git checkout HLF-MultiOrgSetup</pre><blockquote>In this method, we are going to use pre-generated certificates for both organizations.</blockquote><p>3. go to the Org1 directory and execute below script</p><pre>cd Org1<br>./start.sh</pre><ul><li>After successful execution of the above command, all the docker container will be up and running.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QWvXO1cB9v8191BIRu1amA.png" /><figcaption>The output of start.sh script</figcaption></figure><ul><li>You can check the running container by executing <strong>docker ps</strong></li><li>If the command is executed successfully then you will see the list of all the docker containers of Org1 with the name, instance id, etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LN5s0l1WFjjjw9icJh8M1A.png" /><figcaption>output of docker ps</figcaption></figure><p>4. Now install and instantiate the chaincode on the for Org1 by executing below command,</p><pre>./installChaincode.sh</pre><ul><li>This script will install the chaincode on the mentioned peer. In our case, it is peer0.org1.example.com which is the Endorser peer for Org1. And it will instantiate the chaincode on the <em>mychannel</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ykysvj2O590A0P2vjpycmw.png" /><figcaption>output of installChaincode.sh</figcaption></figure><p>5. Invoke the chaincode by executing the below script:</p><pre>./createCar.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AQm09vIETKQmlVidLmM6ww.png" /><figcaption>output of createCar.sh</figcaption></figure><p>6. Invoke the chaincode by executing the below script:</p><pre>./query.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*L-l2PNJDWqjyujUnYuXICw.png" /><figcaption>output of query.sh</figcaption></figure><p>You can change the values in <em>createCar.sh</em> to add a new Car and <em>query.sh</em> to query the different result.</p><p>Till now our Org1 network is up and running with the chaincode installed on it.</p><p>Now we will start the Org2 network. You can start the Org network after Step 3 also.</p><p><strong>Org 2:</strong></p><p>7. cd into Org2 directory and start the Org2 network</p><pre>cd Org2</pre><pre>./start.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KWB8BWk-UQDJ6NCeiahQWA.png" /><figcaption>output of start.sh</figcaption></figure><ul><li>Again check the docker container by executing <strong><em>docker ps</em></strong> command. You will get all the running container of Org1, Org2 &amp; chaincode.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9iA22-6EVNJ2LnmVFRjbg.png" /><figcaption>output of docker ps</figcaption></figure><p>8. Now we will install the chaincode on Org2’s peer, i.e peer0.org2.example.com which is the Endorser node for Org2 so that we can invoke the chaincode functions through peer0.org2.example.com.</p><pre>./installChaincode.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVVQgJl-e9UGswlXWLYMbA.png" /></figure><ul><li>There is no need to instantiate the chaincode again on the channel.</li></ul><p>9. Now invoke the chaincode functions by executing the below script:</p><pre>./createCar.sh</pre><ul><li>Only the first time this script will take time because whenever the chaincode gets invoked for the first time, docker container will get created for the chaincode.</li></ul><p>10. Now you can check the result by executing below command:</p><pre>./query.sh</pre><p>Now we will use the state database i.e CouchDB to see the current values of fabcar chaincode.</p><ul><li>Hit the following URL from your browser</li><li>Peer0.org1: h<a href="http://localhost:5984/_utils/#database/mychannel_fabcar/_all_docs">ttp://localhost:5984/_utils/#database/mychannel_fabcar/_all_docs</a></li><li>Peer0.org2: <a href="http://localhost:7984/_utils/#database/mychannel_fabcar/_all_docs">http://localhost:7984/_utils/#database/mychannel_fabcar/_all_docs</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ew1B3-PH8hEFsXZcSNbmig.png" /><figcaption>World State Database</figcaption></figure><p><strong>Generating new certificates for the network.</strong></p><ol><li>Go to the directory scripts and execute below command:</li></ol><pre>cd scripts</pre><pre>./generate.sh</pre><ul><li>Above script will generate the required certificates for the Org1 and Org2.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x6ofPjNazCZG71X-sKSXyw.png" /></figure><p>2. Now go to the below path</p><pre>cd ORG1/crypto-config/peerOrganizations/org1.example.com/ca<br></pre><ul><li>Copy the filename ending with <strong>_sk</strong>, i.e</li></ul><pre>387f77ed2453442f65ecf659d77c0d28af2030819020d5b40d860b0f96a0bf7f_sk</pre><p>3. Now open the <strong><em>docker-compose.yaml </em></strong>file and replace the existing value of <strong><em>fabric-ca-server-config </em></strong>with the copied value, and save the file. eg:</p><pre>services:<br>  ca.example.com:<br>image: hyperledger/fabric-ca<br>environment:<br>  <strong>fabric-ca-server-config</strong>/8f4608d294f2691cabb7171f7c64d759e388a66500b2dc06598d26f21720573a_sk</pre><p>replace <strong>8f460….73a_sk</strong> with <strong>387f.....bf7f_sk</strong></p><p>Note: Your values will be different.</p><p>4. Now the remaining process is the same as above. You can follow the same steps 3 to 10 from above.</p><blockquote>Understanding different <strong>yaml</strong> files used to setup Fabric Network.</blockquote><ol><li><a href="https://github.com/rushikeshacharya/hyperledger-fabric/blob/HLF-MultiOrgSetup/docs/docker-compose.README.md">Understanding docker-compose.yaml</a></li><li><a href="https://github.com/rushikeshacharya/hyperledger-fabric/blob/HLF-MultiOrgSetup/docs/crypto-config.README.md">Understanding crypto-config.yaml</a></li><li><a href="https://github.com/rushikeshacharya/hyperledger-fabric/blob/HLF-MultiOrgSetup/docs/configtx.README.md">Understanding configtx.yaml</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9924eed38a1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>