daml | The Daml smart contract language | Blockchain library
kandi X-RAY | daml Summary
kandi X-RAY | daml Summary
This repository hosts all code for the Daml smart contract language and SDK, originally created by Digital Asset. Daml is an open-source smart contract language for building future-proof distributed applications on a safe, privacy-aware runtime. The SDK is a set of tools to help you develop applications based on Daml.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of daml
daml Key Features
daml Examples and Code Snippets
Community Discussions
Trending Discussions on daml
QUESTION
Recently installed Daml SDK v: 1.18.0 for Windows following all the steps given on [https://docs.daml.com/getting-started/installation.html][1]
I have even set the environment variables as required.
When I run daml build
I'm able to create .dar
successfully but while running the scenario in VS Code's output section getting an error:
2022-01-07 05:22:59.01 [INFO] [LanguageServer] Flushed 0 logs damlc: ScenarioServiceException "Failed to run java: C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot\bin;C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot;C:\Program Files\Java\jre1.8.0_311\bin;C:\Program Files\Java\jre1.8.0_311;C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot\bin\;C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot\;C:\Program Files\Java\jre1.8.0_311\bin\;C:\Program Files\Java\jre1.8.0_311\;\bin\java: readCreateProcessWithExitCode: does not exist (No such file or directory)" [Error - 10:52:59 am] Connection to server got closed. Server will not be restarted.
I have checked the environment variables and the path, both are correct but still unable to get the scenarios running and getting this error.
...ANSWER
Answered 2022-Jan-07 at 12:24It looks like you set JAVA_HOME
but you set it to multiple paths separate by ;
. Instead JAVA_HOME
should only contain a single path to the JDK installation you want to use. So in your example, assuming you want to use JDK 11, set it to C:\Program Files\AdoptOpenJDK\jdk-11.0.13.8-hotspot
.
You can take a look at https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html for example to see how you can change it.
QUESTION
I have a daml file with just one script
...ANSWER
Answered 2021-Aug-16 at 14:06Yes! This is explained in the documentation for Daml Script, specifically:
You can use Daml script to initialize a ledger on startup. To do so, specify an
init-script: ScriptExample:initializeFixed
field in yourdaml.yaml
. This will automatically be picked up bydaml start
and used to initialize sandbox.
In your case, that would be:
QUESTION
I'm making some exercises to get to know Daml and one of the exercises involves the transfer of an Asset from a Party to another Party. Everything works correctly, but I’ve noticed that the owner of the previous Asset contract is marked as ‘Witness’ of the new Asset contract (At Assets.Asset:Asset
, the contract with ID #8:2
has Alice
marked with a W
, Witness
).
I was intrigued with that. What does it means a Party being a ‘Witness’ of a contract and what are its implications? I didn’t found an answer for it in the documentation…
Here is some of the code I’ve used. I’ve applied the propose-accept pattern.
...ANSWER
Answered 2021-Feb-24 at 18:48This means that Alice
saw the creation of the new contract (#8:2
) because she was a party to the old contract (#6:2
) at the time it was consumed by Bob
exercising AcceptAssetTransfer
on HolderRole
. The implications are that Alice
could see that Bob
became the new owner of Asset
but will not see any future events that involve Asset
such as it being archived as a result of sending the asset to another Party.
Additionally even though Alice
saw/witnessed the creation of the new contract she cannot query for it after the one time event where she witnessed it.
Sometimes the docs are a bit hard to search so here's some relevant links:
- A simple overview of the meaning of S, O, W, and D in the Script output
- The ledger privacy model
- A more detailed explanation on witnessing and divulgence
- An explanation of contract consumption in general
As this question was also asked simultaneously on our forum further discussion may be located here.
QUESTION
I come across some examples in the Daml documentation where the operator '$' is being used, but cannot fully understand its purpose.
Example:
...ANSWER
Answered 2021-Feb-15 at 17:54The $
operator is a substitute for parenthesis. The example
QUESTION
In Daml, I have setup an Agent
contract. This is its down Agent.daml
file. I then have a proposal contract (Proposal.daml
), in which I imported the Agent
module. I wanted to specify agentname
is the signatory for the proposal contract, but compiler tells me that no such party exists.
There are no parties in my Proposal
contract which is why I chose a party from another contract. I'm not sure how to solve this?
This is the agent contract
...ANSWER
Answered 2021-Jan-29 at 15:03The signatories of a contract need to be computable from the contract arguments. You can't reference another contract by ContractId
and get them from there. The reason is that that other contract might be archived, in which case you suddenly have a contract for which the signatories can't be read.
So your Proposal
must contain the agent that is making the proposal:
QUESTION
I just created my first DAML project and wrote a basic template. When I try to test it, getting following error: damlc: user error (Failed to start scenario service: BErrorClient (ClientIOError (GRPCIOBadStatusCode StatusUnknown (StatusDetails {unStatusDetails = "Stream removed"}))))
Below is my daml code (template)
...ANSWER
Answered 2020-Oct-28 at 15:08daml test
opens a separate gRPC server and connects to that. Based on the error, it looks like this connection isn’t working properly. Do you have some kind of firewall enabled that could block this?
Do you encounter the same issue in daml studio
?
I tried reproducing this in SDK 1.6.0 but was unable to do so. It would be great if you could provide the SDK version and the operating system you are running this on.
gRPC will use the http_proxy
and https_proxy
environment variables. Try setting no_proxy=127.0.0.1
to disable it for the requests to localhost.
QUESTION
I am trying to understand the adoption of a DAML smart on sawtooth network. According to this tutorial https://github.com/blockchaintp/daml-on-sawtooth there is:
Sawtooth network which contains:
Rest-api
Validator
Transaction processor
postgres
devmode-engine
That are essential for the network.
- What is the role of daml-rpc and daml-tp? They act as connectors?
For example, a daml user communicates with an api with the daml platform like this image https://docs.daml.com/getting-started/app-architecture.html and after that is adopted from sawtooth network?
- Finally, where is stored the xxx.dar file?
ANSWER
Answered 2020-Oct-01 at 20:47DAML-on-Sawtooth is a specific DAML ledger implementation integrated using a full Sawtooth network deployment. leveraging Sawtooth's validation features for persistence.
The rest-api you see in that repository is actually the Sawtooth REST api used for communicating to the Sawtooth network, and that validator an implementation of Sawtooth validation as part of the commit protocol, and the transaction processor to handle DAML transactions on the Sawtooth network.
The sawtooth-daml-rpc is what implements the DAML Ledger API gRPC services, and this exposes the Ledger API that the application code interacts with. Postgres is used as an underlying index db service supporting the Ledger API.
In the https://docs.daml.com/getting-started/app-architecture.html you can conceptually swap the "Sandbox" box with "Sawtooth Network", as in the DAML-on-Sawtooth case it is the full Sawtooth network which is able to consume and return DAML that is the ledger implementation.
As with all DAML ledgers, the DAR files are uploaded through the package upload gRPC APIs and are persisted on the ledger (in this case the Sawtooth network), as are parties and transactions through the party allocation and transaction submission APIs, respectively.
QUESTION
I was reading this documentation https://github.com/digital-asset/daml-on-fabric but I am confused. I am trying to understand the workflow and the architecture for the daml on fabric network. The network has 2 orgs and each org has 1 peer.On step 4 are allocating 5 daml parties. Quickstart example has 3 signatories(issuer,owner,buyer). To sum up, what is the match between daml parties and fabric orgs? I think that could be allocated even more daml parties without to change fabric network. They interact from one node? What is the purpose to add other nodes on step 11?
...ANSWER
Answered 2020-Sep-09 at 09:20Parties don't have a cryptographic identity in DAML Ledgers, only nodes do. As part of the shared ledger state, every DAML-enabled infrastructure maintains a mapping from Party to Node. This relationship is usually described as a Node "hosting" a Party. The Node hosting a Party is able to submit transactions using that Party's authority and is guaranteed to receive any transactions visible to that Party.
In the tutorial you are referring to, all parties are allocated on a single Node, which then hosts them. This does indeed not make that much sense in practice. It would be more sensible to set up a network with three orgs and allocate the three parties on the peer nodes in the three orgs, respectively. Given the way the example is set up, that should be straightforward.
QUESTION
I am trying to extract the precondition's expression as SWRL to make a IOPE web service OWL-S matchmaking
Here's my code
...ANSWER
Answered 2020-Aug-16 at 19:42This issue is not linked to the java code but to the OWLS-S file syntaxe. you can resolve this issue by replacing:
QUESTION
when am using Map function it requires to declare M.empty,if am missing into an error,what is definition behind out of this M.empty usage,how exactly Map function work in DAML.
Error getting like below.
** could not Match Excepted type Map Text ([a]) with actual Type Map Text ([A]) -> Map Text ([A]) **
when i added M.Empty it is not running into this Error.For my understanding can please give explanation for how Map works and what is the reason behind M.Empty
...ANSWER
Answered 2020-Jul-09 at 09:37It would be easier to answer if you provided the erroneous code, but from what I can parse, it looks like you may be misunderstanding what Map.empty is. Map.empty is not a function, it is a value; specifically, it is a Map that has no content.
Maps are sets of key/value pairs. One way to construct the Map that you want is to start with an empty Map and then add each of the elements that you want, one by one. Here is an example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install daml
Install Nix by running: bash <(curl -sSfL https://nixos.org/nix/install)
Enter dev-env by running: eval "$(dev-env/bin/dade assist)"
We have a single script to build most targets and run the tests. On Linux and Mac run ./build.sh. On Windows run .\build.ps1. Note that these scripts may take over an hour the first time. To just build do bazel build //..., and to just test do bazel test //.... To read more about Bazel and how to use it, see the Bazel site. On Mac if building is causing trouble complaining about missing nix packages, you can try first running nix-build -A tools -A cached nix repeatedly until it completes without error.
Bazel has a lot of nice properties, but they come at the cost of frequently rebuilding "the world". To make that bearable, we make extensive use of caching. Most artifacts should be cached in our CDN, which is configured in .bazelrc in this project. However, even then, you may end up spending a lot of time (and bandwidth!) downloading artifacts from the CDN. To alleviate that, by default, our build will create a subfolder .bazel-cache in this project and keep an on-disk cache. This can take about 10GB at the time of writing.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page