|
| 1 | +--- |
| 2 | +title: Web2 FDC Setup |
| 3 | +description: Instructions for data providers to set up the Web2 FDC attestation type. |
| 4 | +keywords: [flare-network, data-provider, fdc, web2, verifier, configuration] |
| 5 | +sidebar_position: 1 |
| 6 | +--- |
| 7 | + |
| 8 | +This guide explains how data providers can set up the [Web2 FDC attestation type](/fdc/attestation-types/web2-json). |
| 9 | +The setup involves configuring a Web2 verifier server and updating the FDC Client. |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +- Access to the [FDC Suite Deployment repository](https://github.com/flare-foundation/fdc-suite-deployment). |
| 14 | +- Access to the [FSP Deployment repository](https://github.com/flare-foundation/flare-systems-deployment). |
| 15 | +- An Ignite API key (see [Obtaining an Ignite API Key](#obtaining-an-ignite-api-key)). |
| 16 | + |
| 17 | +## Set Up Web2 Verifier |
| 18 | + |
| 19 | +1. Pull the [FDC Suite Deployment](https://github.com/flare-foundation/fdc-suite-deployment) repository version v1.2.0: |
| 20 | + |
| 21 | + ```bash |
| 22 | + git clone --branch v1.2.0 https://github.com/flare-foundation/fdc-suite-deployment.git |
| 23 | + cd fdc-suite-deployment |
| 24 | + ``` |
| 25 | + |
| 26 | +2. Configure environment variables in `.env` (see `.env.example` for reference): |
| 27 | + |
| 28 | + ```bash |
| 29 | + WEB2_IGNITE_API_KEY=your_ignite_api_key_here |
| 30 | + WEB2_SOURCE_IDS=Ignite |
| 31 | + VERIFIER_API_KEYS=key1,key2 |
| 32 | + ``` |
| 33 | + |
| 34 | +3. Run the configuration generator: |
| 35 | + |
| 36 | + ```bash |
| 37 | + ./generate-config.sh |
| 38 | + ``` |
| 39 | + |
| 40 | +4. Start the Web2 verifier server: |
| 41 | + |
| 42 | + ```bash |
| 43 | + cd web2-verifier/ |
| 44 | + docker compose up -d |
| 45 | + ``` |
| 46 | + |
| 47 | +5. (Optional) Specify memory and CPU restrictions in `docker-compose.yaml` if needed. |
| 48 | + |
| 49 | +## Update FDC Client |
| 50 | + |
| 51 | +1. Pull the [FSP Deployment](https://github.com/flare-foundation/flare-systems-deployment) repository version v1.2.0: |
| 52 | + |
| 53 | + ```bash |
| 54 | + git clone --branch v1.2.0 https://github.com/flare-foundation/flare-systems-deployment.git |
| 55 | + cd flare-systems-deployment |
| 56 | + ``` |
| 57 | + |
| 58 | +2. Set the verifier address and API key in `.env` (see `.env.example` for reference): |
| 59 | + |
| 60 | + ```bash |
| 61 | + IGNITE_WEB2JSON_URL=http://<host>:9801/verifier/web2/Web2Json/verifyFDC |
| 62 | + IGNITE_WEB2JSON_API_KEY=key1 |
| 63 | + ``` |
| 64 | + |
| 65 | + Replace `<host>` with the hostname or IP address where your Web2 verifier is running. |
| 66 | + |
| 67 | +3. Regenerate the FDC Client configuration: |
| 68 | + |
| 69 | + ```bash |
| 70 | + ./populate-config.sh |
| 71 | + ``` |
| 72 | + |
| 73 | +4. Restart the FDC Client to apply the changes: |
| 74 | + |
| 75 | + ```bash |
| 76 | + docker compose up -d |
| 77 | + ``` |
| 78 | + |
| 79 | + This pulls the latest version and recreates the container. |
| 80 | + |
| 81 | +## Obtaining an Ignite API Key |
| 82 | + |
| 83 | +API keys for the Ignite proxy are encrypted with each provider's signing policy public key and published at: |
| 84 | + |
| 85 | +- **Flare**: https://api.ignitemarket.xyz/proxy-api-keys |
| 86 | +- **Songbird**: https://api.ignitemarket.xyz/proxy-api-keys/songbird |
| 87 | + |
| 88 | +### Setup |
| 89 | + |
| 90 | +1. Clone the [verifier-indexer-api](https://github.com/flare-foundation/verifier-indexer-api) repository and install dependencies: |
| 91 | + |
| 92 | + ```bash |
| 93 | + git clone https://github.com/flare-foundation/verifier-indexer-api.git |
| 94 | + cd verifier-indexer-api |
| 95 | + yarn install |
| 96 | + ``` |
| 97 | + |
| 98 | +2. Create a `.env.decrypt` file in `scripts/web2/` with your provider's signing policy private key: |
| 99 | + |
| 100 | + ```bash |
| 101 | + PRIVATE_KEY=0x... |
| 102 | + ``` |
| 103 | + |
| 104 | +### Decrypt Your API Key |
| 105 | + |
| 106 | +1. Fetch the encrypted keys from the `scripts/web2/` directory: |
| 107 | + |
| 108 | + ```bash |
| 109 | + cd scripts/web2/ |
| 110 | + curl -s "https://api.ignitemarket.xyz/proxy-api-keys" -o ignite-api-keys.json |
| 111 | + ``` |
| 112 | + |
| 113 | + For Songbird, use `https://api.ignitemarket.xyz/proxy-api-keys/songbird` instead. |
| 114 | + |
| 115 | +2. Run the decryption script: |
| 116 | + |
| 117 | + ```bash |
| 118 | + npx ts-node decrypt-ignite-key.ts |
| 119 | + ``` |
| 120 | + |
| 121 | + This script will: |
| 122 | + 1. Load the private key from `.env.decrypt` |
| 123 | + 2. Read the keys JSON file |
| 124 | + 3. Find the entry matching your signing policy address |
| 125 | + 4. Decrypt and display your API key |
| 126 | + |
| 127 | +:::tip[What's Next] |
| 128 | + |
| 129 | +Once your Web2 FDC setup is complete, explore the FDC developer guides to learn how to use the attestation types: |
| 130 | + |
| 131 | +- [FDC Guides](/fdc/guides) - Tutorials for using FDC with Hardhat and Foundry. |
| 132 | +- [Web2 JSON Attestation Type](/fdc/attestation-types/web2-json) - Learn about the Web2 JSON attestation type. |
| 133 | + |
| 134 | +::: |
0 commit comments