- Quick Start Guide
- Table of Contents
- Introduction
- Quick Setup and Deployment
- Mainnet Deployment
- Additional Development Environment Details
- Troubleshooting
Follow these instructions to get started with the Stellar Disbursement Platform (SDP).
- Docker: Make sure you have Docker installed on your system. If not, you can download it from here.
- Git: You will need Git to clone the repository. You can download it from here.
- Go: Required to run the setup wizard that generates your
.env. Install from golang.org/dl. - jq: Useful for some optional scripts and diagnostics. You can install it using Homebrew:
brew install jqgit clone https://github.com/stellar/stellar-disbursement-platform.gitThis update is needed to simulate the multi-tenant capabilities of the SDP. The SDP uses the subdomain of the request URL to resolve the tenant.
Be sure that the added tenant hosts are included in the host configuration file.
To check it, you can run the command cat /etc/hosts.
To include them, you can run command sudo nano /etc/hosts and insert the lines below:
127.0.0.1 bluecorp.stellar.local
127.0.0.1 redcorp.stellar.local
127.0.0.1 pinkcorp.stellar.local
HTTPS is required for working with WebAuthn/passkeys. If you want the wizard to launch the dashboard over HTTPS (https://<tenant>.stellar.local:3443):
- Install mkcert:
brew install mkcert mkcert -install
- Generate local TLS certs (run from the repo root once):
mkdir -p dev/certs mkcert -key-file dev/certs/stellar.local-key.pem -cert-file dev/certs/stellar.local.pem \ "*.stellar.local" localhost 127.0.0.1 ::1 - When the setup wizard asks, choose HTTPS.
Use the unified setup wizard to generate accounts and a ready-to-use .env:
make setupThe wizard generates new keypairs and funds the distribution account with XLM on testnet (USDC auto-funding may be skipped depending on SDK compatibility), then writes dev/.env with values like:
# Generate a new keypair for SEP-10 signing
SEP10_SIGNING_PUBLIC_KEY=GCRSCJEVHB5JFXNZH3KYQRHSKDX3ZRFMMPKDPNX7AL3JSXJSILTV7DEW
SEP10_SIGNING_PRIVATE_KEY=SBEZHHWE2QPBIKNMVHPE5QD2JUUN2PLYNEHYQZZPQ7GYPYWULDTJ5RZU
# Generate a new keypair for the distribution account
DISTRIBUTION_PUBLIC_KEY=GBKLZHYBZR5HN6EBF5FP3A7ROMLUVWJPOWM6ZUUBB5JCK5LCIRCG65Q6
DISTRIBUTION_SEED=SDDWY3N3DSTR6SNCZTECOW6PNUIPOHDTMLKVWDQUTHLRNIKMAUIT46M6
# CHANNEL_ACCOUNT_ENCRYPTION_PASSPHRASE
CHANNEL_ACCOUNT_ENCRYPTION_PASSPHRASE=SDDWY3N3DSTR6SNCZTECOW6PNUIPOHDTMLKVWDQUTHLRNIKMAUIT46M6
# Distribution signer
DISTRIBUTION_ACCOUNT_ENCRYPTION_PASSPHRASE=SDDWY3N3DSTR6SNCZTECOW6PNUIPOHDTMLKVWDQUTHLRNIKMAUIT46M6There are three ways to run the SDP:
Start all services and provision sample tenants using the setup wizard:
make setupThe setup wizard will:
- Create or select an
.envconfiguration under thedev/directory - Generate Stellar accounts if needed (with testnet funding)
- Optionally launch the Docker environment immediately
- Optionally initialize tenants and test users
For existing configurations, you can launch directly by selecting from available .env files in the dev/ directory.
If you already have a configured .env file, you can start the services directly:
cd dev
docker compose up -dTo stop the services:
docker compose downFor local development outside Docker, run from the repo root:
go run main.go serve \
--env-file ./dev/.env.https-testnet \
--database-url "postgres://postgres@localhost:5432/sdp_mtn?sslmode=disable"You can also run the TSS by using the tss command instead of serve.
go run main.go tss \
--env-file ./dev/.env.https-testnet \
--database-url "postgres://postgres@localhost:5432/sdp_mtn?sslmode=disable"Important Notes:
- Use
--env-fileto specify which configuration to load (e.g.,./dev/.env.https-testnet) - Override
--database-urlto uselocalhost:5432instead ofdb:5432(Docker hostname) - Ensure PostgreSQL is running locally and accessible on port 5432
You can also use the ENV_FILE and DATABASE_URL environment variables instead of the flags:
ENV_FILE=./dev/.env.https-testnet \
DATABASE_URL="postgres://postgres@localhost:5432/sdp_mtn?sslmode=disable" \
go run main.go serveVolumes and Data Isolation
- The Postgres volumes are network-scoped using the pattern
${COMPOSE_PROJECT_NAME}_postgres-db-${NETWORK_TYPE}and${COMPOSE_PROJECT_NAME}_postgres-ap-db-${NETWORK_TYPE}. Compose readsNETWORK_TYPEfromdev/.env. - Compose project name is automatically derived from the setup name (e.g.,
sdp-testnet,sdp-mainnet1). - To fully reset data, manually remove Docker volumes or recreate the environment through the setup wizard.
The setup wizard automatically handles mainnet configuration when you select "pubnet (mainnet)":
-
Automatic Configuration: The wizard sets all mainnet-specific environment variables:
NETWORK_TYPE=mainnetNETWORK_PASSPHRASE=Public Global Stellar Network ; September 2015HORIZON_URL=https://horizon.stellar.orgDATABASE_NAME=sdp_mainnet(separate database for isolation)DISABLE_MFA=false(MFA enforced for mainnet)
-
Account Requirements:
- Distribution Account: Must be funded with sufficient XLM for creating channel accounts, distribution accounts for different tenants, and transaction fees
- SEP10 Signing Account: Used for authentication only, no funding required
- Assets: Must use mainnet asset issuers (not testnet issuers)
Use the setup wizard to create and launch a mainnet configuration:
make setup- Select "Create new configuration" or choose an existing mainnet
.envfile - Choose "pubnet (mainnet)" when prompted for network selection
- The wizard will automatically configure all mainnet-specific settings
- Choose to launch the environment when prompted
- The system will detect mainnet configuration and enforce security settings automatically
Note: The legacy
dev/scripts/make_env.shhas been removed. Use the setup wizard instead (make setup).
Note
In the following section, we will assume you're using the bluecorp tenant that was provisioned when you started the stack.
The startup prints Login information for each tenant.
🎉🎉🎉🎉 SUCCESS! 🎉🎉🎉🎉
Login URLs for each tenant:
🔗Tenant `redcorp`: [http://redcorp.stellar.local:3000](http://redcorp.stellar.local:3000)
username: `[email protected]`
password: `Password123!`
🔗Tenant `bluecorp`: [http://bluecorp.stellar.local:3000](http://bluecorp.stellar.local:3000)
username: `[email protected]`
password: `Password123!`
🔗Tenant `pinkcorp`: [http://pinkcorp.stellar.local:3000](http://pinkcorp.stellar.local:3000)
username: `[email protected]`
password: `Password123!`
-
Navigate to the SDP frontend service by opening a browser and going to http://bluecorp.stellar.local:3000.
-
Create First Disbursement
- Click
New Disbursement+on the Dashboard screen. You should see a funded distribution account ready for your disbursement. - Use
Demo Walletas your wallet and choose a verification method. - Select
United Statesas the Country. - Select
Date of Birthas the verification method.
- Click
-
Create and Upload a Disbursement File
- A sample file template is available sample-disbursement.csv.
- Make sure to update the invalid phone numbers before using it.
- Here is an example of a disbursement file with a single payment:
phone,id,amount,verification +13163955627,4ba1,.1,1987-12-01
-
In this example, when registering, the payment receiver will be asked to verify their phone number and date of birth which will need to match the payment file instructions.
-
Upload the CSV and then click the Review button. When you are ready to start the disbursement, click the
Confirm disbursementbutton.
-
View the Disbursement Details Dashboard
Navigate to Disbursement Details and see the payment in the disbursement is currently in a
Readystate. This means the receiver has yet to accept the invitation and deposit the funds.
The SDP now provides native SEP10 and SEP24 endpoints for wallet integration:
SEP10 Authentication Endpoints:
GET /auth- Generate authentication challengePOST /auth- Validate challenge and receive JWT token
SEP24 Interactive Deposit Endpoints:
GET /sep24/info- Get supported assets and capabilitiesPOST /sep24/transactions/deposit/interactive- Initiate interactive depositGET /sep24/transactions- Get transaction status
Stellar.toml Configuration:
The SDP automatically generates stellar.toml files that point to the native SEP10/SEP24 endpoints.
Now deposit the disbursement payment into the digital wallet using the SEP-24 deposit flow from the Wallet Client Wallet to SDP.
-
Access locally installed demo-wallet in your browser.
-
Click on
Generate Keypair for new accountto generate a new keypair. Make sure to save your public key & secret if you want to use this account later. -
Click
Create account(in front of public key) to actually create the account on the Stellar testnet. -
Your newly created account will have 10,000 XLM.
-
Clicking
Add Home Domainto edit the home domain. Enterhttp://bluecorp.stellar.local:8000and click theOverridebutton.
-
In the
Select actiondropdown, selectSEP-24 Depositand then click theStartbutton.
-
In the new window, enter the phone number
+13163955627from the disbursement CSV payment.
-
To verify the payment, enter the passcode and date of birth. You can use
000000passcode or find the actual passcode in thesdp-apicontainer logs.
-
The SEP-24 interactive pop-up will confirm the registration was successful. At this point, the SDP can associate the wallet address with the receiver phone number. It should then start processing the transaction to send the payment. If you check the dashboard, the payment should be in a
PENDINGstate.
-
Once complete, the payment status will be
Successand your wallet will have the USDC.
You need to create and configure two Stellar accounts to use the SDP. You can either create the accounts manually use the provided script to automate the process.
Option 1: Manually Create and Configure Accounts
- Create and fund a Distribution account that will be used for sending funds to receivers. Follow the instructions here.
- Create a SEP-10 account for authentication. It can be created the same way as the distribution account but it doesn't need to be funded.
- Create a
.envfile in thedevdirectory by copying the env.example file:cp .env.example .env
- Update the
.envfile with the public and private keys of the two accounts created in the previous steps.
Option 2: Use the setup wizard to create accounts and .env automatically
From the repo root, run the wizard:
make setupThis will generate SEP-10 and distribution keys, fund the distribution with XLM + USDC on testnet, and write dev/.env.
The setup wizard launches the local environment (Docker Compose), initializes tenants, and adds test users. It spins up the following services:
sdp_v2_database: The main SDP and TSS database.sdp-api: SDP service running on port8000.sdp-tss: Transaction Submission service.sdp-frontend: SDP frontend service running on port3000.demo-wallet: The demo wallet client that will be used as a receiver wallet, running on port4000.
To help collaborators debug remotely against the Docker containers, the environment started with the setup wizard also launches a development version of the Dockerfile (Dockerfile-development). This builds and runs a debug Docker container for the SDP. A sample launch.json is provided.
Follow these steps to debug remotely using VS Code or IntelliJ GoLang:
Make sure the Docker containers are up and running using the setup wizard:
make setup- Open the Project in VS Code:
- Place the
launch.jsonfile in the.vscodedirectory within your project. A samplelaunch.jsonis available here. - Open the Debug panel by clicking on the Debug icon in the Activity Bar on the side of VS Code.
- Select the
DEBUG SDP-APIconfiguration (as configured in the sample launch.json) from the dropdown. - Click the green play button or press
F5to start debugging.
-
Open the Project in IntelliJ: Open your project in IntelliJ.
-
Configure Remote Debugging:
- Go to
Run>Edit Configurations. - Click on the
+icon and selectGo Remote. - Fill in the configuration details:
- Name: DEBUG SDP-API
- Host: 127.0.0.1
- Port: 2345
- Package path: (your project path)
- Mode: remote
- Remote Path: /app/github.com/stellar/stellar-disbursement-platform
- Local Path: /${workspaceFolder}/stellar-disbursement-platform-backend
- Go to
The debugger should now attach to the running Docker container, and you should be able to hit breakpoints and debug your code.
The SDP supports monitoring via Prometheus and Grafana.
The containers can be started by running the following command from the dev directory:
docker compose -p sdp-multi-tenant -f docker-compose-monitoring.yml up -dThis will start the following services:
prometheus: Prometheus service running on port9090.grafana: Grafana service running on port3002.
- Access the Grafana dashboard by opening a browser and going to http://localhost:3002.
- Log in with the default credentials:
- Username:
admin - Password:
admin
- Username:
- Click on the
+icon on the left sidebar and selectImport Dashboard. - Copy the contents of the dashboard.json file and paste it into the
Import via dashboard JSON modeltext box.
A sample Postman collection is available in the sample directory. It contains endpoints for managing tenants, authentication, and other operations. You can import SDP.postman_collection.json into Postman to easily interact with the API.
Making payments requires transaction fees that are paid in XLM from the distribution account. Payments will start failing if the distribution account does not have enough XLM to pay for these fees. To check this:
- Find the distribution account public key in
dev/docker-compose.ymlunder the variableDISTRIBUTION_PUBLIC_KEY - Access https://horizon-testnet.stellar.org/accounts/:accountId in your browser and check the balance.
- You could also check the balance using demo wallet
- If the balance is indeed low, here are some of the options to add additional XLM to the distribution account:
-- From the repo root, use the funding tool to add XLM/USDC to an existing account:
go run tools/sdp-create-and-fund/main.go --secret SECRET_KEY --fundxlm-- Create a new funded account via Demo Wallet website and send funds to the Distribution account.
- Access https://demo-wallet.stellar.org/ in your browser.
- Click on
Generate Keypair for new accountto create a new testnet account. Your account comes with 10,000 XLM. - Click on
Sendand enter the distribution account public key and the amount you want to send. - Using Freighter or Stellar Laboratory, swap the XLM for USDC if you wish to test with USDC.
- Just use the newly created account (with 10,000 XLM) as the distribution account by updating the
DISTRIBUTION_PUBLIC_KEYvariable indev/docker-compose.ymland restarting thesdp-apicontainer.
