Skip to content

Quickstart

This page offers two paths:

  • Path A: the local devnet. One command starts local chains, the database and seed data. Chains, tokens, payees and a default split rule are ready, so this is the fastest way to see the whole flow.
  • Path B: a public testnet. Start the system with Docker and configure the chain, token, quote signer key, merchant contracts, payee and split rule in the console, step by step, exactly as for a live deployment.

Neither path involves real funds.

Run from the source repository, with these tools installed:

Tool Used for
Rust (cargo) Building and running flowpayra-lite
Foundry (anvil, forge, cast) The local EVM chains and contract deployment
Docker (Compose v2) PostgreSQL, Toxiproxy, Mailpit
jq, curl Used by the start script
Node 22, Solana CLI (optional) Only for the local TRON and Solana chains; without them those two families are skipped and the EVM part is unaffected

Set DEVNET_FAMILIES=evm to start the EVM chains only.

Terminal window
make devnet # start the chains and services, deploy contracts, seed data; prints the live and test API keys
source devnet/.state/server.env # devnet database, master key, quote signer key and hot wallet (public test keys)
cargo run -p flowpay-server -- serve # the server: http://localhost:8080

When make devnet finishes, the following is in place:

  • Two local EVM chains: Devnet L1 (chain ID 31337) and Devnet L2 (chain ID 31338, set to gas sponsorship); local TRON and Solana chains too when their tools are installed.
  • The merchant contracts and mock tokens (USDC, USDT, DAI and others) on each chain.
  • Three payees and a default split rule.
  • A live and a test API key, saved in devnet/.state/api-key and devnet/.state/test-api-key.

2. Create an admin and sign in to the console

Section titled “2. Create an admin and sign in to the console”

In another terminal (after source devnet/.state/server.env there as well), create the first admin. The password needs at least 12 characters:

Terminal window
FLOWPAY_ADMIN_PASSWORD='…' cargo run -p flowpay-server -- admin create --username ops --role admin

Open http://localhost:8080/admin/ and sign in with the username and password.

Console sign-in page

The first sign-in sets up a second factor: a passkey, a security key or Google Authenticator. The system then generates 10 single-use recovery codes; store them safely.

First sign-in: setting up a second factor

After signing in, the seed data is visible on these pages and works without changes:

  • Chains & tokens: the local chains that were started and their tokens.
  • Payees & rules: the registered payees, the address checks per chain, and the default split rule.

Payees & rules: registered payees and their address checks

On the Orders page choose New payment, enter the amount and currency, and choose Create payment link. An order number is generated when left blank.

Payment link ready

An order can also be created through the API; the checkout_url in the response is the payment link:

Terminal window
curl -X POST localhost:8080/v1/orders \
-H "Authorization: Bearer $(cat devnet/.state/api-key)" \
-H "Idempotency-Key: o-1" \
-H 'content-type: application/json' \
-d '{"merchant_order_no":"A-1","amount":"100.00","currency":"USD"}'
  1. Prepare a browser wallet: import the devnet payer account (account 1 of the standard Anvil mnemonic, funded with every mock token and test ETH; the account list is in devnet/README.md in the repository) and add a custom network: RPC http://127.0.0.1:8545, chain ID 31337 (Devnet L1), or RPC http://127.0.0.1:8546, chain ID 31338 (Devnet L2).
  2. Open the payment link, choose a token and a network, press the pay button and connect the wallet.
  3. Confirm in the wallet. On Devnet L2, tokens marked Gas-free only need a signature; the system’s hot wallet sends the transaction.

Checkout with a connected wallet

Once the payment reaches the required confirmations, the checkout shows Payment complete, the order’s status in the console’s Orders page becomes Confirmed, and the business system receives the order.paid webhook (when an endpoint is configured).

Checkout result page: payment complete

When finished, make devnet-down stops everything and discards the data.

The steps below use Sepolia. Testnets accept test mode orders only, so switch the console to Test before creating the payment link, or use a test API key (fpk_test_…).

  • Docker (Compose v2) and the source repository.
  • Foundry’s cast, to create the keystore file of the quote signer key.
  • A Sepolia RPC URL (https).
  • A browser wallet holding a little Sepolia ETH, to deploy the merchant contracts; and a wallet holding test tokens to pay with (for example Circle’s test USDC on Sepolia, available from Circle’s faucet).
Terminal window
docker build -t flowpayra-lite .
docker run --rm flowpayra-lite keygen # generate the master key (32 bytes, hex)
cp deploy/.env.example deploy/.env # fill in FLOWPAY_SECRETS__MASTER_KEY, FLOWPAY_SIGNER_PASSWORD, FLOWPAY_PUBLIC_URL
cast wallet new deploy/keys quote-signer.json # new quote signer keystore; its password is FLOWPAY_SIGNER_PASSWORD
docker compose --env-file deploy/.env up -d --build

For a trial on one machine, leave FLOWPAY_PUBLIC_URL at http://localhost:8080. Each setting is explained in Deployment.

Terminal window
docker compose --env-file deploy/.env exec -e FLOWPAY_ADMIN_PASSWORD='…' app flowpayra-lite admin create --username alice

Open http://localhost:8080/admin/, sign in, and set up a second factor when prompted.

The configured keystore is imported on the first start and becomes the active quote signer key; its address is shown on the Quote signer keys page. Alternatively, choose Generate a key on that page to have the server generate one.

The quote signer key’s address is embedded in the merchant contracts, so the key must exist before the contracts are deployed.

In Chains & tokens choose Add chain, pick the chain family and enter the RPC URL. The console probes the node first and fills in the chain ID, name, native coin, network type, block time, confirmations and block explorer. Sepolia is a built-in network and is marked as a testnet automatically. A new chain is added disabled.

Add chain: chain details are probed from the RPC

Open the chain’s Contracts checklist. The deployment proxy, Permit2, the FlowPay factory and the implementation contracts are shared per network, and the checklist only shows their status; the merchant deploys only its own Router and Subscriptions contracts:

  1. Connect a browser wallet and send the deployment transactions the checklist asks for. The deployer has no rights over the contracts.
  2. When every item is in place, choose Verify and record (step-up verification required). The system compares each contract’s on-chain bytecode with the released version and records the addresses.
  3. Enable the chain once verification has passed.

Contracts checklist: “Verify and record” once every check passes

The command-line equivalent and notes for other networks are in Chains and contracts.

In the chain’s token list choose Add token, enter the token contract address and choose Probe and add. The system reads the token’s symbol, decimals and authorization capabilities; fee-on-transfer and rebasing tokens are refused. A probed token is added unlisted; list it after review.

7. Register a payee and a default split rule

Section titled “7. Register a payee and a default split rule”
  1. In Payees & rules choose Register payee and enter a name and a receiving address. The address takes effect once it passes the blocklist checks.
  2. Under Split rules, create a New split rule, add payees and set their ratios (ratios must total 100%, and the first member is a ratio member: the primary payee), then Make default. With a single recipient, a rule holding that one payee at 100% is enough.

See Payees and split rules.

  1. Switch the mode in the top bar from Live to Test.
  2. On the Orders page choose New payment, enter the amount and Create payment link. The page notes “Test mode: this link accepts testnet payments only.”
  3. Open the link with the wallet holding test tokens, choose a token and network, and pay. The checkout shows a Test mode mark on test orders.
  4. Once the payment reaches the required confirmations, the checkout shows Payment complete and the order’s status in the console (in test mode) becomes Confirmed.