Skip to content

Instantly share code, notes, and snippets.

View da-blog's full-sized avatar

da-blog

View GitHub Profile
~/canton-cda
$ DAML_SDK_VERSION=1.5.0 daml json-api \
--ledger-host localhost \
--ledger-port 12011 \
--http-port 7575 \
--allow-insecure-tokens
14:45:52 ~/canton-cda
$ DAML_SDK_VERSION=1.5.0 daml json-api \
--ledger-host localhost \
--ledger-port 12021 \
--http-port 7576 \
--allow-insecure-tokens
14:50:15 ~/canton-cda/canton-0.18.1/create-daml-app/ui
$ REACT_APP_LEDGER_ID=participant1 yarn start
14:50:15 ~/canton-cda/canton-0.18.1/create-daml-app/ui
$ PORT=3001 REACT_APP_HTTP_JSON_PORT=7576 REACT_APP_LEDGER_ID=participant2 yarn start
8.sh:
_____ _
/ ____| | |
| | __ _ _ __ | |_ ___ _ __
| | / _` | '_ \| __/ _ \| '_ \
| |___| (_| | | | | || (_) | | | |
\_____\__,_|_| |_|\__\___/|_| |_|
Welcome to Canton!
Type `help` to get started. `exit` to leave.
@da-blog
da-blog / 1.sh
Created July 31, 2023 18:56
Start by Installing Canton
~/canton-cda
$ unzip canton-0.18.1.zip
...
$ cd canton-0.18.1
~/canton-cda/canton-0.18.1
$ ls
bin demo lib start-demo.command VERSION
daml deployment LICENSE.txt start-demo-win.cmd
dars examples README.md third-party-licenses.html
@da-blog
da-blog / 2.sh
Created July 31, 2023 18:57
create-daml-app` example
2.sh:
~/canton-cda/canton-0.18.1
DAML_SDK_VERSION=1.5.0 daml new create-daml-app --template create-daml-app && cd create-daml-app
Created a new project in "create-daml-app" based on the template "create-daml-app".
@da-blog
da-blog / 3.sh
Created July 31, 2023 18:58
Dar
3.sh:
~/canton-cda/canton-0.18.1/create-daml-app
$ daml build
Compiling create-daml-app to a DAR.
Created .daml/dist/create-daml-app-0.1.0.dar
~/canton-cda/canton-0.18.1/create-daml-app
$ daml codegen js .daml/dist/create-daml-app-0.1.0.dar -o daml.js
Generating 057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba
Generating create-daml-app-0.1.0 (hash: 37197ee5461df46eaf2b1dffa5da310c405fdb6100cf93bdec01c86ce2b54eae)
...
~/canton-cda/canton-0.18.1/create-daml-app/ui
$ cd ../..
~/canton-cda/canton-0.18.1
$ chmod +x bin/canton
~/canton-cda/canton-0.18.1
$ bin/canton -c examples/04-create-daml-app/canton.conf --bootstrap examples/04-create-daml-app/init.canton
Compiling (synthetic)/ammonite/predef/DefaultPredef.sc
Compiling (synthetic)/ammonite/predef/ArgsPredef.sc
Compiling /home/pho/canton-cda/canton-0.18.1/(console)
template CurrentPrice
with
itemName: Text
price : Int
operator : Party
where
signatory operator
key (operator, itemName) : (Party, Text)
maintainer key._1