<?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 Anmolbansal on Medium]]></title>
        <description><![CDATA[Stories by Anmolbansal on Medium]]></description>
        <link>https://medium.com/@anmolbansal1807?source=rss-4446542540b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Anmolbansal on Medium</title>
            <link>https://medium.com/@anmolbansal1807?source=rss-4446542540b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:43:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anmolbansal1807/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[Building a Hyperledger Cacti Polkadot Connector: A Step-by-Step Developer Guide]]></title>
            <link>https://medium.com/@anmolbansal1807/building-a-hyperledger-cacti-polkadot-connector-a-step-by-step-developer-guide-cc75221d2b1e?source=rss-4446542540b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc75221d2b1e</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[hyperledger]]></category>
            <category><![CDATA[polkadot]]></category>
            <category><![CDATA[interoperability]]></category>
            <category><![CDATA[lfx-mentorship]]></category>
            <dc:creator><![CDATA[Anmolbansal]]></dc:creator>
            <pubDate>Fri, 27 Dec 2024 17:04:23 GMT</pubDate>
            <atom:updated>2024-12-27T17:04:23.693Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hyperledger Cacti Polkadot Connector development lifecycle</h3><h3>Introduction</h3><p>Hyperledger Cacti is an open-source, open-development, enterprise-grade software framework designed to address the blockchain/DLT fragmentation and interoperability problem. This blog post provides a detailed developer-focused walkthrough of creating a new connector plugin for Substrate-based chains, such as Polkadot and Kusama. By following these steps, you can expand Hyperledger Cacti’s functionality and enable interactions with Substrate blockchains.</p><h3>Hyperledger Cacti Polkadot connector</h3><p>The Hyperledger Cacti Polkadot connector acts as a bridge between Hyperledger Cacti and Polkadot, a layer-zero blockchain network. Polkadot enables independent blockchains (parachains) to connect and leverage shared security, consensus, and interoperability. This connector extends Hyperledger Cacti’s capabilities by facilitating seamless interaction with Substrate-based blockchains.</p><h3>Features of the Polkadot Connector</h3><ul><li><strong>Expanded Ecosystem:</strong> Adds a critical connector plugin to the Hyperledger Cacti plugin registry, enabling users to transfer data and assets between Hyperledger Cacti ledgers and Polkadot-based chains.</li><li><strong>Substrate Integration:</strong> Enables interactions with any Substrate-based blockchain, such as Aleph Zero and Acala, extending beyond Polkadot itself.</li></ul><h3><strong>Current Scope</strong></h3><p>The initial implementation focuses on foundational operations, including:</p><ul><li><strong>Deploying Smart Contracts:</strong> Supports the deployment of Ink! smart contracts designed for Substrate.</li><li><strong>Transaction Execution:</strong> Allows execution of transactions on the connected blockchain ledger.</li><li><strong>Ink! Contract Interaction:</strong> Facilitates function calls within Ink! smart contracts deployed on the Polkadot network.</li></ul><p>These core features lay the groundwork for more advanced functionalities in the future.</p><h3>Hyperledger Cacti Plugin Development Lifecycle</h3><p>Developing a Hyperledger Cacti connector plugin involves several key stages. Below is an overview of the development process for the Polkadot connector:</p><h4><strong>Creation of docker all-in-one-image and test-tooling class</strong></h4><p><strong>Docker Image</strong>:</p><p>A Docker image containing a Substrate node serves as a blockchain playground for deploying smart contracts, executing transactions, and testing functionalities.</p><ul><li><strong>Multi-Stage Build:</strong> Uses a multi-stage build process to optimize image size by separating the build and runtime stages.</li><li><strong>Base Image:</strong> Starts with the paritytech/ci-linux:production image, which includes tools for building Substrate contracts and nodes.</li><li><strong>Health Check:</strong> Implements a script to monitor node health.</li><li><strong>Port Exposure:</strong> Exposes the node’s operating port for plugin interactions.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26610e9f2bc86a755d8228289f0d1d55/href">https://medium.com/media/26610e9f2bc86a755d8228289f0d1d55/href</a></iframe><p><strong>Test Tooling Class:</strong></p><p>A dedicated test tooling class, modeled after existing tooling for plugins like Besu and Fabric, manages container operations such as starting, stopping, and retrieving container details. This class is essential for programmatically initiating the ledger and validating plugin functionality.</p><h3>2. Writing Test Cases to Interact with the Test Ledger</h3><p>With the Dockerized Substrate node and test tooling in place, the next step is writing test cases to ensure the connector’s functionality:</p><ul><li><strong>Test Flow:<br>- </strong>Connect to the test Substrate node container.<br>- Execute transactions using the runTransaction() function from the Polkadot.js library.<br>- Validate results.</li><li><strong>Example Test Case:</strong> A basic transaction execution test demonstrates the connector’s capability and serves as a template for additional test scenarios.</li></ul><h4>OpenAPI file creation</h4><p>Define an OpenAPI (OAS) specification file for the Polkadot connector. This serves as a blueprint, detailing the connector’s functionalities:</p><ul><li><strong>Request Parameters:</strong> Specify inputs such as transaction payloads for methods like runTransaction().</li><li><strong>Response Data:</strong> Define outputs, such as transaction confirmations.</li><li><strong>Endpoint Definition:</strong> List endpoints for each exposed method.</li></ul><p>For Example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd432d7077b1be0a221fcc28bdff5c98/href">https://medium.com/media/bd432d7077b1be0a221fcc28bdff5c98/href</a></iframe><p>The OAS file also allows you to define endpoints for each method exposed by your connector. These endpoints act as entry points for users to interact with your connector’s functionalities.</p><p>For Example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62276a1202b091ebe6c71dbd15b28217/href">https://medium.com/media/62276a1202b091ebe6c71dbd15b28217/href</a></iframe><h4>Code Generation</h4><p>Add the following scripts to package.json to generate TypeScript code based on the OpenAPI specification:</p><pre>...<br>&quot;codegen&quot;: &quot;run-p &#39;codegen:*&#39;&quot;,<br>&quot;codegen:openapi&quot;: &quot;npm run generate-sdk&quot;,<br>&quot;generate-sdk&quot;: &quot;openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore&quot;<br>...</pre><p>Run npm run codegen to automatically generate TypeScript code that includes classes and functions corresponding to the OpenAPI-defined functionalities.</p><h4>Creation of the main Polkadot connector class</h4><p>Extract the connector library code from the test cases and integrate it into a dedicated Polkadot Connector class. This class encapsulates the core functionalities required to interact with the Substrate ledger.</p><ul><li><strong>Functionalities:<br>- </strong>Connecting to the ledger.<br>- Deploying smart contracts.<br>- Executing transactions.</li><li><strong>Test Case Updates:</strong> Modify test cases to use the methods exposed by the connector class, ensuring seamless integration.</li></ul><p>For Example the run transaction test case looks like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/373d12bbb9fb890b13c6695409032e16/href">https://medium.com/media/373d12bbb9fb890b13c6695409032e16/href</a></iframe><p>Here’s the code for the connector class methods:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd1e24fcb4ef3e4cb57b063269aee88a/href">https://medium.com/media/dd1e24fcb4ef3e4cb57b063269aee88a/href</a></iframe><h4>Reference Architectural Diagrams and Documentation</h4><p><strong>Architectural Diagrams</strong></p><p>Create high-level diagrams using tools like PlantUML to visually represent the connector’s architecture and component interactions. These diagrams:</p><ul><li>Enhance understanding of the connector’s design.</li><li>Simplify communication of complex concepts.</li></ul><p><strong>README File</strong></p><p>Include the following in the README:</p><ul><li><strong>Diagrams:</strong> Embed architectural diagrams.</li><li><strong>Explanations:</strong> Provide detailed descriptions of the connector’s functionalities and workflows.</li></ul><h4>Conclusion</h4><p>By following these steps, you can develop a robust Hyperledger Cacti Polkadot connector, expanding the framework’s reach to Substrate-based blockchains. The merged pull request for this project can serve as a reference for creating your own ledger plugin and contributing to the Hyperledger Cacti ecosystem:</p><p><a href="https://github.com/hyperledger/cacti/pull/2877">https://github.com/hyperledger/cacti/pull/2877</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc75221d2b1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>