> For the complete documentation index, see [llms.txt](https://docs.bitsafe.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bitsafe.finance/beth/get-started/install-and-validate-dars.md).

# Install and validate DARs

[BETH environments and prerequisites](/beth/get-started/environments-and-prerequisites.md)

### Outcome

Upload the BETH DAR packages required for minting and redemption to a Canton participant, then confirm that the expected BETH packages are present.

{% hint style="info" %}
BETH DAR packages are required for minting and redemption, according to the `bitsafe-token-lib` `v0.2.0` DAR guidance. They are not required for sending or receiving BETH or for UTXO management.
{% endhint %}

### Before you start

You need:

* Administrative access to the target Canton participant.
* An approved connection to the participant Admin API. The repository examples use `localhost:5002`; use the endpoint and connection method documented for the target environment.
* A participant administrator JWT if the Admin API requires authentication.
* `grpcurl`, `jq`, and `base64` for the recommended upload path.
* A Rust toolchain for the `check_dars` validation example.
* The pinned [`bitsafe-token-lib` `v0.2.0` release](https://github.com/DLC-link/bitsafe-token-lib/releases/tag/v0.2.0).
* The current compatibility row for the target Canton version, BETH DAR release, and environment.

{% hint style="info" %}
Treat administrator tokens as secrets. Retrieve them through the approved secret-management process. Do not commit tokens, add them to documentation, or leave them in a modified copy of the upload script.
{% endhint %}

### 1. Get the pinned DAR release

```bash
git clone https://github.com/DLC-link/bitsafe-token-lib.git
cd bitsafe-token-lib
git checkout v0.2.0
```

Confirm that the repository contains `dars/upload_dars.sh`, `dars/dependencies/`, and `dars/beth/`.

### 2. Confirm the Admin API connection

Establish the approved port-forward or network path to the participant Admin API. If the target differs from the repository default `localhost:5002`, set the `canton_admin_api_url` environment variable:

```bash
export canton_admin_api_url="<admin-api-host:port>"
```

Do not proceed until the endpoint is confirmed to belong to the intended participant and environment.

### 3. Configure authentication

If the Admin API requires authentication, expose the administrator token to the script through the `jwt_token` environment variable:

```bash
export jwt_token="<participant-admin-jwt>"
```

If the Admin API does not require authentication, leave `jwt_token` empty. Follow the authentication flow documented for the target environment.

### 4. Upload the DARs

The recommended repository path uses the gRPC upload script. Pass the asset name to the script:

```bash
dars/upload_dars.sh beth
```

The script uploads:

1. Dependency DARs from `dars/dependencies/`.
2. BETH DARs from `dars/beth/`.

For every upload, the script requests package vetting and synchronized vetting. The script stops at the first DAR that fails to upload. Canton skips a DAR that is already present, so the repository guidance describes the script as safe to run again.

{% hint style="info" %}
Verify the upload response itself. Do not treat the script's printed success line as sufficient proof that the Admin API accepted every package.
{% endhint %}

### 5. Check the installed BETH DARs

The repository includes a Rust example that compares the DARs in `dars/dependencies/` and `dars/beth/` with the packages on the participant:

```bash
ASSET=beth cargo run --example check_dars
```

The example reads `LEDGER_HOST` and the Keycloak values from `.env`. It does not need `ENVIRONMENT` or `PARTY_ID`.

The example prints `PASS` when every required package is present. Otherwise, it prints `FAIL`, lists each missing package, and exits with a non-zero code.

Record this output with the environment and release tag used for the installation. Remove tokens and other sensitive values before sharing diagnostic output.

### 6. Verify the result

A successful installation should meet all of these checks:

* [ ] Every expected dependency upload returned an accepted or already-present result.
* [ ] Every expected BETH upload returned an accepted or already-present result.
* [ ] `check_dars` reports `PASS` for the BETH DAR set.
* [ ] The recorded package set matches the Engineering-approved release manifest for the target environment.
* [ ] A read-only BETH preflight succeeds before any mint or redemption is attempted.

{% hint style="info" %}
The `check_dars` example is a presence check, not a complete compatibility test. It does not verify application behavior or compatibility with the participant version. Complete the release-specific acceptance test after checking the maintained package manifest.
{% endhint %}

### Expected result

The target participant contains the approved BETH and dependency DAR set for the selected environment. The `check_dars` result shows every expected package as present, and the environment passes the approved read-only preflight.

### Troubleshooting

| Symptom                                                | Check                                                                                                   | Next action                                                                                                 |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| Connection refused or unavailable                      | Port-forward, host, port, participant identity, and Admin API availability.                             | Restore the approved Admin API connection. Do not switch environments or ports by trial and error.          |
| Unauthenticated or permission denied                   | Whether the Admin API requires a token and whether the token has participant administrator permissions. | Obtain a new token through the approved process. Do not paste the token into a support ticket.              |
| `check_dars` reports missing packages                  | Target participant, upload responses, the `ASSET` value, and the ledger connection.                     | Stop before minting or redemption. Collect redacted logs and escalate with the release tag and environment. |
| Some packages appear but the release set is incomplete | Dependency and BETH upload responses, release manifest, and package vetting status.                     | Do not mix releases. Reconcile against the approved manifest before retrying.                               |

### Alternative Canton upload path

The repository also includes the Canton console scripts `00_UploadDars.sc` and `00_ValidateDars.sc`. In `v0.2.0`, these scripts upload and list CBTC DARs only. Use the recommended gRPC path for BETH.

### Technical sources

* [`bitsafe-token-lib` `v0.2.0` DAR guidance](https://github.com/DLC-link/bitsafe-token-lib/blob/v0.2.0/dars/README.md)
* [Recommended gRPC upload script](https://github.com/DLC-link/bitsafe-token-lib/blob/v0.2.0/dars/upload_dars.sh)
* [DAR check example](https://github.com/DLC-link/bitsafe-token-lib/blob/v0.2.0/examples/check_dars.rs)
* [DAR inventory script](https://github.com/DLC-link/bitsafe-token-lib/blob/v0.2.0/dars/00_ValidateDars.sc)
* [Alternative Canton upload script](https://github.com/DLC-link/bitsafe-token-lib/blob/v0.2.0/dars/00_UploadDars.sc)
* [Scala prerequisites](https://github.com/DLC-link/bitsafe-token-lib/blob/v0.2.0/dars/scala-prerequisites.md)

### Related pages

* [BETH environments and prerequisites](/beth/get-started/environments-and-prerequisites.md)
* [BETH authentication](/beth/get-started/authentication.md)
* [Mint BETH](/beth/guides/mint-beth.md)
* [Redeem BETH](/beth/guides/redeem-beth.md)
* [BETH compatibility and release notes](/beth/concepts-and-reference/compatibility-and-release-notes.md)

### Next step

👉 **Configure access:** [BETH authentication](/beth/get-started/authentication.md).


---

# 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.bitsafe.finance/beth/get-started/install-and-validate-dars.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.
