The DEX component is not active.
Install dependencies with yarn.
yarn install
The Hedera DeFi Accelerator apps utilize the hashconnect library to pair with supported wallet extensions. Currently, the only supported wallet extension is HashPack. The HashConnect 1-click pairing feature only works in an SSL secured environment (https URLs). To enable HTTPS
in your local build:
- Create an
.env
file in the root of this project. - In the
.env
file set theHTTPS
environment variable totrue
.
/* .env */
HTTPS=true
- Create an SSL certificate. There are several tools that can be used to generate a certificate and key. An easy way to do this is to use the mkcert tool.
# The [Homebrew](https://brew.sh/) macOS package manager is used for this example
# Install mkcert tool
brew install mkcert
# Install nss (only needed if you use Firefox)
brew install nss
# Setup mkcert on your machine (creates a CA)
mkcert -install
# Create a directory to store the certificate and key
mkdir -p .cert
# Generate the certificate (ran from the root of this project)
mkcert -key-file ./.cert/key.pem -cert-file ./.cert/cert.pem "localhost"
- Set the
SSL_CRT_FILE
andSSL_CRT_FILE
environment variables to the path of the certificate and key files.
/* .env */
HTTPS=true
/* Path to certificate */
SSL_CRT_FILE=./.cert/cert.pem
/* Path to key */
SSL_KEY_FILE=./.cert/key.pem
-
Make sure to include
.env
and.cert
in your.gitignore
file so this information is not committed to version control. -
Run the application with
vercel dev
(see Usage for Vercel installation). You should seehttps://
prefixed to the localhost URL.
The DeFi apps store and retrieve IPFS data using Pinata. A Pinata public key, secret key, and gateway URL are necessary for IPFS pinning and fetching features to work as intended. You will need to create a Pinata account to create a new set of keys and a gateway URL. A more comprehensive tutorial can be found in the Pinata API Docs.
PRIVATE_PINATA_API_KEY=/** Public Key **/
PRIVATE_PINATA_API_SECRET_KEY=/** Secret Key **/
VITE_PUBLIC_PINATA_GATEWAY_URL=/** Gateway URL **/
The DeFi apps utilize Vercel Serverless Functions to communicate with third-party APIs such as IPFS. You will need to install the Vercel CLI to run the applications.
vercel dev