> For the complete documentation index, see [llms.txt](https://docs.openg2p.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openg2p.org/products/open-agri-stack/deployment/exchange.md).

# Exchange

Installing the Exchange.

Step 2 of the [install steps](https://docs.openg2p.org/products/open-agri-stack/deployment.md#install-steps), in the namespace `agrix`, before or after the registries. What the Exchange is made of: [The Exchange](https://docs.openg2p.org/products/open-agri-stack/architecture.md#the-exchange).

In Rancher, **Apps → Charts**, namespace `agrix`, install in this order: [Commons Base](#commons-base), [Commons Services](#commons-services), [Composite](#composite). Start each once the one before is `deployed` with all its pods running.

## Commons Base

Chart **OpenG2P Commons Base** (`openg2p-commons-base`), release `commons`. Keep the defaults, except:

| Field             | Value                               |
| ----------------- | ----------------------------------- |
| Install Novu?     | **No**                              |
| Install Kafka UI? | **No** (keep **Install Kafka?** on) |

## Commons Services

Chart **OpenG2P Commons Services** (`openg2p-commons-services`), release `commons-services`. For production, first create the Consent Manager's signing key Secret ([Production](https://docs.openg2p.org/products/open-agri-stack/deployment/production.md#exchange-consent-manager-signing-key)).

| Group                  | Field                                       | Value        |
| ---------------------- | ------------------------------------------- | ------------ |
| Consent Manager        | Exchange Role                               | **exchange** |
| Consent Manager        | Partner Portal?                             | **Yes**      |
| AWE                    | Install AWE?                                | **No**       |
| Staff Portal           | Install Staff Portal UI?                    | **No**       |
| ODK                    | Install ODK Central?                        | **No**       |
| Superset               | Install Superset?                           | **No**       |
| Verifiable Credentials | Install Inji Certify?, Install Inji Verify? | **No**       |
| WebSub                 | Install WebSub?                             | **No**       |

Keep the rest at the defaults: Master Data (with the same country pack as the registries), Partner Management, Consent Manager, eSignet and the Mock Identity System on; Keymanager off. Other Consent Manager fields: [CM deployment](https://docs.openg2p.org/platform/platform-services/consent-management/deployment.md#exchange-optional).

**Use cases from the Composite in Partner Management.** Set Partner Management's catalogue source to the Composite's use cases (YAML below: `partner-management.staffPortalApi.catalogueSources`; not in the Rancher form). The **Use case** field of a policy is then a list of the Composite's published use cases, and Partner Management refuses a name the Composite does not publish. Left empty, the field is free text and only its form (`name@major`) is checked. The source can be set before the Composite is installed: until it answers, a use case is accepted with a warning for the approver.

<details>

<summary>The same choices as YAML (command-line installs)</summary>

```yaml
openg2p-awe:
  enabled: false
openg2p-inji-verify:
  enabled: false
global:
  agriStackExchange:
    role: exchange
openg2p-consent-manager:
  partnerPortal:
    enabled: true
partner-management:
  staffPortalApi:
    catalogueSources:
      - kind: use_cases
        url: http://agri-composite-api/composite/v1/use-cases
        label: Agri Stack Composite
```

</details>

## Composite

Chart **Agri Stack Composite** (`openg2p-agri-composite`), release e.g. `agri-composite`. Set each registry's partner search URL, with its public hostname (never an in-cluster service name). The registries need not be installed yet:

| Group       | Field                         | Value                                                                                                                                                                             |
| ----------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Integration | Farmer Registry Search URL    | `https://partner-fr.trial.openg2p.org/dci/registry/sync/search` ([Farmer Registry](https://docs.openg2p.org/products/open-agri-stack/deployment/farmer-registry.md#check))        |
| Integration | Crop Sown Registry Search URL | `https://partner-csr.dept1.openg2p.org/dci/registry/sync/search` ([Crop Sown Registry](https://docs.openg2p.org/products/open-agri-stack/deployment/crop-sown-registry.md#check)) |

Keep the rest at the defaults (**Generate Signing Key** on). The Exchange CM reads its consent templates from this Composite in the same namespace (`http://agri-composite-api`, CM field **Consent Template Source URL**, empty by default); keep the release name `agri-composite` or set that field. Production: [Production](https://docs.openg2p.org/products/open-agri-stack/deployment/production.md#composite). All options: [Composite chart settings](https://docs.openg2p.org/products/open-agri-stack/deployment/exchange/composite-chart-settings.md).

## Check

```bash
helm -n agrix list
curl -s https://consent-manager-partner.agrix.openg2p.org/api/consent-manager-partner/.well-known/jwks.json
curl -s https://agri-composite.agrix.openg2p.org/composite/v1/use-cases
curl -s https://agri-composite.agrix.openg2p.org/.well-known/jwks.json
curl -s -o /dev/null -w '%{http_code}\n' 'https://agri-composite.agrix.openg2p.org/composite/v1/internal/consent-templates?partner=bank-a'
curl -s https://partner-management-partner-api.agrix.openg2p.org/keys/PARTNER_AGRI_COMPOSITE
```

| Expect                                    | If not                                                                                                                                                                                                     |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Three releases `deployed`                 | `kubectl -n agrix get pods`; a hook Job waiting for a service of a release not yet installed                                                                                                               |
| The CM's public keys                      | The Consent Manager's pod and log                                                                                                                                                                          |
| `loan-profile` listed                     | The Composite API's log                                                                                                                                                                                    |
| The Composite's public key                | Secret `agri-composite-signing` and the Composite API's log                                                                                                                                                |
| `404` for the internal path               | Another code: an older Composite chart, or Istio older than 1.15 ([internal API](https://docs.openg2p.org/products/open-agri-stack/deployment/exchange/composite-chart-settings.md#hostnames-and-ingress)) |
| Partner Management serving the same `kid` | **Exchange Role** not `exchange`; the PM staff API log ("Bootstrap")                                                                                                                                       |

The partner portal opens at `https://consent-partner-portal.agrix.openg2p.org`. Next: step 3 of the [install steps](https://docs.openg2p.org/products/open-agri-stack/deployment.md#install-steps).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openg2p.org/products/open-agri-stack/deployment/exchange.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
