From 3a3d7702ec96c3d0e4ad5005ad7caba224215459 Mon Sep 17 00:00:00 2001 From: zramsay Date: Thu, 26 Jun 2025 15:02:28 -0400 Subject: [PATCH] fix --- README.md | 5 +++-- src/services/registry.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 30e8195..5d5ebc3 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,8 @@ Required environment variables: Client-side (must be prefixed with NEXT_PUBLIC_): - `NEXT_PUBLIC_RECIPIENT_ADDRESS` - The Cosmos address that will receive ATOM payments -- `NEXT_PUBLIC_COSMOS_RPC_URL` - The RPC URL for the Cosmos blockchain +- `NEXT_PUBLIC_COSMOS_RPC_URL` - The RPC URL for the Cosmos blockchain (used by Keplr for transactions) +- `NEXT_PUBLIC_COSMOS_API_URL` - The REST API URL for the Cosmos blockchain (used for transaction queries) - `NEXT_PUBLIC_COSMOS_CHAIN_ID` - The chain ID for Keplr wallet (e.g., cosmoshub-4) - `NEXT_PUBLIC_DOMAIN_SUFFIX` - Optional suffix to append to DNS names in the UI (e.g. ".example.com") - `NEXT_PUBLIC_EXAMPLE_URL` - Example URL to pre-fill in the URL form (e.g. "https://github.com/cerc-io/laconic-registry-cli") @@ -177,4 +178,4 @@ docker run -p 3000:3000 --env-file .env.production atom-deploy ### Laconic Registry Issues - **Failed to create record**: Check that your REGISTRY_USER_KEY and REGISTRY_BOND_ID are correctly set. -- **Transaction verification errors**: Ensure your COSMOS_RPC_URL is accessible and returns correct transaction data. +- **Transaction verification errors**: Ensure your COSMOS_RPC_URL and COSMOS_API_URL are accessible and return correct transaction data. diff --git a/src/services/registry.ts b/src/services/registry.ts index 17068c7..77267de 100644 --- a/src/services/registry.ts +++ b/src/services/registry.ts @@ -52,15 +52,15 @@ export const createApplicationDeploymentRequest = async ( export const verifyTransaction = async (txHash: string): Promise => { try { - // Use the public Cosmos RPC URL for verification - const rpcEndpoint = process.env.NEXT_PUBLIC_COSMOS_RPC_URL; - if (!rpcEndpoint) { - console.error('NEXT_PUBLIC_COSMOS_RPC_URL environment variable not set'); + // Use the public Cosmos API URL for verification queries + const apiEndpoint = process.env.NEXT_PUBLIC_COSMOS_API_URL; + if (!apiEndpoint) { + console.error('NEXT_PUBLIC_COSMOS_API_URL environment variable not set'); return false; } - // Use Axios to directly query the Cosmos transaction - const response = await axios.get(`${rpcEndpoint}/cosmos/tx/v1beta1/txs/${txHash}`); + // Use Axios to directly query the Cosmos transaction via REST API + const response = await axios.get(`${apiEndpoint}/cosmos/tx/v1beta1/txs/${txHash}`); // Check if transaction exists and was successful // The Cosmos API returns a tx_response object with a code field - 0 means success