Skip to main content

Daml Hub DIT File API Package

Project description

daml-dit-api

API definitions for DIT packages to be hosted in DABL. This mainly contains the type definitions for the format of the dabl-meta.yaml file at the root of each DIT file.

DIT files are also used to contain integrations loaded and run by DABL. This repository also contains documentation below describing the runtime environment that DABL provides to integrations.

Package Metadata

At their core, DIT files are ZIP archives that follow a specific set of conventions regarding their content. The most important of these conventions is the presence of a YAML metadata file at the root of the archive and named dabl-meta.yaml. This metadata file contains catalog information describing the contents of the DIT, as well as any packaging details needed to successfully deploy a DIT file into DABL. An example of a deployment instruction is a subdeployment. A subdeployment instructs DABL to deploy a specific subfile within the DIT file. A DIT file that contains an embedded DAR file could use a subdeployment to ensure that the embedded DAR file is deployed to the ledger when the DIT is deployed. In this way, a DIT file composed of multiple artifacts (DARs, Bots, UI's, etc.) can be constructed to deploy a set of artifacts to a single ledger in a single action.

Integrations

Integrations are a special case of DIT file that are augmented with the ability to run as an executable within a DABL cluster. This is done by packaging Python DAZL bot code into an executable ZIP using PEX and augmenting tha resulting file with the metadata and other resources needed to make it a correctly formed DIT file.

Logically speaking, DABL integrations are DAZL bots packaged with information needed to fit them into the DABL runtime and user interface. The major functional contrast between a DABL integration and a Python Bot is that the integration has the external network access needed to connect to an outside system and the Python Bot does not. Due to the security implications of running within DABL with external network access, integrations can only be deployed with the approval of DA staff.

Developing Integrations

The easiest way to develop an integration for DABL is to use the framework library and ddit build tool. The integration framework presents a Python API closely related to the DAZL bot api and ensures that integrations follow the conventions required to integrate into DABL.

Unless you know exactly what you are doing and why you are doing it, use the framework.

The Integration Runtime Environment

By convention, integrations accept a number of environment variables that specify key paramaters. Integrations built with the framework use defaults for these variables that connect to a default locally configured sandbox instance.

Variables provided by DABL include the following:

Variable Default Purpose
DABL_HEALTH_PORT 8089 Port for Health/Status HTTP endpoint
DABL_INTEGRATION_METADATA_PATH 'int_args.yaml' Path to local metadata file
DABL_INTEGRATION_TYPE_ID Type ID for the specific integration within the DIT to run
DABL_LEDGER_PARTY Party identifier for network connection
DABL_LEDGER_URL http://localhost:6865 Address of local ledger gRPC API
DABL_LOG_LEVEL 0 Log verbosity level - 0 up to 50.

Logging

DABL integrations use the default Python logging package, and the framework provides specific support for controlling log level at runtime. To integrate properly with this logic, it is important that integrations use the integration logger. This logger is switched from INFO level to DEBUG level at a DABL_LOG_LEVEL setting of 10 or above.

import logging

LOG = logging.getLogger('integration')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

daml-dit-api-0.4.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

daml_dit_api-0.4.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file daml-dit-api-0.4.0.tar.gz.

File metadata

  • Download URL: daml-dit-api-0.4.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Darwin/20.3.0

File hashes

Hashes for daml-dit-api-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9d565a24d83a8a76e67a6f7a3fba6902bd2a79ea33b521e10acb7c05c6a2a66d
MD5 e38a398dbd4e4efbb94440c7b9a125f7
BLAKE2b-256 5a023c97eb8f6c18199f51f13d85bc2f9818519cef4eee11de27dc731c157813

See more details on using hashes here.

File details

Details for the file daml_dit_api-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: daml_dit_api-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Darwin/20.3.0

File hashes

Hashes for daml_dit_api-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21c308b6f0ac84a1e1df64f5dbc61aacf7c7c3ea0edcd8abb9558917cbcb0276
MD5 8fd7bb17a73c0c94b0ed4f15c44f5a79
BLAKE2b-256 aab0fb3be440ba880e26f114f9746901f665ecd86ba7767296a529a48cb0d644

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page