Coder Social home page Coder Social logo

digital-asset / daml-on-fabric Goto Github PK

View Code? Open in Web Editor NEW
23.0 6.0 19.0 1013 KB

Enabling DAML applications to run on Hyperledger Fabric

License: Apache License 2.0

Makefile 0.13% Scala 41.15% Dockerfile 0.58% Go 11.56% Shell 5.42% Java 41.16%
fabric daml daml-on-x dlt

daml-on-fabric's Introduction

CircleCI License

DAML on Fabric

Ledger implementation enabling DAML applications to run on Hyperledger Fabric 2.x

Deprecation Notice

As of March 2022, this driver is deprecated in favor of the Canton-on-Fabric integration. No further development will be done in this repository.

Quick Start Guide

Prerequisites

These are the minimal requirements that this flow was tested with. Docker and Docker-Compose are required to run a Hyperledger Fabric network, and greater versions of docker generally can be used. Note: running Docker as root is not recommended.

  • docker-compose version 1.24.0 or greater
  • docker CE version 18.09.6 or greater
  • Java / JDK version 1.8.0.x
  • DAML SDK version 1.10.0
  • Hyperledger Fabric Tools version 2.0.0 or greater

NOTE: To avoid issues initializing chaincode on the Fabric network, ensure that the "Enable gRPC FUSE" experimental feature is unchecked in your Docker Desktop client, as noted in Hyperledger Fabric Troubleshooting and Docker for Mac Known Issue #4955

You can get the latest Hyperledger Fabric Tools by running the following command, and binaries will be downloaded to <download_directory>/bin

cd <download_directory>
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s -- 2.2.0 -s

Now add the <download_directory>/bin to your PATH so that the fabric tools are available for use

export PATH=<download_directory>/bin:$PATH

Full instructions on Fabric Tools can be found at https://hyperledger-fabric.readthedocs.io/en/release-2.2/install.html

Cloning DAML-on-Fabric

For the sake of cleanliness, we are using the directory ~/daml-on-fabric as the root for the repository.

cd
git clone https://github.com/digital-asset/daml-on-fabric.git

Running a local Hyperledger Fabric network

This is achieved by running a Docker-Compose network which is a typical way to set up Fabric for development environments. Our particular example sets up a network of 2 endorsing peers.

cd ~/daml-on-fabric/src/test/fixture/
./gen.sh
./restart_fabric.sh

The script used is a shortcut for ./fabric.sh down && ./fabric.sh up that will erase all current data and start a fresh network.

Deploying a DAML Application to Fabric

Check out the deployment guide for a demonstration on deploying a full E2E application.

DAML-on-Fabric command line and Services

The basic command to run the ledger right from the repository is like this:

sbt "run --role <roles> [--port NNNN] [DAMLArchive.dar DAMLArchive2.dar ...]"

Important: the ledger will connect to a Fabric network specified in config-local.yaml file.

If you want to run the ledger against something other than the local Fabric test network, you should specify the configuration of the network by providing the additional fabricConfigFile argument, as shown below:

sbt "run ..." -J-DfabricConfigFile=<configuration file>

By default, it will use "config-local.yaml", which you can use for reference.

Services, or "Roles"

You may have noticed that the required argument for DAML-on-Fabric is "role".

There are several roles that define which parts of the service are going to be executed:

  • provision
    • will connect to Fabric and prepare it to be used as storage for a DAML ledger.
  • ledger
    • will run a DAML Ledger API endpoint at a port specified with --port argument.
  • time
    • will run a DAML time service, which writes heartbeats to the ledger. There should be exactly one time service per ledger.
  • explorer
    • will run a block explorer service that exposes a REST API to view the content of blocks and transactions inside the Fabric network for debugging or demonstration purposes. The explorer will run at a port specified in config-local.yaml file. It provides REST API that responds at endpoints /blocks[?id=...] and /transactions[?id=...]

One ledger may perform multiple roles at the same time, in which case roles are comma-separated.

Running Java Quick Start against DAML-on-Fabric

Step 1. Start Hyperledger Fabric

cd ~/daml-on-fabric/src/test/fixture/
./gen.sh
./restart_fabric.sh

Step 2. Extract and build Quick Start project

cd
daml new quickstart quickstart-java

Created a new project in "quickstart" based on the template "quickstart-java".

cd quickstart
daml build

Compiling daml/Main.daml to a DAR Created .daml/dist/quickstart-0.0.1.dar

Step 3. Run the Ledger with Quick Start DAR archive

cd ~/daml-on-fabric/
sbt "run --port 6865 --role provision,time,ledger,explorer ../quickstart/.daml/dist/quickstart-0.0.1.dar"

Step 4. Allocate parties on the ledger

There's no automatic mapping of DAML parties to parties on the Fabric ledger. We'll need to create the parties on Fabric that match the party names in DAML:

cd ~/quickstart/
daml ledger allocate-parties --host localhost --port 6865 Alice Bob Carol USD_Bank EUR_Bank

Step 5. Run DAML Navigator

cd ~/quickstart/
daml navigator server localhost 6865 --port 4000

Step 6. Conclusion

Now you can explore your freshly setup DAML ledger.

You should have the following services running:

More information on Quick Start example and DAML in general can be found here:

https://docs.daml.com/getting-started/quickstart.html

Step 7. Upload own dar files

To upload custom dars run the following command where the custom dar is located:

daml ledger upload-dar <dar-file-location> --host localhost --port 6865

Step 8. Run Ledger API Test Tool

For testing purposes, the Ledger API provides a tool to execute some tests against the deployed network. You can find the ledger-api-test-tool.jar in the src/test/fixture folder. This JAR is generated when the make it command

cd ~/daml-on-fabric/src/test/fixture
./download_test_tool_extract_dars.sh
ls *.dar | xargs -I {} daml ledger upload-dar {} --host localhost --port 6865
java -jar ledger-api-test-tool.jar --all-tests localhost:6865 --timeout-scale-factor=10

NOTE: The localhost and port can be changed to accommodate the projects needs

Step 9. Run with authentication

We can also run the Ledger API with authentication enabled. The ledger API uses JWT for authentication. There are a few methods that are supported: * rsa256 * esda256 * esda512 * hs256 (this is unsafe) * rsa256 jwks

To enable authentication, follow one of the examples below.

To run with rsa256 jwt authentication enabled:

sbt "run --port 6865 --role provision,time,ledger,explorer ./quickstart/.daml/dist/quickstart-0.0.1.dar --auth-jwt-rs256-crt=<path-to-crt-file>"

To run with esda256 jwt authentication enabled:

sbt "run --port 6865 --role provision,time,ledger,explorer ./quickstart/.daml/dist/quickstart-0.0.1.dar --auth-jwt-es256-crt=<path-to-crt-file>"

To run with esda512 jwt authentication enabled:

sbt "run --port 6865 --role provision,time,ledger,explorer ./quickstart/.daml/dist/quickstart-0.0.1.dar --auth-jwt-es512-crt=<path-to-crt-file>

To run with hs256 jwt authentication enabled:

sbt "run --port 6865 --role provision,time,ledger,explorer ./quickstart/.daml/dist/quickstart-0.0.1.dar --auth-jwt-hs256-unsafe=<path-to-crt-file>"

To run with rsa256 jwks jwt authentication enabled:

sbt "run --port 6865 --role provision,time,ledger,explorer ./quickstart/.daml/dist/quickstart-0.0.1.dar --auth-jwt-rs256-jwkse=<URI-to-jwks-service>"

If authentication is enabled, then all the calls to the Ledger API will need to be authenticated. Given the the authentication, please use the following:

To run daml commands for Legder API with any jwt authentication enabled

daml ledger allocate-parties --host localhost --port 6865 Alice Bob Carol USD_Bank EUR_Bank --access-token-file=<path-to-token>

A few examples for this type of authentication can be found in src/test/fixture/data/ledger_certs and src/test/fixture/data/ledger_tokens

For more information, regarding authentication on the Ledger API and token generation, can be found here and here , respectively.

Step 10. Running with CI

This project has its own CI environment that builds, spins up the network, and runs the ledger tests and the authentication tests. To replicate the same steps as are run in CI locally, you can run this command:

$ make it

This will clean, compile, build and package the code, deploy the network and run all the necessary tests.

Step 11. Running a Multi-node Setup

Start Fabric Network

cd src/test/fixture && ./restart_fabric.sh

Output DAR from test tool

cd src/test/fixture && ./download_test_tool_extract_dars.sh

First Participant Node

sbt "run --role ledger,time,provision --port 11111" -J-DfabricConfigFile=config-local.yaml

Second Participant Node

sbt "run --role ledger --port 12222" -J-DfabricConfigFile=config-local.yaml

Third Participant Node

sbt "run --role ledger --port 13333 src/test/fixture/SemanticTests.dar src/test/fixture/Test-stable.dar" -J-DfabricConfigFile=config-local.yaml

Run Ledger Test Tool against all nodes

java -jar ledger-api-test-tool.jar localhost:11111 --include=SemanticTests --timeout-scale-factor 2.0
java -jar ledger-api-test-tool.jar localhost:12222 --include=SemanticTests --timeout-scale-factor 2.0
java -jar ledger-api-test-tool.jar localhost:13333 --include=SemanticTests --timeout-scale-factor 2.0

Technical README

If there is a need for further customization, there are a few options that can be changed. Please refer to this README for further information.

Architecture Guide

A more detailed description of the technical architecture can be found in Architecture Guide

daml-on-fabric's People

Contributors

anthonylusardi-da avatar bame-da avatar dasormeter avatar dependabot[bot] avatar garyverhaegen-da avatar gerolf-da avatar mergify[bot] avatar richardkapolnai-da avatar timkemp-dah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

daml-on-fabric's Issues

Installing on MacOS 11.1

Hi there,

I'm helping a colleague install daml-on-fabric and following the installation instructions from the README but I have hit a bit of a problem getting further than:

sbt "run --port 6865 --role provision,time,ledger,explorer /Users/smithle/tmp3/quickstart/.daml/dist/quickstart-0.0.1.dar"

Compilation happens as I would expect, until the end when I receive the following error:

[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[info] running com.daml.DamlOnFabricServer --port 6865 --role provision,time,ledger,explorer /Users/smithle/tmp3/quickstart/.daml/dist/quickstart-0.0.1.dar
log4j:WARN No appenders could be found for logger (org.hyperledger.fabric.sdk.helper.Config).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[error] (run-main-0) java.lang.NullPointerException: Cannot read the array length because "<local7>" is null
[error] java.lang.NullPointerException: Cannot read the array length because "<local7>" is null
[error] at com.daml.FabricContext.getLocalUser(FabricContext.java:729)
[error] at com.daml.FabricContext.getOrgAdmin(FabricContext.java:714)
[error] at com.daml.FabricContext.<init>(FabricContext.java:88)
[error] at com.daml.DAMLKVConnector.<init>(DAMLKVConnector.java:74)
[error] at com.daml.DAMLKVConnector.get(DAMLKVConnector.java:30)
[error] at com.daml.DamlOnFabricServer$.delayedEndpoint$com$daml$DamlOnFabricServer$1(DamlOnFabricServer.scala:63)
[error] at com.daml.DamlOnFabricServer$delayedInit$body.apply(DamlOnFabricServer.scala:46)
[error] at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error] at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error] at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error] at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error] at scala.collection.immutable.List.foreach(List.scala:392)
[error] at scala.App.main(App.scala:80)
[error] at scala.App.main$(App.scala:78)
[error] at com.daml.DamlOnFabricServer$.main(DamlOnFabricServer.scala:46)
[error] at com.daml.DamlOnFabricServer.main(DamlOnFabricServer.scala)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
[error] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
[error] Nonzero exit code: 1
[error] (Compile / run) Nonzero exit code: 1
[error] Total time: 3 s, completed 12 Jan 2021, 10:45:58

I have a feeling it's something to do with logging, but I'm not sure how to proceed.

Thanks for your help

Explorer does not start correctly

When starting Explorer service, got error:

REST: Blocks reader: Caught Exception:
com.daml.FabricContextException: response {
  status: 500
  message: "Unknown action, check the first argument, must be one of \'RawWrite\', \'RawRead\'. But got: GetChainInfo"
}
payload: "\n S\nmK\372\235\016\341=J3s\371B\242\306\233\313a\300\233z\301\000?\016K|\230\203\266\005\022\360\001\nm\022?\n\n_lifecycle\0221\n/\n)namespaces/fields/daml_on_fabric/Sequence\022\002\b\003\022*\n\016daml_on_fabric\022\030\n\026\n\020\000\364\217\277\277initialized\022\002\b\004\032j\b\364\003\022eUnknown action, check the first argument, must be one of \'RawWrite\', \'RawRead\'. But got: GetChainInfo\"\023\022\016daml_on_fabric\032\0011"

	at com.daml.FabricContext.querySystemChaincode(FabricContext.java:609)
	at com.daml.ExplorerService$BlocksReader.run(ExplorerService.java:514)

Daml on Fabric behaving irratically

Hi @digitalasset-cla, I am running daml on fabric on my system.

When I trying to fetch a contract using endpoint :-
localhost:7575/v1/fetch
payload :-
{
"contractId": "003b05efc9b130616f72b21e8383bfc448123f1cee6bf99d8df3c53ca7baf775ec"
}

It is working fine and I am getting a contract.

But, when i am trying to exercise a choice on that contract using endpoint :-
localhost:7575/v1/exercise
payload :-
{
"templateId": "TenantModule:TenantOnboardingRequestSignByDID",
"contractId": "003b05efc9b130616f72b21e8383bfc448123f1cee6bf99d8df3c53ca7baf775ec",
"choice" : "TenantOnboardingRequestDID_Sign",
"argument": {
}
}

It is giving me the error :-
{
"errors": [
"io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Command interpretation error in LF-DAMLe: dependency error: couldn't find contract ContractId(003b05efc9b130616f72b21e8383bfc448123f1cee6bf99d8df3c53ca7baf775ec). Details: N/A."
],
"status": 500
}

Here, you can see the contract IDs are the same in the payload.
Can anyone explain why this is happening, and how can I resolve it?

Daml template issue on daml on fabric?

Hi @dasormeter, @anthonylusardi-da.

I was running daml on fabric.
Had one scenario for question :-

Suppose consider, that I have a template :-

module ExampleModule where

template Example
with
admin: Party
variable: Text
where
signatory admin

And now, I have deployed dar file related to this using daml runtime on fabric.

Now, I want to change the template and add additional field (The module name and the template name would be same)

module ExampleModule where

template Example
with
admin: Party
variable: Text
active: Bool
where
signatory admin

Now, I deployed this using daml runtime on the same fabric network as was earlier.

And so, it would have 2 templateIds by the same name (ExampleModule:Example).
So, would it be able to resolve as to which daml contract to create or retrieve?

I last checked, it was not able to resolve as they had similiar names, Is there a workaround for this or is it not right to update templates in this manner?

Dynamic Map in daml?

Hi @digitalasset-cla, @jberthold-da, @stefanobaghino-da

Can you tell how to create a dynamic map in daml?

For example :-

		"r": {
			"age": "60625353282101859031114084788461363500020080587865094313415945937194505171974824750979439639618231790078117695997913153028182280158293270956817260146305044078905862686951473886066227504157922639732317948213861865783124102325497565585151374966943373526284418335469629292299051938778147617771639670658248594497075691314094940022914159397222323938859281517752636680203017429647617026956252175581695660874576250787442930681560514506816227329016658293759990705003815342073366151883503197629452954311781562345819581842594066236020465123961753182058309020773681418061649718777900670943263011696071609327827547527090495890224",
			"date": "33930227444335845474579396149722513395191887056841304151045401607588110713986103544985952179129680502467202758397812691904502594999133398781137159555975198842276748775285878716049787442834165107426371815094803912796083581965009447733634656293348148948595437606939476271475431030552952270125388636479168763346464482330936428317468103615125488040789522062966612030476470133214109406709548464668078196584401233011426606023514233399430651645754688630574533918270517370420457781251431701195419637102848014219018495387764360725265552213487458604996193793206540976471775735932022220670326967614271868139279824015397443489188",
			"degree": "94808858341004493331631777171917333357972283815444545929081835374991833124284946065612985971210586127902597969703302728152460022534175027154723472042510406934880344555258073722531077161181451564209299090786136627561481605979332773556138100037771134450590602900725260401733279948397951549726707753994943703053312103881138934671846654011127881931955788595123833969753604609843352963125507482376370166331000350954810457628395253182331165109896023870193284245657012332314581004424125608270536259831058013698370013624306693237790194196784091877389630127106561294022381287912804859182067567675702085681422357984496564465462",
			"master_secret": "109073020936311733934642532108860869303966264010311301779353888907918189857647528013171943512169291139521977509493751737489987260013923678231147194077405494510223274107410554536153076108008422085071842603554192793399376319977279254823170402701833200266998727035971868415827654509991466428947106542350650111097158717468502007819034968735610787287369249366626873043368415152084012368808688818304390410682543450806037263647005198942444142199826138407925942823354304042253810593910894295644544196786293349467417304323551253070645786318590813668002873714630425476867174113548222687423879567048527440594906941198872433445811",
			"name": "44063728091696519827029612617421399766903877503282149408257474603453539221424870806676667625083129899903879864609795545604142733186296283511603607300998773994153070825006842834709065906378535410017158896078273229793619480044751938945505527503700902565652538861749098853532913870096820501957041271147126729078774701292279481222842481195825892563651561159633578690936533368871661547179038506147732586590515070760549591361005263951839342294073290786739054904991431428940153495477790831894191443041052681091676657166793180375593419596149117725528528361082210237083777126319405792192088788402270842400777723392370065090170",
			"timestamp": "42344125629444343793597578813582417505773395736356345881297692447052854992817039857187801391500056700286591587143600633454248255721712611131520475173670727926916830342505919489828154235472141088814071264843942097643815157350550414542978578034559523792920385868170989526540565401075678086336133391053018205380175670177437910845330938366658242015890490474287195001370142748707069701396065980401298172920209256360978095241783634005386047889561719303151522163703082081046080546740859235705603622867852755269702996370490332210332266838292442771591778787032071644385269747764225616864352361397079475028381825953550097317291"
		}

This is the payload of whose contract I have to create. Now the keys (name, age, date etc..) are not constant and can be anything and also it can be more or can be less.
So, how should I create a data type for this in daml template and use it to insert this kind of payload

Quickstart fails with error in `sbt`

When I follow the setup instructions from the README, the sbt command fails with

[error] (run-main-0) com.daml.FabricContextException: response {
[error]   status: 500
[error]   message: "make sure the chaincode daml_on_fabric has been successfully defined on channel mainchannel and try again: chaincode daml_on_fabric not found"
[error] }

Logs for fabric and sbt attached.
sbt.log
fabric.log

Akka version mismatch

When running daml-on-fabric 1.8.0 I get the following issue. This is happening on https://daml.com/learn/deploying-daml/daml-on-fabric/ step 6 when executing the command sbt "run --port 6865 --role time,ledger" -J-DfabricConfigFile=config-local.yaml -Xss2M -XX:MaxMetaspaceSize=1024M

sdk-version is set to 1.8.0-snapshot.20201208.5840.0.38455e8c in daml.yaml.

No META-INF folder detected. Starting chaincode without any custom indexes
That's all folks!
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
[WARN] [12/09/2020 19:45:03.080] [run-main-0] [ManifestInfo(akka://DamlonFabricServer)] You are using version2.6.10 of Akka, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 2.6.10 of the [akka-slf4j] artifacts to your project. See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed
19:45:03.165 ERROR c.d.r.ProgramResource - Shutting down because of an initialization error.
java.lang.IllegalStateException: You are using version 2.6.10 of Akka, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 2.6.10 of the [akka-slf4j] artifacts to your project. See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed
        at akka.util.ManifestInfo.checkSameVersion(ManifestInfo.scala:176)
        at akka.util.ManifestInfo.checkSameVersion(ManifestInfo.scala:154)
        at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:1033)
        at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:1022)
        at akka.actor.ActorSystemImpl._start(ActorSystem.scala:1022)
        at akka.actor.ActorSystemImpl.start(ActorSystem.scala:1045)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:272)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:316)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:260)
        at com.daml.DamlOnFabricServer$$anon$1.$anonfun$acquire$1(DamlOnFabricServer.scala:78)
        at com.daml.logging.LoggingContext$.newLoggingContext(LoggingContext.scala:15)
        at com.daml.logging.LoggingContext$.newLoggingContext(LoggingContext.scala:18)
        at com.daml.DamlOnFabricServer$$anon$1.acquire(DamlOnFabricServer.scala:77)
        at com.daml.DamlOnFabricServer$$anon$1.acquire(DamlOnFabricServer.scala:74)
        at com.daml.resources.ProgramResource.$anonfun$run$2(ProgramResource.scala:29)
        at scala.util.Try$.apply(Try.scala:213)
        at com.daml.resources.ProgramResource.$anonfun$run$1(ProgramResource.scala:29)
        at com.daml.resources.ProgramResource.$anonfun$run$1$adapted(ProgramResource.scala:26)
        at com.daml.logging.LoggingContext$.newLoggingContext(LoggingContext.scala:15)
        at com.daml.logging.LoggingContext$.newLoggingContext(LoggingContext.scala:18)
        at com.daml.resources.ProgramResource.run(ProgramResource.scala:26)
        at com.daml.DamlOnFabricServer$.delayedEndpoint$com$daml$DamlOnFabricServer$1(DamlOnFabricServer.scala:179)
        at com.daml.DamlOnFabricServer$delayedInit$body.apply(DamlOnFabricServer.scala:46)
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1$adapted(App.scala:80)
        at scala.collection.immutable.List.foreach(List.scala:392)
        at scala.App.main(App.scala:80)
        at scala.App.main$(App.scala:78)
        at com.daml.DamlOnFabricServer$.main(DamlOnFabricServer.scala:46)
        at com.daml.DamlOnFabricServer.main(DamlOnFabricServer.scala)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at sbt.Run.invokeMain(Run.scala:115)
        at sbt.Run.execute$1(Run.scala:79)
        at sbt.Run.$anonfun$runWithLoader$4(Run.scala:92)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:10)
        at sbt.TrapExit$App.run(TrapExit.scala:257)
        at java.base/java.lang.Thread.run(Thread.java:834)

Exception: sbt.TrapExitSecurityException thrown from the UncaughtExceptionHandler in thread "scala-execution-context-global-84"
[error] Nonzero exit code: 1
[error] (Compile / run) Nonzero exit code: 1
[error] Total time: 65 s (01:05), completed Dec 9, 2020, 7:46:03 PM

Out of Memory errors with DAML Runtime (sbt)

So I've encountered this issue a few times, once when trying to run multiple sbt participant nodes from the same computer, and another just now when building a Katacoda scenario.

It seems the whole process in general of running Fabric + DAML Runtime (sbt) + DAML JSON-API + create-daml-app UI from a single computer is using too much memory.

Worth noting is that Katacoda only has 2 GB of memory.

Increasing memory to sbt by adding flags -Xss2M -XX:MaxMetaspaceSize=1024M has some improvement.

Perhaps there are places to save on memory usage somewhere? Or perhaps minimum requirements can be specified in the README?

15:57:40.892 INFO  c.d.p.a.s.t.TrackerMap - Registered tracker for submitter Key(create-daml-app,Alice)
Uncaught error from thread [DamlonFabricServer-akka.actor.default-dispatcher-11]: Metaspace, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[DamlonFabricServer]
java.lang.OutOfMemoryError: Metaspace
[error] (AsyncAppender-Worker-ASYNC) java.lang.OutOfMemoryError: Metaspace

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "AsyncAppender-Worker-ASYNC"
Uncaught error from thread [DamlonFabricServer-akka.actor.default-dispatcher-11]: java.lang.NoSuchMethodException: no such method: java.lang.invoke.MethodHandle.linkToStatic(Object,long,long,Object,Object,MemberName)Object/invokeStatic, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[DamlonFabricServer]
java.lang.InternalError: java.lang.NoSuchMethodException: no such method: java.lang.invoke.MethodHandle.linkToStatic(Object,long,long,Object,Object,MemberName)Object/invokeStatic
        at java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:130)
        at java.lang.invoke.DirectMethodHandle.makePreparedLambdaForm(DirectMethodHandle.java:221)
        at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:194)
        at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:183)
        at java.lang.invoke.DirectMethodHandle.make(DirectMethodHandle.java:89)
        at java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:1660)
        at java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:1617)
        at java.lang.invoke.MethodHandles$Lookup.getDirectMethodForConstant(MethodHandles.java:1802)
        at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1751)
        at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
        at com.daml.platform.apiserver.services.tracking.TrackerMap.$anonfun$cleanup$3(TrackerMap.scala:46)
        at scala.collection.immutable.HashMap$HashMap1.foreach(HashMap.scala:370)
        at com.daml.platform.apiserver.services.tracking.TrackerMap.$anonfun$cleanup$2(TrackerMap.scala:44)
        at akka.actor.LightArrayRevolverScheduler$$anon$1$$anon$2.run(LightArrayRevolverScheduler.scala:110)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:47)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:47)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.NoSuchMethodException: no such method: java.lang.invoke.MethodHandle.linkToStatic(Object,long,long,Object,Object,MemberName)Object/invokeStatic
        at java.lang.invoke.MemberName.makeAccessException(MemberName.java:871)
        at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1003)
        at java.lang.invoke.DirectMethodHandle.makePreparedLambdaForm(DirectMethodHandle.java:219)
        ... 18 more
Caused by: java.lang.NoSuchMethodError: java.lang.invoke.MethodHandle.linkToStatic(Ljava/lang/Object;JJLjava/lang/Object;Ljava/lang/Object;Ljava/lang/invoke/MemberName;)Ljava/lang/Object;
        at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
        at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975)
        at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000)
        ... 19 more
Caused by: java.lang.OutOfMemoryError: Metaspace
Exception in thread "Thread-3" java.lang.OutOfMemoryError: Metaspace

Add CI check for local restart_fabric.sh scripts

Either include local readme setup equivalent steps in CI
Or align CI setup with local so that both are tested in similar ways

Particularly to out issues with docker network weirdness, timing, or service name issues

daml_on_fabric chaincode can not installed

Hello guys,
After start fabric network and run sbt "run --port 6865 --role provision,time,ledger,explorer ../quickstart-120/.daml/dist/quickstart-0.0.1.dar" , it occurs error that could not found daml_on_fabric chaincode, the full error trace as below,
[email protected] private key: /Users/chenjian/Documents/chenj/work/workplace/study/blockchain/daml/damlonfabric-test/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /Users/chenjian/Documents/chenj/work/workplace/study/blockchain/daml/damlonfabric-test/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
[error] (run-main-0) com.daml.FabricContextException: response {
[error] status: 500
[error] message: "make sure the chaincode daml_on_fabric has been successfully defined on channel mainchannel and try again: chaincode daml_on_fabric not found"
[error] }
[error] com.daml.FabricContextException: response {
[error] status: 500
[error] message: "make sure the chaincode daml_on_fabric has been successfully defined on channel mainchannel and try again: chaincode daml_on_fabric not found"
[error] }
[error]
[error] at com.daml.FabricContext.queryChaincode(FabricContext.java:578)
[error] at com.daml.FabricContext.queryChaincode(FabricContext.java:558)
[error] at com.daml.FabricContext.queryChaincode(FabricContext.java:554)
[error] at com.daml.DAMLKVConnector.getLedgerId(DAMLKVConnector.java:316)
[error] at com.daml.DAMLKVConnector.(DAMLKVConnector.java:90)
[error] at com.daml.DAMLKVConnector.get(DAMLKVConnector.java:30)
[error] at com.daml.DamlOnFabricServer$.delayedEndpoint$com$daml$DamlOnFabricServer$1(DamlOnFabricServer.scala:61)
[error] at com.daml.DamlOnFabricServer$delayedInit$body.apply(DamlOnFabricServer.scala:44)
[error] at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error] at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error] at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error] at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error] at scala.collection.immutable.List.foreach(List.scala:392)
[error] at scala.App.main(App.scala:80)
[error] at scala.App.main$(App.scala:78)
[error] at com.daml.DamlOnFabricServer$.main(DamlOnFabricServer.scala:44)
[error] at com.daml.DamlOnFabricServer.main(DamlOnFabricServer.scala)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.lang.reflect.Method.invoke(Method.java:498)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
[error] Nonzero exit code: 1
[error] (Compile / run) Nonzero exit code: 1
[error] Total time: 23 s, completed 2020-6-21 15:23:52
MayI know what's the problem, I see the daml_on_fabric is on src/github.com/digital-a
sset/daml-on-fabric.
Many thanks!

Invalid invocation: chaincode \'daml_on_fabric\' has not been initialized for this version, must call as init

Versions:
Java: 1.8.0
Scala: 2.12.7 (and 2.12.11)
SBT: 1.2.8

Steps to reproduce:

Run through Katacoda scenario as here

Once you get to the step where you run sbt "run --port 6865 --role provision,time,ledger" -J-DfabricConfigFile=config-local.yaml you'll get the error pasted below.

I've tried adding --isInit to the sbt command as noted here for the peer command but it doesn't help.

[info]  [SUCCESSFUL ] org.scala-lang#scala-compiler;2.12.11!scala-compiler.jar (342ms)
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Compiling 10 Scala sources and 7 Java sources to /root/daml-on-fabric/target/scala-2.12/classes ...
[info] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.11. Compiling...
[info]   Compilation completed in 8.87s.
[info] Done compiling.
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[info] Packaging /root/daml-on-fabric/target/scala-2.12/daml-on-fabric_2.12-2.0.0.jar ...
[info] Done packaging.
[info] Running com.daml.DamlOnFabricServer --port 6865 --role provision,time,ledger
log4j:WARN No appenders could be found for logger (org.hyperledger.fabric.sdk.helper.Config).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]
Constructing channel mainchannel
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
Created channel mainchannel
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
Peer peer0 grpcs://localhost:10051 joined channel mainchannel
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]
Peer peer0 grpcs://localhost:10056 joined channel mainchannel
Joined peers to channel mainchannel
No META-INF folder detected. Starting chaincode without any custom indexes
Orgs installs the chaincode on its peers.
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
Getting chaincode packageID status SUCCESS and packageID daml_on_fabric:4cd11263a3097bcfe2e3c5c66c36a9e54774e39bb7e3ea619a3549cc4ba8c799
Successful install proposal response Txid: f6b4749236d02a89f072ff8550c503b989c61f1f81e12167f5f92fb3a15fe768 from peer peer0
Received 1 install proposal responses. Successful+verified: 1 . Failed: 0
verifyByQueryInstalledChaincode: Peer peer0 with status SUCCESS , label daml_on_fabric
Org going to approve chaincode definition for my org.
lifecycleApproveChaincodeDefinitionForMyOrg: Peer grpcs://localhost:10051 status SUCCESS verified true
Checking on org's network for approvals
verifyByCheckCommitReadinessStatus Peer grpcs://localhost:10051 Status SUCCESS Approved Orgs [[Org1MSP]] UnApproved Orgs [[Org2MSP]]
verifyByCheckCommitReadinessStatus Peer grpcs://localhost:10056 Status SUCCESS Approved Orgs [[Org1MSP]] UnApproved Orgs [[Org2MSP]]
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]
Getting chaincode packageID status SUCCESS and packageID daml_on_fabric:4cd11263a3097bcfe2e3c5c66c36a9e54774e39bb7e3ea619a3549cc4ba8c799
Successful install proposal response Txid: b7fbe11258d0b4dbaf53b07c72964e2f814ecf2c5c240e9b2cac21a7061321dc from peer peer0
Received 1 install proposal responses. Successful+verified: 1 . Failed: 0
verifyByQueryInstalledChaincode: Peer peer0 with status SUCCESS , label daml_on_fabric
Org going to approve chaincode definition for my org.
lifecycleApproveChaincodeDefinitionForMyOrg: Peer grpcs://localhost:10056 status SUCCESS verified true
Checking on org's network for approvals
verifyByCheckCommitReadinessStatus Peer grpcs://localhost:10051 Status SUCCESS Approved Orgs [[Org2MSP, Org1MSP]] UnApproved Orgs [[]]
verifyByCheckCommitReadinessStatus Peer grpcs://localhost:10056 Status SUCCESS Approved Orgs [[Org2MSP, Org1MSP]] UnApproved Orgs [[]]
Org doing commit chaincode definition
commitChaincodeDefinitionRequest response: Peer grpcs://localhost:10051 Status SUCCESS Verified true
commitChaincodeDefinitionRequest response: Peer grpcs://localhost:10056 Status SUCCESS Verified true
Invoke chaincode - going to call: init on the chaincode daml_on_fabric
Received 2 tx proposal responses. Successful+verified: 0 . Failed: 2  - Fcn: init
Not enough endorsers for executeChaincode(move a,b,100):2 endorser error: error in simulation: failed to execute transaction 8fabc8504ee7a6a742a6a879f0de2d53b70ff37702858d2ab130066ffac41324: could not launch chaincode daml_on_fabric:4cd11263a3097bcfe2e3c5c66c36a9e54774e39bb7e3ea619a3549cc4ba8c799: chaincode registration failed: error starting container: error starting container: API error (404): network daml-on-fabric_default not found. Was verified: false
Caught an exception running Channel mainchannel
java.util.concurrent.CompletionException: org.hyperledger.fabric.sdk.exception.InvalidArgumentException: proposalResponses collection is empty
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
        at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:783)
        at java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:792)
        at java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2153)
        at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:5534)
        at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:5236)
        at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:5021)
        at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:5009)
        at com.daml.FabricContext.invokeChaincode(FabricContext.java:695)
        at com.daml.FabricContext.invokeChaincode(FabricContext.java:631)
        at com.daml.FabricContext.invokeChaincode(FabricContext.java:627)
        at com.daml.FabricContext.runChannel(FabricContext.java:288)
        at com.daml.FabricContext.initNetworkConfiguration(FabricContext.java:169)
        at com.daml.FabricContext.<init>(FabricContext.java:103)
        at com.daml.DAMLKVConnector.<init>(DAMLKVConnector.java:74)
        at com.daml.DAMLKVConnector.get(DAMLKVConnector.java:30)
        at com.daml.DamlOnFabricServer$.delayedEndpoint$com$daml$DamlOnFabricServer$1(DamlOnFabricServer.scala:61)
        at com.daml.DamlOnFabricServer$delayedInit$body.apply(DamlOnFabricServer.scala:44)
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1$adapted(App.scala:80)
        at scala.collection.immutable.List.foreach(List.scala:392)
        at scala.App.main(App.scala:80)
        at scala.App.main$(App.scala:78)
        at com.daml.DamlOnFabricServer$.main(DamlOnFabricServer.scala:44)
        at com.daml.DamlOnFabricServer.main(DamlOnFabricServer.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sbt.Run.invokeMain(Run.scala:98)
        at sbt.Run.run0(Run.scala:92)
        at sbt.Run.execute$1(Run.scala:68)
        at sbt.Run.$anonfun$run$4(Run.scala:80)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:10)
        at sbt.TrapExit$App.run(TrapExit.scala:253)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.hyperledger.fabric.sdk.exception.InvalidArgumentException: proposalResponses collection is empty
        at org.hyperledger.fabric.sdk.SDKUtils.getProposalConsistencySets(SDKUtils.java:118)
        at org.hyperledger.fabric.sdk.Channel.doSendTransaction(Channel.java:5571)
        at org.hyperledger.fabric.sdk.Channel.sendTransaction(Channel.java:5533)
        ... 34 more
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]
That's all folks!
[email protected] private key: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
[email protected] sign cert: /root/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
[error] (run-main-0) com.daml.FabricContextException: response {
[error]   status: 500
[error]   message: "error in simulation: failed to execute transaction 1e1238edc4eb2c232b30e2ad88ef35eb69ae6d8eb414c58df998f2dbea583641: invalid invocation: chaincode \'daml_on_fabric\' has not been initialized for this version, must call as init first"
[error] }
[error] com.daml.FabricContextException: response {
[error]   status: 500
[error]   message: "error in simulation: failed to execute transaction 1e1238edc4eb2c232b30e2ad88ef35eb69ae6d8eb414c58df998f2dbea583641: invalid invocation: chaincode \'daml_on_fabric\' has not been initialized for this version, must call as init first"
[error] }
[error]
[error]         at com.daml.FabricContext.queryChaincode(FabricContext.java:578)
[error]         at com.daml.FabricContext.queryChaincode(FabricContext.java:558)
[error]         at com.daml.FabricContext.queryChaincode(FabricContext.java:554)
[error]         at com.daml.DAMLKVConnector.getLedgerId(DAMLKVConnector.java:316)
[error]         at com.daml.DAMLKVConnector.<init>(DAMLKVConnector.java:90)
[error]         at com.daml.DAMLKVConnector.get(DAMLKVConnector.java:30)
[error]         at com.daml.DamlOnFabricServer$.delayedEndpoint$com$daml$DamlOnFabricServer$1(DamlOnFabricServer.scala:61)
[error]         at com.daml.DamlOnFabricServer$delayedInit$body.apply(DamlOnFabricServer.scala:44)
[error]         at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error]         at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error]         at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error]         at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error]         at scala.collection.immutable.List.foreach(List.scala:392)
[error]         at scala.App.main(App.scala:80)
[error]         at scala.App.main$(App.scala:78)
[error]         at com.daml.DamlOnFabricServer$.main(DamlOnFabricServer.scala:44)
[error]         at com.daml.DamlOnFabricServer.main(DamlOnFabricServer.scala)
[error]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]         at java.lang.reflect.Method.invoke(Method.java:498)
[error] Nonzero exit code: 1
[error] (Compile / run) Nonzero exit code: 1
[error] Total time: 72 s, completed 08-Jun-2020 16:20:29

daml-on-fabric.jar中没有主清单属性

Hi, I have a question for you.

When I enter sbt‘s console,input package command,the resulting jar file, called it daml-on-fabric.jar, is generated in target dir. But I execute it with java -jar daml-on-fabric.jar, got output "daml-on-fabric.jar中没有主清单属性". In English, it may mean no main class found. but sbt "run ..." works well, maybe due to mainClass in (Compile, run) := Some("com.daml.DamlOnFabricServer") in build.sbt file.

is there any solution for directly using java cmd?

looking forward to u replies. thanks

README improvements

I would suggest a couple of improvements to the README file.

Dependencies:

Docker CE 19.x version is also ok
Scala and SBT version doesn't really matter because they are defined in the project, you need an SBT which in the background downloads the specified versions.
Fabric and Fabric SDK is not a real prerequisite, because you download everything needed during the steps specified later.

Cloning DAML-on-Fabric

For the sake of cleanliness, we are using the directory ~/daml-on-fabric as the root for the repository.

$ cd
$ git clone [email protected]:digital-asset/daml-on-fabric.git

^^^^ The line above is the SSH link which doesn't work if you didn't put an SSH key in your repo, the HTTPS link is more universal.

Running Java Quick Start against DAML-on-Fabric

In this section the path definitions are mismatched. Two scenarios are mixed: 1) you download the quickstart project withing your daml-on-fabric folder, or 2) you download the quickstart project into you home directory.

This is the correct version for the case when you download the quickstart project into your home directory:

Step 2. Extract and build Quick Start project

$ cd (not cd ~/daml-on-fabric )
$ rm -rf quickstart
$ daml new quickstart quickstart-java
Created a new project in "quickstart" based on the template "quickstart-java".
$ cd ~/quickstart/
$ daml build
Compiling daml/Main.daml to a DAR
Created .daml/dist/quickstart-0.0.1.dar

Step 3. Run the Ledger with Quick Start DAR archive

$ cd ~/daml-on-fabric/
$ sbt "run --port 6865 --role provision,time,ledger,explorer ~/quickstart/.daml/dist/quickstart-0.0.1.dar" (not ./quickstart/.daml/dist/quickstart-0.0.1.dar)

Step 4. Run DAML Navigator

$ cd ~/quickstart/
daml navigator server localhost 6865 --port 4000

Step 5. Allocate parties on the ledger

There's no automatic mapping of DAML parties to parties on the Fabric ledger. We'll need to create the parties on Fabric that match the party names in DAML:

$ cd ~/quickstart/
daml ledger allocate-parties --host localhost --port 6865 Alice Bob Carol USD_Bank EUR_Bank

Errors setup sample example as per document fails with SDK 2.0

RROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project daml-quickstart-java: Compilation failure: Compilation failure:
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[9,37] package com.daml.quickstart.model.iou does not exist
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[52,45] cannot find symbol
[ERROR] symbol: variable Iou
[ERROR] location: class com.daml.quickstart.iou.IouMain
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[55,29] cannot find symbol
[ERROR] symbol: class Iou
[ERROR] location: class com.daml.quickstart.iou.IouMain
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[56,20] package Iou does not exist
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[69,27] package Iou does not exist
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[88,26] package Iou does not exist
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[88,50] package Iou does not exist
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[94,54] package Iou does not exist
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[111,11] cannot find symbol
[ERROR] symbol: class Iou
[ERROR] location: class com.daml.quickstart.iou.IouMain
[ERROR] /Users/vaishnavi/Downloads/daml-on-fabric-master/quickstart1/src/main/java/com/daml/quickstart/iou/IouMain.java:[111,44] cannot find symbol
[ERROR] symbol: class Iou
[ERROR] location: class com.daml.quickstart.iou.IouMain

Version 2.0.0
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/daml/grpc/adapter/ExecutionSequencerFactory has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getDeclaredConstructors(Class.java:2020)
at akka.util.Reflect$.findConstructor(Reflect.scala:97)
at akka.actor.ArgsReflectConstructor.(IndirectActorProducer.scala:99)
at akka.actor.IndirectActorProducer$.apply(IndirectActorProducer.scala:64)
at akka.actor.Props.producer(Props.scala:131)
at akka.actor.Props.(Prop

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.