Skip to content

Developer quick start

BETH overview · BETH environments and prerequisites

  1. Prepare a supported Rust environment.
  2. Check out a pinned bitsafe-token-lib release.
  3. Configure Canton and authentication values without committing secrets.
  4. Run the balance-check example.
  5. Verify that the response belongs to the intended party.

This read-only outcome is intentionally smaller than minting or transferring BETH. It verifies the core connection before you create accounts or submit ledger changes.

  • Access to an approved development or test environment.
  • A supported Canton participant and party.
  • Approved authentication credentials for that party.
  • Git and a compatible Rust toolchain.
  • Network access to the Canton participant and identity provider.
  • A secure local method for storing environment values.
Terminal window
git clone https://github.com/DLC-link/bitsafe-token-lib.git
cd bitsafe-token-lib
git checkout v0.6.0

Use an approved release tag. Do not use main in production instructions.

Terminal window
cp .env.example .env

Fill only the values required for the balance check:

  • Canton JSON Ledger API host, including the API path.
  • Target Canton party.
  • Approved identity-provider and client values required by the selected authentication flow.
  • The ENVIRONMENT value: devnet, testnet, or mainnet.
  • The ASSET value: beth.

Do not paste real credentials into documentation, issue reports, shell history, or source control.

Terminal window
cargo build --example check_balance

A successful build confirms that the selected Rust toolchain can resolve the pinned BETH and shared Canton dependencies.

Terminal window
cargo run --example check_balance

The command should:

  • Authenticate successfully.
  • Query active BETH holdings for the configured party. The query keeps only holdings whose instrument ID and admin both match the BETH instrument.
  • Report the party’s balance and holding count, including a valid zero-balance result where applicable.
  • Exit without exposing access tokens or passwords.
SymptomCheckNext action
Authentication failsProvider URL, realm or audience, client, grant type, secret, token claimsUse the canonical Authentication guide and confirm the party authorization.
Connection failsLedger host, DNS, TLS, proxy, and network accessVerify the participant endpoint with the environment owner.
No holdings are returnedTarget party, environment, and whether zero balance is validConfirm the configured party before attempting a state-changing operation.
Build or type errorsChecked-out tag, Rust toolchain, lockfile, and shared library accessReturn to the approved compatibility matrix.
Response parsing failsCanton and library compatibilityCapture sanitized output and escalate with the version set.

After the balance check passes, choose one task:

Build your first workflow: Transfer and receive BETH.