accept atom payments #29

Open
zramsay wants to merge 3 commits from zach/atom-payments into main
Member

Goes with: cerc-io/stack-orchestrator#968

This PR implements support for Cosmos ATOM payments in addition to the existing Laconic testnet (alnt) payment system. Users can now make payments on the Cosmos mainnet and provide the transaction hash as payment proof for application deployments.

Configuration

  • Added ATOM payment config to webapp-deployment-status-api:
    • ATOM_PAYMENT_ADDRESS: The Cosmos address to receive payments
    • MIN_ATOM_PAYMENT: Minimum required payment (defaults to 1 ATOM)
    • COSMOS_RPC_ENDPOINT: URL for Cosmos RPC node

New Payment Verification Module

  • Created atomPayments.ts with verifyAtomPayment function to:
    • Query Cosmos RPC endpoint for transaction details
    • Verify payment recipient, amount, and success
    • Prevent double-spending with in-memory transaction tracking
    • Support marking transactions as "used" for deployments

API Enhancements

  • Added new endpoint /verify/atom-payment to:
    • Accept transaction hash and minimum amount
    • Verify ATOM payment validity
    • Track transaction usage to prevent double-spending

Glue

  • Updated run.sh to pass ATOM configuration to stack orchestrator

Stack Orchestrator Integration

  • Updated confirm_payment in util.py to:
    • First check for laconic payment validity
    • If not found, verify as ATOM payment via API call
    • Enable cross-system verification to maintain payment integrity
    • Mark transaction as used when verified for deployment

Deployer Record Updates

  • Extended WebappDeployer record format to include:
    • atomPaymentAddress: Cosmos address for payments
    • minimumAtomPayment: Minimum required ATOM amount
  • Updated CLI options in publish-webapp-deployer.py

Testing

ATOM payments can be tested by:

  1. Setting up a deployer with an ATOM payment address
  2. Making a payment to this address on Cosmos mainnet
  3. Using the transaction hash in an ApplicationDeploymentRequest
  4. Verifying the deployment proceeds successfully
Goes with: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/968 This PR implements support for Cosmos ATOM payments in addition to the existing Laconic testnet (alnt) payment system. Users can now make payments on the Cosmos mainnet and provide the transaction hash as payment proof for application deployments. ## Configuration - Added ATOM payment config to webapp-deployment-status-api: - ATOM_PAYMENT_ADDRESS: The Cosmos address to receive payments - MIN_ATOM_PAYMENT: Minimum required payment (defaults to 1 ATOM) - COSMOS_RPC_ENDPOINT: URL for Cosmos RPC node ## New Payment Verification Module - Created atomPayments.ts with verifyAtomPayment function to: - Query Cosmos RPC endpoint for transaction details - Verify payment recipient, amount, and success - Prevent double-spending with in-memory transaction tracking - Support marking transactions as "used" for deployments ## API Enhancements - Added new endpoint /verify/atom-payment to: - Accept transaction hash and minimum amount - Verify ATOM payment validity - Track transaction usage to prevent double-spending ## Glue - Updated `run.sh` to pass ATOM configuration to stack orchestrator ## Stack Orchestrator Integration - Updated confirm_payment in util.py to: - First check for laconic payment validity - If not found, verify as ATOM payment via API call - Enable cross-system verification to maintain payment integrity - Mark transaction as used when verified for deployment ## Deployer Record Updates - Extended WebappDeployer record format to include: - atomPaymentAddress: Cosmos address for payments - minimumAtomPayment: Minimum required ATOM amount - Updated CLI options in publish-webapp-deployer.py ## Testing ATOM payments can be tested by: 1. Setting up a deployer with an ATOM payment address 2. Making a payment to this address on Cosmos mainnet 3. Using the transaction hash in an ApplicationDeploymentRequest 4. Verifying the deployment proceeds successfully
zramsay added 1 commit 2025-04-30 15:14:36 +00:00
zramsay added 1 commit 2025-05-01 11:51:43 +00:00
zramsay added 1 commit 2025-05-02 18:14:17 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin zach/atom-payments:zach/atom-payments
git checkout zach/atom-payments
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/webapp-deployment-status-api#29
No description provided.