BLOG
BLOG
  • Design
  • Data
  • Discernment

We believe in AI and every day we innovate to make it better than yesterday. We believe in helping others to benefit from the wonders of AI and also in extending a hand to guide them to step their journey to adapt with future.

Know more

Our solutions in action for customers

DOWNLOAD

Featured Post

Neobank Vs Digital Bank: Everything you need to know about the future of banking

There is a new buzz in the tech world every day, usually about something that would simplify tasks even more than today. Neobank is one such tech advancement that has been gaining traction in the era of digital banking.

Know More
How to build a metaverse virtual world?

The term metaverse has been blowing up the internet the past few months. The news about Facebook being renamed as Meta was mixedly received with skepticism and excitement (mostly from the Matrix and Black Mirror fans). Experts define it as a whole new meaning to connecting virtually that could potentially replace its equivalent in the physical world. […]

Know More
Top 10 Doubts And Questions On NFTs Answered

NFTs are certainly the most trending tech topic these days. Since this technology enables non-fungible assets to be traded in the digital medium—artists, memorabilia collectors, etc have embraced it to build newer business models and marketplaces for NFTs. If you haven’t yet understood the concept of NFTs, the video embedded below can be helpful. Recently, […]

Know More
What is Initial Dex Offering or IDO? The benefits of IDO fundraising

Initial DEX offering or IDO is a new fundraising model that offers better liquidity of crypto assets and faster, open, and fair trading. IDO model is the successor of fundraising models such as ICO, STO, and IEO.  Before we learn about IDO crypto, let’s brush up on our knowledge of the fundraising concept via token […]

Know More
Business Intelligence & Data Analytics in Retail Industry

The traditional data analytics in retail industry is experiencing a radical shift as it prepares to deliver more intuitive demand data of the consumers. The rise of online shopping may have a major impact on the retail stores but the brick-and-mortar sales aren’t going anywhere soon. According to Euromonitor International, it is projected that 83% […]

Know More
Artificial Intelligence For Enhancing Business Security

If you are a business owner, you already know the importance of business security. Most of the businesses are just one ‘security mishap’ away from a temporary or a total failure. Security mishaps come in different sizes and shapes, such as the occurrence of fire or thefts happening inside your business premises.  All these mishaps […]

Know More

MENU

  • Visit Accubits Website.
  • Artificial Intelligence
  • Blockchain
  • Cloud Computing
  • Entertainment
  • Fintech

How to integrate Hedera and HashConnect with WordPress

  • mm
    by Rishal E P on Sat Dec 31

Among the wide range of blockchains and public networks available in the market, Hedera has a unique stronghold. It is designed to be faster and more secure than other blockchains. It also has a governance structure intended to ensure the long-term stability and integrity of the network. One of the key features of Hedera is its use of the hashgraph consensus algorithm, which allows it to achieve high transaction speeds and low fees.

Hedera is well-suited for use cases that require fast and inexpensive transactions, such as micropayments and real-time financial applications. HBAR is the native, energy-efficient cryptocurrency of Hedera that powers the decentralized economy. Whether you’re a startup or enterprise, a creator or consumer, Hedera goes beyond blockchain for developers to create the next era of fast, fair, and secure applications.

The missing links of Hedera in WordPress

As you may know, WordPress is one of the most popular content management systems used by millions of websites worldwide. One of the main reasons WordPress is so popular is that it is easy to use, even for people with little technical experience. It has a user-friendly interface and a wide range of tools and resources that make creating and managing a website easy. Not surprisingly, many NFT marketplaces use WordPress as their backbone.

When it comes to building a WordPress-based web application integrated with Hedera, there is a big challenge that needs to be addressed. WordPress does not have a straightforward integration available for Hedera Hashgraph or HashConnect.

Right now, a user will have to connect to Hashconnect via a command line or terminal. For Ethereum, we can convert NPM modules into a single file and insert that into the WordPress code to integrate MetamaeEthereum Wallets. However, this is not directly possible with Hedera.

Need help developing your Blockchain Project?

Reach out to us today for a no-obligation consultation

Contact us

Steps to integrate Hedera with WordPress

The method I tried to integrate Hedera and HashConnect with WordPress is as follows. First, I had to identify a bundler that could work well with Hedera packages. I tried multiple options like browserify, esbuild, and webpack. After multiple attempts, I found that Webpack bundler works well with Hedera.

Webpack is a static module bundler for modern JavaScript applications. When webpack processes an application, it internally builds a dependency graph from one or more entry points. Then it combines every module your project needs into one or more bundles, which are static assets to serve your content. The bundler is incredibly configurable to better fit your requirements. Detailed information on how to get started with Webpack bundler can be accessed here.

To integrate Hedera and HashConnect with WordPress, you can follow the following steps;

Step 1: Combine hashConnect and hashgraph packages.

First, you must create a js script to import hashConnect and hashgraph packages and inject them into the Window object.

// Set options as a parameter, environment variable, or rc file.
// eslint-disable-next-line no-global-assign
import { HashConnect } from "hashconnect";
import * as hashgraph from "@hashgraph/sdk";

// const connectHashGraph = require("./modules/hashConnect")
// require = require("esm")(module/* , options */)

// document.body.appendChild(connectHashGraph());
window.HashConnect = HashConnect
window.hashgraph = hashgraph
// module.exports = require("./main.js")
// ESM syntax is supported. 
import { connectHashGraph } from './modules/hashConnect' 
export {}

Step 2:  Use Webpack to create a build Using Webpack, create a build file for the combined hashconnect and hashgraph packages. Mention the source as the script file and the destination file named build.js

const path = require('path');

module.exports = { 
 entry: './index.js', 
 output: { 
  filename: 'build.js', 
  path: path.resolve(__dirname, 'dist'), 
 }, 
};

An example of the implementation can be found in this GitHub project

Hedera Hashgraph could potentially be used to add new features and functionality to a WordPress site, such as the ability to track and verify the ownership or authenticity of digital assets or to enable decentralized applications (dApps) to run on the site. I hope you found the method I explained above useful.

Related Posts

Drive into stories worth discussing

  • mm
    Technology Investments as a Catalyst for Business Growth
    Sarin Ram
  • mm
    Top tech trends to watch out for in 2023
    Rahul A R
  • mm
    Is Hedera hashgraph a good fit for building DeFi dApps?
    Rahul A R
  • mm
    What is a Third-generation Public Ledger?
    Rahul A R

ASK AUTHOR

mm
Rishal E P

Rishal is an experienced software engineer focusing on blockchain technology at Accubits Technologies Inc

Ask A Question
Error
Cancel
Send

Categories

View articles by categories

  • Blockchain

Subscribe now to get our latest posts

  • facebook
  • linkedin
  • twitter
  • youtube
All Rights Reserved. Accubits Technologies Inc