A lightweight application that allows users to burn GALA tokens on mainnet in order to receive GALA tokens on testnet.
This project consists of a single frontend application built with Vue.js and Vite.
- Node.js (v14 or later)
- npm or yarn
- Git
-
Clone the repository:
git clone https://github.com/jehosephat/gala-faucet.git cd gala-faucet
-
Install dependencies:
npm install
-
Create a
.env
file in thegala-faucet-frontend
directory with the following content:VITE_BURN_GATEWAY_API=<gateway where burn transactions are sent> VITE_FAUCET_GATEWAY_API=<gateway where faucet transactions are sent (minting)> VITE_BURN_GATEWAY_PUBLIC_KEY_API=<gateway for burn public key contract> VITE_FAUCET_GATEWAY_PUBLIC_KEY_API=<gateway for faucet public key contract> VITE_GALASWAP_API=<GalaSwap API endpoint> VITE_FAUCET_MULTIPLIER=<multiplier for the faucet (10 = 1:10)> VITE_FAUCET_ADMIN_PRIVATE_KEY=<private key of the faucet admin> VITE_FAUCET_ADMIN_PUBLIC_KEY=<public key of the faucet admin> needed for DER signatures
Replace the placeholders with your actual values.
-
Start the frontend development server:
npm run dev
- Open your browser and navigate to
http://localhost:3000
(or the port specified by Vite). - Connect your wallet using the "Connect Wallet" button.
- Once connected, you'll see your GALA balance on both mainnet and testnet.
- Enter the amount of GALA tokens you want to burn on mainnet.
- Click "Burn GALA" to initiate the transaction.
- Once the transaction is confirmed, you'll receive an amount of GALA tokens on the testnet equal to the amount of GALA tokens you burned on mainnet times the multiplier set in the .env file.
- The main application component is in
src/App.vue
. - Individual components are located in
src/components/
:WalletConnect.vue
: Handles wallet connectionBalance.vue
: Displays GALA balance information for mainnet and testnetBurnGala.vue
: Handles the burning and minting process
- Environment variables are defined in the
.env
file and typed insrc/env.d.ts
. - The Vite configuration is in
vite.config.js
.