Deployment
This guide covers deploying ShieldFlow contracts and services. The system uses Foundry for contract deployment and Docker Compose for service orchestration.
Infrastructure Overview
Prerequisites
Node.js 18+
Required for service dependencies and build tooling
Foundry
Forge, Cast, and Anvil for contract compilation, deployment, and interaction
Docker + Docker Compose
Container runtime for running ASP and Relayer services
Alchemy / Infura RPC
Reliable JSON-RPC endpoint for the target chain
Deployer wallet with ETH
Funded account for contract deployment and role configuration
Contract Deployment
Deploy the ShieldFlow contracts using Foundry's scripting system. The deployment script handles deploying the Entrypoint, Privacy Pools, and Verifier contracts in the correct order.
Step 1: Install Dependencies
cd packages/contracts && forge installStep 2: Deploy Contracts
Run the deployment script targeting your network. The --verify flag automatically verifies contracts on Etherscan.
forge script script/Deploy.s.sol:EthereumSepolia \
--rpc-url $RPC_URL --account DEPLOYER --broadcast --verifyStep 3: Grant Roles
After deployment, grant the ASP_POSTMAN role to the postman address so the ASP service can publish compliance data on-chain.
cast send $ENTRYPOINT \
"grantRole(bytes32,address)" \
$ASP_POSTMAN_ROLE $POSTMAN_ADDRESSService Configuration
ASP Service
The ASP (Association Set Provider) service indexes on-chain events, performs compliance screening via Nominis, and publishes association sets to IPFS. Configure it with the deployed contract addresses, pool start blocks, and compliance provider credentials.
{
"entrypoint": "0x...",
"pools": {
"ETH": "0x...",
"USDC": "0x..."
},
"startBlocks": {
"ETH": 5000000,
"USDC": 5000000
},
"compliance": {
"chainalysis": {
"apiKey": "$CHAINALYSIS_API_KEY",
"endpoint": "https://api.chainalysis.com"
},
"trmLabs": {
"apiKey": "$TRM_LABS_API_KEY",
"endpoint": "https://api.trmlabs.com"
}
},
"ipfs": {
"pinataJwt": "$PINATA_JWT",
"gateway": "https://gateway.pinata.cloud"
}
}Relayer
The Relayer quotes withdrawal fees and broadcasts transactions on behalf of users. Configure it with a funded signer key, per-chain settings, and supported asset fee parameters.
{
"feeReceiver": "0x...",
"signerKey": "$RELAYER_SIGNER_KEY",
"chains": {
"11155111": {
"rpcUrl": "$RPC_URL",
"entrypoint": "0x...",
"supportedAssets": ["ETH", "USDC"],
"baseFeeBPS": { "ETH": 200, "USDC": 150 }
}
}
}Docker Compose
Start both services using Docker Compose. The compose file handles networking, volume mounts, and environment variable injection.
docker compose -f docker-compose.sepolia.yml up -dProtect Sensitive Values
Service Ports
| Service | Port | Description |
|---|---|---|
| ASP Service | :4000 | Compliance screening, event indexing, IPFS publishing |
| Relayer | :3001 | Fee quoting and withdrawal transaction relay |
Verification Checklist
After deployment, verify each component is functioning correctly before directing user traffic to the system.
Contracts deployed and verified on Etherscan
ASP_POSTMAN role granted to postman address
Pools registered at Entrypoint
ASP service syncing events
Relayer quoting fees correctly
Health endpoints returning 200
Health Checks
GET /relayer/health and GET /asp/health for uptime monitoring and alerting.