Skip to content

Latest commit

 

History

History
90 lines (64 loc) · 2.1 KB

File metadata and controls

90 lines (64 loc) · 2.1 KB

Getting Started with Fund-My-Cause

This guide walks you from zero to a running local environment in about 15 minutes.

1. Clone the repository

git clone https://github.com/Fund-My-Cause/Fund-My-Cause.git
cd Fund-My-Cause

2. Install dependencies

# Node workspace (installs frontend deps)
npm install

# Frontend app
cd apps/interface && npm install && cd ../..

3. Get a testnet account

Create a funded testnet keypair at Stellar Laboratory and note the secret key (starts with S).

4. Deploy contracts to testnet

export CREATOR=<YOUR_TESTNET_PUBLIC_KEY>
export TOKEN=CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC  # testnet XLM

DEADLINE=$(date -v+30d +%s 2>/dev/null || date -d "+30 days" +%s)

./scripts/deploy.sh "$CREATOR" "$TOKEN" 1000000000 "$DEADLINE" \
  10000000 "My First Campaign" "Testing Fund-My-Cause" null

The script prints:

Contract ID: C...
Registry ID: C...

Save both values.

5. Configure the frontend

cp apps/interface/.env.example apps/interface/.env.local

Edit .env.local:

NEXT_PUBLIC_CONTRACT_ID=<CONTRACT_ID from step 4>
NEXT_PUBLIC_REGISTRY_CONTRACT_ID=<REGISTRY_ID from step 4>
NEXT_PUBLIC_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
NEXT_PUBLIC_NETWORK_PASSPHRASE=Test SDF Network ; September 2015

6. Run the frontend

cd apps/interface
npm run dev

Open http://localhost:3000.

Connect Freighter (make sure it's set to Testnet), find your campaign, and try a contribution.

7. Verify the deployment

# Query your campaign stats
stellar contract invoke \
  --id <CONTRACT_ID> --network testnet \
  -- get_stats

Expected output:

{"total_raised":0,"goal":1000000000,"progress_bps":0,"contributor_count":0,...}

Next steps