### Set up PostgreSQL Database Source: https://github.com/digital-asset/canton/blob/main/scripts/testing-upgrade/testing-canton-upgrade.md Start the PostgreSQL database using Docker Compose and run the database setup script. ```bash cd $OLD_VERSION_DIR docker compose -f scripts/testing-upgrade/postgres-docker-compose.yml up performance/src/main/console/postgres/db-setup.sh ``` -------------------------------- ### Build and Navigate to BFT Sequencer Examples Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/11-bft-sequencer/README.md Commands to compile the project, create the release bundle, and enter the example directory. ```bash sbt compile ``` ```bash sbt bundle ``` ```bash cd /community/app/target/release/canton/examples/11-bft-sequencer ``` -------------------------------- ### Navigate to JSON Ledger API example Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/tutorials/json-api/canton_and_the_json_ledger_api_ts_websocket.rst Change the working directory to the JSON Ledger API example folder within the Canton installation. ```bash cd /examples/09-json-ledger-api ``` -------------------------------- ### Start Canton in Daemon Mode Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/participant/howtos/operate/console/console.rst Example command to start a Canton instance in daemon mode using a configuration file. ```bash ./bin/canton daemon -c ``` -------------------------------- ### Navigate to the multi-synchronizer example directory Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/tutorials/json-api/canton_and_the_json_ledger_api_ts_multisync.rst Change the current working directory to the location of the multi-synchronizer example project. ```bash cd /examples/14-multisync ``` -------------------------------- ### Setup Python Environment for Daml Transactions Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/08-interactive-submission/README.md Commands to initialize a virtual environment and install dependencies for Python-based submission. ```bash python -m venv .venv source .venv/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Start Canton Console and Nodes Source: https://github.com/digital-asset/canton/blob/main/scripts/testing-upgrade/testing-canton-upgrade.md Start the Canton console with specified configuration files and bootstrap the synchronizer. ```bash cd $OLD_VERSION_DIR/community/app/target/release/canton source performance/postgres/db.env ./bin/canton -c performance/postgres/persistence.conf -c performance/topology/distributed-topology.conf ``` -------------------------------- ### Initialize Postgres Database with db.sh Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/participant/howtos/install/release.rst Use the provided shell script to start a Docker-based Postgres instance and perform initial setup. ```bash cd ./config/util/postgres ./db.sh start [durable] ./db.sh setup ``` -------------------------------- ### Navigate to TypeScript example folder Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/tutorials/json-api/canton_and_the_json_ledger_api_ts_websocket.rst Change the working directory to the TypeScript example folder. ```bash cd /examples/09-json-ledger-api/typescript ``` -------------------------------- ### Start Canton with New Version Source: https://github.com/digital-asset/canton/blob/main/scripts/testing-upgrade/testing-canton-upgrade.md Start Canton using the new version binaries. Use `--manual-start` to prevent automatic node startup, allowing for manual control. ```bash cd $NEW_VERSION_DIR/community/app/target/release/canton source performance/postgres/db.env ./bin/canton -c performance/postgres/persistence.conf -c performance/topology/distributed-topology.conf --manual-start ``` -------------------------------- ### Start local nodes Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/participant/howtos/operate/console/console.rst Starts all configured local synchronizers and participants. ```bash nodes.local.start() ``` -------------------------------- ### Start Synchronizer Microservices Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/participant/howtos/install/release.rst Command to start individual synchronizer processes using specific configuration files. ```bash ./bin/canton daemon -c config/[mediator|sequencer|manager].conf ``` -------------------------------- ### Start Replicated PostgreSQL Service Source: https://github.com/digital-asset/canton/blob/main/docker/replicated-postgres/README.md Run this script to start the primary and secondary PostgreSQL instances along with Toxiproxy. It configures Toxiproxy and waits for PostgreSQL to become available. ```bash $ ./start.sh Loading default settings from default-settings.env... ... ``` -------------------------------- ### Start the DAML Ledger Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/09-json-api/typescript/README.md Run this command in a terminal to start the DAML Ledger. Ensure you have DAML installed. ```sh ../run.sh ``` -------------------------------- ### Setup and environment preparation Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/12-lsu/demo-script.txt Commands to list participants and synchronizers, await state, and define the upgrade timestamp. ```scala participant1.parties.list() participant1.synchronizers.list_connected() val aliceIou = participant1.ledger_api.javaapi.state.acs.await(Iou.COMPANION)(alice) clock.now //You have 60 seconds to execute the upgrade commands after this val upgradeTime = CantonTimestamp.assertFromInstant(Instant.now().plusSeconds(60)) currentPhysicalSynchronizerId newPhysicalSynchronizerId ``` -------------------------------- ### Bootstrap the topology example Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/02-multiple-sequencers-and-mediators/README.md Use the Canton binary with the specified configuration and bootstrap script to initialize the environment. ```bash ../../bin/canton -c multiple-sequencers-and-mediators.conf --bootstrap simple-ping.canton ``` -------------------------------- ### Build and Run Commands Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/01-simple-topology/README.md Commands to prepare the environment and execute the simple topology example. ```bash sbt compile ``` ```bash sbt bundle ``` ```bash cd /community/app/target/release/canton/examples/01-simple-topology ``` ```bash ../../bin/canton -c simple-topology.conf --bootstrap simple-ping.canton ``` -------------------------------- ### Fetch All Known Parties Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/explanations/json-api/index.rst Example JSON response for a GET request to /v2/parties. ```json { "partyDetails": [ { "party": "Alice::122099e6b7c92e12eb026f483f59a73e48149dc6e630a4f4f8fb95b8d269219b356c", "isLocal": true, "localMetadata": { "resourceVersion": "", "annotations": {} }, "identityProviderId": "" }, { "party": "Bob::122099e6b7c92e12eb026f483f59a73e48149dc6e630a4f4f8fb95b8d269219b356c", "isLocal": true, "localMetadata": { "resourceVersion": "", "annotations": {} }, "identityProviderId": "" }, { "party": "participant1::122099e6b7c92e12eb026f483f59a73e48149dc6e630a4f4f8fb95b8d269219b356c", "isLocal": true, "localMetadata": { "resourceVersion": "", "annotations": {} }, "identityProviderId": "" } ], "nextPageToken": "" } ``` -------------------------------- ### Run Example Scenario (HTTP) Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/09-json-api/typescript/README.md Executes an example scenario using the TypeScript client that interacts with the Ledger via the JSON API. This assumes the Ledger is running and client dependencies are installed. ```sh npm run scenario ``` -------------------------------- ### Run interactive topology examples Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/tutorials/app-dev/external_signing_topology_transaction.rst Execute the provided tutorial scripts to demonstrate topology transaction submission. ```bash ./interactive_topology_example.sh localhost:4002 ``` ```python python interactive_topology_example.py --synchronizer-id da::12207a94aca813c822c6ae10a1b5478c2ba1077447b468cc66dbd255f60f8fa333e1 run-demo ``` -------------------------------- ### Fetch Party Details by Identifier Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/explanations/json-api/index.rst Example JSON response for a GET request to /v2/parties/{partyId}. ```json { "partyDetails": [ { "party": "Alice::122099e6b7c92e12eb026f483f59a73e48149dc6e630a4f4f8fb95b8d269219b356c", "isLocal": true, "localMetadata": { "resourceVersion": "", "annotations": {} }, "identityProviderId": "" } ] } ``` -------------------------------- ### Run Example Scenario (WebSocket) Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/09-json-api/typescript/README.md Executes an example scenario using the TypeScript client that interacts with the Ledger via the JSON API using WebSockets. This assumes the Ledger is running and client dependencies are installed. ```sh npm run scenario_websocket ``` -------------------------------- ### Install Observability Stack Source: https://github.com/digital-asset/canton/blob/main/performance/README.md Run this script to build the dashboard and upload all files to the db-testing machine. Replace `` with your actual username. ```bash performance/observability/install-stack.sh ``` -------------------------------- ### Run Party Onboarding Scenarios Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/08-interactive-submission/README.md Scripts to onboard parties using external keys for single or multi-hosted configurations. ```bash ./examples/08-interactive-submission/external_party_onboarding.sh ``` ```bash ./examples/08-interactive-submission/external_party_onboarding.sh --multi-hosted ``` -------------------------------- ### Start Canton Nodes for High Availability Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/04-high-availability/README.md This script initiates a PostgreSQL container and then starts multiple Canton daemon processes for participants and sequencers, demonstrating a high-availability setup. Ensure you are in the '04-high-availability' directory before running. ```sh # assumes you are in the 04-high-availability directory # start a postgres docker container and create 5 separate databases ./run-docker-postgres.sh & # start the participant-a process ../../bin/canton daemon --log-file-name=participant-a.log \ --config postgres.conf,participant-a.conf & # start the participant-b process ../../bin/canton daemon --log-file-name=participant-b.log \ --config postgres.conf,participant-b.conf & # start the sequencer-a process ../../bin/canton daemon --log-file-name=sequencer-a.log \ --config postgres.conf,sequencer-a.conf & # start the sequencer-b process ../../bin/canton daemon --log-file-name=sequencer-b.log \ --config postgres.conf,sequencer-b.conf & ``` -------------------------------- ### Daml-LF REPL Example Usage Source: https://github.com/digital-asset/canton/blob/main/community/daml-lf/README.md Demonstrates loading a project, executing a function, and running scenarios within the Daml-LF REPL. Use `:help` for more commands. ```bash bazel run //:daml-lf-repl -- repl daml> :load project.dar daml> Project.double 4 8 daml> :scenario Project.tests ... ``` -------------------------------- ### Setup Performance Database Source: https://github.com/digital-asset/canton/blob/main/performance/README.md Initializes the performance test database schema and configuration. ```bash ../../config/utils/postgres/db.sh setup ``` -------------------------------- ### List Specific User Rights Response Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/explanations/json-api/index.rst Example JSON response body for a GET request to /v2/users/{userId}/rights. ```json { "rights": [ { "kind": { "CanActAs": { "value": { "party": "Bob::122099e6b7c92e12eb026f483f59a73e48149dc6e630a4f4f8fb95b8d269219b356c" } } } }, { "kind": { "ParticipantAdmin": { "value": {} } } } ] } ``` -------------------------------- ### List All DALF Packages Response Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/explanations/json-api/index.rst Example JSON response body for a GET request to /v2/packages, returning a list of package IDs. ```json { "packageIds": [ "9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69", "0e4a572ab1fb94744abb02243a6bbed6c78fc6e3c8d3f60c655f057692a62816", "5aee9b21b8e9a4c4975b5f4c4198e6e6e8469df49e2010820e792f393db870f4", "a1fa18133ae48cbb616c4c148e78e661666778c3087d099067c7fe1868cbb3a1", "a36cfff1da2f15da3d760c872860bf03140aa699f73b57b639fd40dfe8156cfe", "54f85ebfc7dfae18f7d70370015dcc6c6792f60135ab369c44ae52c6fc17c274" ] } ``` -------------------------------- ### Bootstrap and initialize nodes Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/participant/tutorials/getting_started.rst Commands to initialize the synchronizer and sequencer after startup. ```canton mysynchronizer.bootstrap() ``` ```canton mysynchronizer.sequencer.initialize() ``` -------------------------------- ### Start Canton for Multi-Hosted Onboarding Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/tutorials/app-dev/external_signing_onboarding_multihosted.rst Command to initialize the Canton environment with the required configuration and bootstrap files. ```default # This file will be written by Canton on startup and contain the runtime allocated ports export CANTON_PORTS_FILE=external_party_onboarding_multi_hosted.json ./bin/canton -c examples/08-interactive-submission/interactive-submission.conf --bootstrap examples/08-interactive-submission/bootstrap.canton ``` -------------------------------- ### Run TypeScript Scenarios Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/14-multisync/README.md Installs dependencies, builds the TypeScript project, and executes the defined scenarios. This command should be run after the Canton sandbox has started. ```bash npm install npm run build npm run scenario ``` -------------------------------- ### HOCON Configuration Example Source: https://github.com/digital-asset/canton/blob/main/release-notes/2.10.1.md This HOCON configuration demonstrates a nested structure where a sensitive field is defined and then overridden. This setup can lead to issues with confidential information redaction in logs. ```hocon _storage { password = confidential } canton { storage = ${_storage} } ``` -------------------------------- ### Manually Start Canton Nodes Source: https://github.com/digital-asset/canton/blob/main/scripts/testing-upgrade/testing-canton-upgrade.md Manually start the sequencers, mediators, and participants after starting Canton with `--manual-start`. ```scala sequencers.local.foreach(_.start()) mediators.local.start() participants.local.start() ``` -------------------------------- ### Run One Sequencer Example Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/11-bft-sequencer/README.md Command to bootstrap the BFT synchronizer with one sequencer, one mediator, and two participants. ```bash ../../bin/canton -c minimal.conf --bootstrap minimal-ping.canton ``` -------------------------------- ### Build Canton Documentation (Full) Source: https://github.com/digital-asset/canton/blob/main/docs-open/README.md Use the `sbt makeOpenDocs` task to build the documentation from scratch, suitable for a fresh clone or after a `sbt clean`. Use `sbt makeSiteFull` if the Canton code is compiled and packaged. ```bash sbt makeOpenDocs ``` ```bash sbt makeSiteFull ``` -------------------------------- ### Oracle Storage Configuration Mixin Example Source: https://github.com/digital-asset/canton/blob/main/release-notes/2.1.0.md An example of an Oracle storage configuration mixin, found in the advanced configuration examples. ```hocon examples/03-advanced-configuration/storage ``` -------------------------------- ### Run Composability Examples Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/05-composability/README.md Standard command to execute the composability workflow using the provided configuration and bootstrap scripts. ```bash ./bin/canton -c examples/05-composability/composability.conf \ --bootstrap examples/05-composability/composability1.canton ./bin/canton -c examples/05-composability/composability.conf \ --bootstrap examples/05-composability/composability2.canton ``` -------------------------------- ### Launch Canton and View Help Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/participant/tutorials/getting_started.rst Commands to display help information or start the Canton console using a specific configuration file. ```bash bin/canton --help ``` ```bash bin/canton -c examples/01-simple-topology/simple-topology.conf ``` -------------------------------- ### Verify Docker installation Source: https://github.com/digital-asset/canton/blob/main/contributing/1_setup.md Check that Docker is correctly installed and accessible. ```shell docker --version ``` -------------------------------- ### Install project dependencies Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/tutorials/json-api/canton_and_the_json_ledger_api_ts_multisync.rst Install the required Node.js packages for the TypeScript project. ```bash npm install ``` -------------------------------- ### HTTP Authorization Header Examples Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/explanations/json-api/index.rst Examples of providing the Authorization header for HTTP requests. ```none Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwczovL2RhbWwuY29tL2xlZGdlci1hcGkiOnsibGVkZ2VySWQiOiJNeUxlZGdlciIsImFwcGxpY2F0aW9uSWQiOiJIVFRQLUpTT04tQVBJLUdhdGV3YXkiLCJhY3RBcyI6WyJBbGljZSJdfX0.34zzF_fbWv7p60r5s1kKzwndvGdsJDX-W4Xhm4oVdpk ``` ```bash curl -X 'POST' \ 'http://localhost:8080/v2/users' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOltdLCJleHAiOm51bGwsImlzcyI6bnVsbCwic2NvcGUiOiJFeHBlY3RlZFRhcmdldFNjb3BlIiwic3ViIjoicGFydGljaXBhbnRfYWRtaW4ifQ.8bABNm1t718TuJXwRQOF2gXOclrL38t0uCmWkIT7Pcg' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d @body_create_user.json ``` -------------------------------- ### Build the replay-benchmark tool Source: https://github.com/digital-asset/canton/blob/main/community/daml-lf/snapshot/README.md Compile the benchmark tool using sbt. ```bash sbt "daml-lf-snapshot/Test/compile" ``` -------------------------------- ### Run the interactive submission demo Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/tutorials/app-dev/external_signing_submission_part_2.rst Execute the demonstration script provided in the examples folder. ```bash python interactive_submission.py run-demo ``` -------------------------------- ### Concrete Error Description Example Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/participant/reference/error_codes.rst An example of a fully populated error description string. ```java TRANSACTION_NOT_FOUND(11,12345): Transaction not found, or not visible. ``` -------------------------------- ### Start the Canton sandbox with multi-sync support Source: https://github.com/digital-asset/canton/blob/main/docs-open/src/sphinx/sdk/tutorials/json-api/canton_and_the_json_ledger_api_ts_multisync.rst Launch the Canton environment configured for multi-synchronizer operations. ```bash ./run.sh ``` -------------------------------- ### Verify Git installation Source: https://github.com/digital-asset/canton/blob/main/contributing/1_setup.md Check the installed version of Git to ensure it is available in the environment. ```shell git --version ``` -------------------------------- ### Canton Help and Node Management Source: https://github.com/digital-asset/canton/blob/main/community/app/src/test/resources/docs/poc.txt Access help documentation for specific nodes and initiate local node startup. ```scala help("participant1") ``` ```scala nodes.local.start() ``` -------------------------------- ### Execute Submission Examples Source: https://github.com/digital-asset/canton/blob/main/community/app/src/pack/examples/08-interactive-submission/README.md Commands to run the Python-based demo for externally signed transactions and topology updates. ```bash python interactive_submission.py run-demo ``` ```bash ./interactive_topology_example.sh localhost:4002 ``` ```bash python interactive_topology_example.py --synchronizer-id run-demo ``` -------------------------------- ### Install lnav format files Source: https://github.com/digital-asset/canton/blob/main/contributing/1_setup.md Install the required format files to enable log analysis for Canton. ```shell lnav -i canton.lnav.json lnav -i canton-json.lnav.json ```