Skip to content

Instantly share code, notes, and snippets.

@ItayPodhajcer
Last active January 17, 2023 13:17
Show Gist options
  • Save ItayPodhajcer/5ad1973533ae7fcff3dbfe492236eac8 to your computer and use it in GitHub Desktop.
Save ItayPodhajcer/5ad1973533ae7fcff3dbfe492236eac8 to your computer and use it in GitHub Desktop.
terraform-azure-confidential-ledger/test-ledger.py#data
ledger_client = ConfidentialLedgerClient(
endpoint=ledger_url,
credential=credential,
ledger_certificate_path=ledger_tls_cert_file_name
)
sample_entry = {"contents": "Hello world!"}
ledger_client.create_ledger_entry(entry=sample_entry)
latest_entry = ledger_client.get_current_ledger_entry()
print("Latest entry:")
print(f" Transaction ID: {latest_entry['transactionId']}")
print(f" Collection ID: {latest_entry['collectionId']}")
print(f" Contents: {latest_entry['contents']}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment