From 39f2d7c4ebec82301c465d1806239ba098086054 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Fri, 25 Jul 2025 17:17:16 +0530 Subject: [PATCH] Document relevant environment variables --- README.md | 63 +++++++++--------------------------------------- deploy/README.md | 18 +++++++++++++- 2 files changed, 28 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 35d83bb..135e5b8 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,17 @@ A simple Next.js frontend that allows users to pay in GOR tokens (configurable S - Solana wallet browser extension (Phantom or Solflare) - Access to a Laconic Registry node -## Environment Variables +## Deploy to production + +Follow [these steps](./deploy/README.md) to deploy this app to production + +## Installation + +```bash +npm install +``` + +## Development Copy the `.env.example` file to `.env.local` and fill in the required variables: @@ -51,14 +61,6 @@ Server-side: - `REGISTRY_USER_KEY` - The private key for Laconic Registry transactions (also used for LNT transfers) - `DEPLOYER_LRN` - The LRN of the deployer -## Installation - -```bash -npm install -``` - -## Development - ```bash npm run dev ``` @@ -131,43 +133,6 @@ This application was built with reference to: - `snowballtools-base/packages/backend/src/registry.ts` - Original `hosted-frontends/deploy-atom.sh` (adapted for Solana/GOR) -## Deployment to Production - -To deploy this application to production, follow these steps: - -1. Clone the repository -2. Install dependencies: `npm install` -3. Create a production build: `npm run build` -4. Set up all required environment variables in your production environment -5. Start the production server: `npm start` - -For containerized deployments, you can use the following Dockerfile: - -```dockerfile -FROM node:18-alpine - -WORKDIR /app - -COPY package*.json ./ -RUN npm ci - -COPY . . -RUN npm run build - -EXPOSE 3000 - -ENV NODE_ENV=production - -CMD ["npm", "start"] -``` - -Build and run the Docker container: - -```bash -docker build -t gor-deploy . -docker run -p 3000:3000 --env-file .env.production gor-deploy -``` - ## Known Issues - You may see a deprecated Buffer() warning during build. This comes from dependencies in the registry-sdk. This doesn't affect functionality. @@ -182,12 +147,6 @@ docker run -p 3000:3000 --env-file .env.production gor-deploy - **Connection issues**: Ensure the wallet is unlocked and try refreshing the page. - **Transaction failures**: Check that you have sufficient SOL for transaction fees and enough tokens for the payment. -### Token Configuration - -- **Wrong token**: Verify the `NEXT_PUBLIC_SOLANA_TOKEN_MINT_ADDRESS` matches your desired SPL token. -- **Incorrect decimals**: Ensure `NEXT_PUBLIC_SOLANA_TOKEN_DECIMALS` matches the token's actual decimal count. -- **Payment amount**: Adjust `NEXT_PUBLIC_SOLANA_PAYMENT_AMOUNT` to the desired payment amount. - ### Laconic Registry Issues - **Failed to create record**: Check that your REGISTRY_USER_KEY and REGISTRY_BOND_ID are correctly set. diff --git a/deploy/README.md b/deploy/README.md index 97735fd..6b8f8e5 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -61,7 +61,23 @@ # Fill in the required values nano .app.env ``` - + + - Required environment variables: + + Client-side (must be prefixed with NEXT_PUBLIC_): + - `NEXT_PUBLIC_SOLANA_RPC_URL` - The RPC URL for the Solana blockchain (SPL token transactions) + - `NEXT_PUBLIC_GORBAGANA_RPC_URL` - The RPC URL for the Gorbagana blockchain (native GOR transactions) + - `NEXT_PUBLIC_ENABLE_NATIVE_GOR_TRANSFER` - Enable native GOR token transfers (true/false) + - `NEXT_PUBLIC_SOLANA_TOKEN_RECIPIENT_ADDRESS` - The Solana address that will receive token payments + - `NEXT_PUBLIC_ALNT_COST_LRN` - LRN for ALNT token pricing + - `NEXT_PUBLIC_DEPLOYMENT_COST_LRN` - LRN for deployment cost pricing + - `NEXT_PUBLIC_DOMAIN_SUFFIX` - Suffix to append to DNS names in the UI (e.g. ".example.com") + + Server-side: + - `REGISTRY_BOND_ID` - The bond ID to use for Laconic Registry records + - `REGISTRY_AUTHORITY` - The authority for Laconic Registry LRNs + - `REGISTRY_USER_KEY` - The private key for Laconic Registry transactions (also used for LNT transfers) + - `DEPLOYER_LRN` - The LRN of the deployer ## Run