Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC daml-finance-app upgrading [DO NOT MERGE] #115

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
19 changes: 13 additions & 6 deletions canton.conf
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
canton {
parameters.non-standard-config = yes
parameters {
non-standard-config = yes
dev-version-support = yes
}

domains.local.domain-parameters {
# then, enable the version support on the nodes
will-corrupt-your-system-dev-version-support = yes
# set the domain protocol version to `dev`
protocol-version = dev
domains.local {
domain-parameters {
# then, enable the version support on the nodes
will-corrupt-your-system-dev-version-support = yes
# set the domain protocol version to `dev`
protocol-version = dev
}
init.domain-parameters.protocol-version = dev
}

participants.sandbox.parameters = {
# enable dev version on the participant (this will allow the participant to connect to a domain with dev protocol version)
will-corrupt-your-system-dev-version-support = yes
# enable engine lf version support
unsafe-enable-daml-lf-dev-version = yes
dev-version-support = yes
}
}
57 changes: 0 additions & 57 deletions daml.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions multi-package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.10.0-snapshot.20241106.0
daml-version: 2.10.0-snapshot.20241101.13047.0.v1e6d5c93
name: daml-finance-app
packages:
- ./package/main/daml/Daml.Finance.Interface
- ./package/main/daml/Daml.Finance.App
- ./package/main/daml/Daml.Finance.Setup
75 changes: 66 additions & 9 deletions nix/daml.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,77 @@
{ stdenv, jdk, version }:
{ stdenv, jdk, curl, curl_cert, sdkVersion, damlVersion, tarPath, os, osJFrog, hashes }:
let
os = if stdenv.isDarwin then "macos" else "linux";
tarball = fetchTarball {
url = "https://github.com/digital-asset/daml/releases/download/v${version}/daml-sdk-${version}-${os}.tar.gz";
nixTarPath = if tarPath == null then null else /. + tarPath;
tarball = stdenv.mkDerivation {
pname = "daml-tarball";
version = sdkVersion;
src = ../.;
buildInputs = [ curl ];
SSL_CERT_FILE = curl_cert;
impureEnvVars = [ "ARTIFACTORY_USERNAME" "ARTIFACTORY_PASSWORD" ];
buildPhase = ''
set -euo pipefail

if [ -f .envrc.private ]; then
source .envrc.private
fi

get_local() (
tar_path="${if nixTarPath == null then "" else nixTarPath}"
if [ -z $tar_path ]; then
echo "No explict tar set, attempting to download"
exit 1
else
echo "Using explicit tar"
cp $tar_path $out
chmod -x $out
fi
)
get_os() (
echo "Downloading SDK from GitHub..."
curl --location \
--fail \
https://github.com/digital-asset/daml/releases/download/v${sdkVersion}/daml-sdk-${damlVersion}-${os}.tar.gz \
> $out
)
get_ee() (
echo "Downloading SDK from Artifactory..."
if [ -n "''${ARTIFACTORY_PASSWORD:-}" ]; then
curl -u $ARTIFACTORY_USERNAME:$ARTIFACTORY_PASSWORD \
https://digitalasset.jfrog.io/artifactory/assembly/daml/${sdkVersion}/daml-sdk-${sdkVersion}-${osJFrog}.tar.gz \
> $out
else
echo "ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD must be set." >&2
exit 1
fi
)

get_local || get_os || get_ee
'';
dontInstall = true;
outputHashAlgo = "sha256";
outputHashMode = "flat";
outputHash = hashes.${os};
};
in
stdenv.mkDerivation {
name = "daml-sdk";
version = "$version";
pname = "daml-sdk";
version = sdkVersion;
src = tarball;
buildPhase = "patchShebangs .";
installPhase = "DAML_HOME=$out ./install.sh";
dontUnpack = true;
buildPhase = ''
mkdir daml
tar xzf $src -C daml --strip-components 1
patchShebangs .
'';
installPhase = ''
cd daml
export DAML_HOME=$out
./daml/daml install --install-assistant yes --install-with-custom-version $version $src
'';
propagatedBuildInputs = [ jdk ];
preFixup = ''
# Set DAML_HOME automatically.
mkdir -p $out/nix-support
echo export DAML_HOME=$out > $out/nix-support/setup-hook
'';
}
}
53 changes: 28 additions & 25 deletions package/main/daml/Daml.Finance.App/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.4
sdk-version: 2.10.0-snapshot.20241106.0
name: daml-finance-app
version: 1.0.0
version: 4.0.0
source: daml
dependencies:
- daml-prim
- daml-stdlib
data-dependencies:
- ../../../../.lib/contingent-claims-core-2.0.1.dar
- ../../../../.lib/contingent-claims-lifecycle-2.0.1.dar
- ../../../../.lib/contingent-claims-valuation-0.2.2.dar
- ../../../../.lib/daml-finance-claims-2.1.0.dar
- ../../../../.lib/daml-finance-data-3.0.0.dar
- ../../../../.lib/daml-finance-interface-account-3.0.0.dar
- ../../../../.lib/daml-finance-interface-claims-3.0.0.dar
- ../../../../.lib/daml-finance-interface-data-3.1.0.dar
- ../../../../.lib/daml-finance-interface-holding-3.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-base-3.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-bond-2.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-equity-0.4.0.dar
- ../../../../.lib/daml-finance-interface-instrument-generic-3.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-swap-0.4.0.dar
- ../../../../.lib/daml-finance-interface-instrument-token-3.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-types-1.0.0.dar
- ../../../../.lib/daml-finance-interface-lifecycle-3.0.0.dar
- ../../../../.lib/daml-finance-interface-settlement-3.0.0.dar
- ../../../../.lib/daml-finance-interface-types-common-2.0.0.dar
- ../../../../.lib/daml-finance-interface-types-date-2.1.0.dar
- ../../../../.lib/daml-finance-interface-util-2.1.0.dar
- ../../../../.lib/daml-finance-lifecycle-3.0.0.dar
- ../../../../.lib/daml-finance-util-3.1.0.dar
- ../../../../.lib/contingent-claims-core-4.0.0.dar
- ../../../../.lib/contingent-claims-lifecycle-4.0.0.dar
- ../../../../.lib/contingent-claims-valuation-4.0.0.dar
- ../../../../.lib/daml-finance-claims-4.0.0.dar
- ../../../../.lib/daml-finance-data-4.0.0.dar
- ../../../../.lib/daml-finance-interface-account-4.0.0.dar
- ../../../../.lib/daml-finance-interface-claims-4.0.0.dar
- ../../../../.lib/daml-finance-interface-data-4.0.0.dar
- ../../../../.lib/daml-finance-interface-holding-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-base-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-bond-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-equity-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-generic-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-swap-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-token-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-types-4.0.0.dar
- ../../../../.lib/daml-finance-interface-lifecycle-4.0.0.dar
- ../../../../.lib/daml-finance-interface-settlement-4.0.0.dar
- ../../../../.lib/daml-finance-interface-types-common-4.0.0.dar
- ../../../../.lib/daml-finance-interface-types-date-4.0.0.dar
- ../../../../.lib/daml-finance-interface-util-4.0.0.dar
- ../../../../.lib/daml-finance-lifecycle-4.0.0.dar
- ../../../../.lib/daml-finance-util-4.0.0.dar
- ../Daml.Finance.Interface/.daml/dist/daml-finance-app-interface-4.0.0.dar
build-options:
- --target=1.17
19 changes: 19 additions & 0 deletions package/main/daml/Daml.Finance.Interface/daml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.10.0-snapshot.20241106.0
name: daml-finance-app-interface
version: 4.0.0
source: daml
dependencies:
- daml-prim
- daml-stdlib
data-dependencies:
- ../../../../.lib/daml-finance-interface-claims-4.0.0.dar
- ../../../../.lib/daml-finance-interface-holding-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-base-4.0.0.dar
- ../../../../.lib/daml-finance-interface-types-common-4.0.0.dar
- ../../../../.lib/daml-finance-interface-types-date-4.0.0.dar
- ../../../../.lib/daml-finance-interface-util-4.0.0.dar
build-options:
- --target=1.17
68 changes: 36 additions & 32 deletions package/main/daml/Daml.Finance.Setup/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,54 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.4
sdk-version: 2.10.0-snapshot.20241106.0
name: daml-finance-app-setup
version: 1.0.0
version: 4.0.0
source: daml
init-script: Daml.Finance.Setup.Demo:demo
dependencies:
- daml-prim
- daml-stdlib
- daml-script
data-dependencies:
- ../../../../.lib/contingent-claims-core-2.0.1.dar
- ../../../../.lib/daml-finance-account-3.0.0.dar
- ../../../../.lib/daml-finance-claims-2.1.0.dar
- ../../../../.lib/daml-finance-data-3.0.0.dar
- ../../../../.lib/daml-finance-holding-3.0.0.dar
- ../../../../.lib/daml-finance-instrument-bond-2.0.0.dar
- ../../../../.lib/daml-finance-instrument-equity-0.4.0.dar
- ../../../../.lib/daml-finance-instrument-generic-3.0.0.dar
- ../../../../.lib/daml-finance-instrument-swap-0.4.0.dar
- ../../../../.lib/daml-finance-instrument-token-3.0.0.dar
- ../../../../.lib/daml-finance-interface-account-3.0.0.dar
- ../../../../.lib/daml-finance-interface-claims-3.0.0.dar
- ../../../../.lib/daml-finance-interface-data-3.1.0.dar
- ../../../../.lib/daml-finance-interface-holding-3.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-base-3.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-bond-2.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-equity-0.4.0.dar
- ../../../../.lib/daml-finance-interface-instrument-generic-3.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-swap-0.4.0.dar
- ../../../../.lib/daml-finance-interface-instrument-token-3.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-types-1.0.0.dar
- ../../../../.lib/daml-finance-interface-lifecycle-3.0.0.dar
- ../../../../.lib/daml-finance-interface-settlement-3.0.0.dar
- ../../../../.lib/daml-finance-interface-types-common-2.0.0.dar
- ../../../../.lib/daml-finance-interface-types-date-2.1.0.dar
- ../../../../.lib/daml-finance-interface-util-2.1.0.dar
- ../../../../.lib/daml-finance-lifecycle-3.0.0.dar
- ../../../../.lib/daml-finance-settlement-3.0.0.dar
- ../../../../.lib/daml-finance-util-3.1.0.dar
- ../Daml.Finance.App/.daml/dist/daml-finance-app-1.0.0.dar
- ../../../../.lib/contingent-claims-core-4.0.0.dar
- ../../../../.lib/daml-finance-account-4.0.0.dar
- ../../../../.lib/daml-finance-claims-4.0.0.dar
- ../../../../.lib/daml-finance-data-4.0.0.dar
- ../../../../.lib/daml-finance-holding-4.0.0.dar
- ../../../../.lib/daml-finance-instrument-bond-4.0.0.dar
- ../../../../.lib/daml-finance-instrument-equity-4.0.0.dar
- ../../../../.lib/daml-finance-instrument-generic-4.0.0.dar
- ../../../../.lib/daml-finance-instrument-swap-4.0.0.dar
- ../../../../.lib/daml-finance-instrument-token-4.0.0.dar
- ../../../../.lib/daml-finance-interface-account-4.0.0.dar
- ../../../../.lib/daml-finance-interface-claims-4.0.0.dar
- ../../../../.lib/daml-finance-interface-data-4.0.0.dar
- ../../../../.lib/daml-finance-interface-holding-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-base-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-bond-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-equity-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-generic-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-swap-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-token-4.0.0.dar
- ../../../../.lib/daml-finance-interface-instrument-types-4.0.0.dar
- ../../../../.lib/daml-finance-interface-lifecycle-4.0.0.dar
- ../../../../.lib/daml-finance-interface-settlement-4.0.0.dar
- ../../../../.lib/daml-finance-interface-types-common-4.0.0.dar
- ../../../../.lib/daml-finance-interface-types-date-4.0.0.dar
- ../../../../.lib/daml-finance-interface-util-4.0.0.dar
- ../../../../.lib/daml-finance-lifecycle-4.0.0.dar
- ../../../../.lib/daml-finance-settlement-4.0.0.dar
- ../../../../.lib/daml-finance-util-4.0.0.dar
- ../Daml.Finance.App/.daml/dist/daml-finance-app-4.0.0.dar
start-navigator: no
script-options:
- --output-file=../../../../ui/src/parties.json
json-api-options:
- --config=../../../../json-api.conf
codegen:
js:
output-directory: ../../../../ui/daml.js
npm-scope: daml.js
build-options:
- --target=1.17
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ script_dir=$(cd "$(dirname $0)"; pwd -P)
root_dir=$(cd ${script_dir}; cd ..; pwd -P)

# Build
DAML_PROJECT=${root_dir}/package/main/daml/Daml.Finance.Interface daml build
DAML_PROJECT=${root_dir}/package/main/daml/Daml.Finance.App daml build
DAML_PROJECT=${root_dir}/package/main/daml/Daml.Finance.Setup daml build

Expand Down
Loading