Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 26 additions & 37 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copy this file to .env and fill in your values

# =============================================================================
# CORE CONFIGURATION (Required for all operations)
# CORE CONFIGURATION (Required for most operations)
# =============================================================================

# KEYCLOAK / OIDC AUTHENTICATION
Expand All @@ -23,30 +23,6 @@ LEDGER_HOST=https://participant.example.com
# Your party ID on the Canton network
PARTY_ID=your-party::1220abcdef...

# =============================================================================
# MINT & REDEEM OPERATIONS (Required for BTC ↔ CBTC bridging)
# =============================================================================

# BITSAFE ATTESTOR NETWORK
# Attestor URL for BTC/CBTC bridging operations
# Devnet: https://devnet.dlc.link/attestor-1
# Testnet: https://testnet.dlc.link/attestor-1
# Mainnet: https://mainnet.dlc.link/attestor-1
ATTESTOR_URL=https://devnet.dlc.link/attestor-1

# Canton network identifier for attestor API calls
# Devnet: canton-devnet
# Testnet: canton-testnet
# Mainnet: canton-mainnet
CANTON_NETWORK=canton-devnet

# Destination Bitcoin address for withdrawals (for testing withdraw account creation)
# This should be a valid Bitcoin address for your target network
# Devnet/Regtest: bcrt1q... (regtest bech32)
# Testnet: tb1q... (testnet bech32)
# Mainnet: bc1q... (mainnet bech32)
DESTINATION_BTC_ADDRESS=

# =============================================================================
# SEND & TRANSFER OPERATIONS (Required for sending CBTC to other parties)
# =============================================================================
Expand All @@ -64,27 +40,36 @@ DECENTRALIZED_PARTY_ID=cbtc-network::12202a83c6f4082217c175e29bc53da5f2703ba2675
# Mainnet: https://api.utilities.digitalasset.com
REGISTRY_URL=https://api.utilities.digitalasset-dev.com

# Optional: Transfer amount for send examples (default: 0.1)
TRANSFER_AMOUNT=0.1

# Optional: CSV file path for batch distribution (default: recipients.csv)
RECIPIENTS_CSV=recipients.csv

# =============================================================================
# STREAM EXAMPLE (for stream_cbtc example)
# DELETE EXECUTED TRANSFERS EXAMPLE (cargo run -p examples --bin delete_executed_transfers)
# =============================================================================
# RECEIVER_PARTY=receiver-party::1220...
# TRANSFER_COUNT=10

# Client secret for client credentials authentication (used instead of username/password)
KEYCLOAK_CLIENT_SECRET=your-client-secret

# Template ID of the CBTCGovernanceRules contract
CHOICE_CONTRACT_TEMPLATE_ID=package:Module:CBTCGovernanceRules
# Contract ID of the CBTCGovernanceRules contract
CHOICE_CONTRACT_ID=00abcdef...
# Template ID for the disclosed contract
DISCLOSED_CONTRACT_TEMPLATE_ID=package:Module:CBTCGovernanceRules
# Base64 blob for the disclosed contract
DISCLOSED_CONTRACT_BLOB=

# Optional: Maximum number of contracts to delete (default: unlimited)
# MAX_CONTRACTS=100
# Optional: Number of parallel threads (default: 8)
# NUM_THREADS=8
# Optional: Path to CSV file containing contract IDs (skips chain fetch if set)
# CONTRACT_IDS_CSV=contract_ids.csv

# =============================================================================
# TESTING (for running integration tests)
# =============================================================================

# Test receiver party ID (for transfer tests)
LIB_TEST_RECEIVER_PARTY_ID=example-receiver::1220...

# Transfer offer contract ID (for accept transfer test - optional, test will skip if not set)
LIB_TEST_TRANSFER_OFFER_CID=

# Client secret for ledger end tests (client credentials flow)
LIB_TEST_LEDGER_END_CLIENT_SECRET=your-client-secret-here

Expand All @@ -94,4 +79,8 @@ LIB_TEST_AMULET_CLIENT_SECRET=your-amulet-client-secret-here
# Wallet API host for amulet rules tests
WALLET_API_HOST=https://wallet.example.com

# =============================================================================
# LOGGING
# =============================================================================

RUST_LOG=trace,tungstenite=error,tokio_tungstenite=error,reqwest=error
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This library provides a Rust interface for interacting with Canton blockchain pa
| `common` | Common types for transfers and contract operations |
| `wallet` | Wallet operations (amulet rules, mining rounds) |
| `cryptography` | Cryptographic utilities (AES-256-GCM) |
| `ledgrpc` | Canton Ledger gRPC protobuf bindings (canton-proto-rs) |

### Prerequisites

Expand All @@ -52,6 +53,8 @@ keycloak = { git = "ssh://git@github.com/DLC-link/canton-lib", branch = "main" }
registry = { git = "ssh://git@github.com/DLC-link/canton-lib", branch = "main" }
common = { git = "ssh://git@github.com/DLC-link/canton-lib", branch = "main" }
wallet = { git = "ssh://git@github.com/DLC-link/canton-lib", branch = "main" }
cryptography = { git = "ssh://git@github.com/DLC-link/canton-lib", branch = "main" }
canton-proto-rs = { git = "ssh://git@github.com/DLC-link/canton-lib", branch = "main" }
```

---
Expand Down Expand Up @@ -160,10 +163,10 @@ cargo run -p examples --bin delete_executed_transfers
### `ledger`

- `ledger_end::get(Params)` - Get current ledger offset
- `active_contracts::get(Params)` - Query active contracts (REST)
- `active_contracts::get_by_party(Params)` - Query active contracts (REST)
- `websocket::active_contracts::get(Params)` - Query active contracts (WebSocket)
- `websocket::update::stream(Params)` - Stream ledger updates
- `submit::submit(Params)` - Submit commands to the ledger
- `websocket::update::subscribe(Params, message_handler)` - Stream ledger updates
- `submit::wait_for_transaction_tree(Params)` - Submit commands and wait for transaction tree

### `registry`

Expand Down Expand Up @@ -247,7 +250,7 @@ curl -X POST $LEDGER_HOST/v2/commands/submit-and-wait-for-transaction-tree \

### v0.1.0 -> v0.2.0

The common crate's `common::submission::Submission` has a few extra fields, you can simple add `..Deafult::default()`, to fulfill that need.
The common crate's `common::submission::Submission` has a few extra fields, you can simple add `..Default::default()`, to fulfill that need.

```rust
let submission_request = common::submission::Submission {
Expand Down