Skip to content

Run locally

Overview · Prerequisites

  1. Check out a release tag.
  2. Generate the frontend types.
  3. Create a data directory and a .env file.
  4. Start one Decentralization Manager node.
  5. Open the operator UI and check the node.

This guide starts one node. A Decentralized Party needs other nodes. Run a second node on the same host explains the ports that each extra node needs.

Terminal window
git clone https://github.com/DLC-link/decentralization-manager.git
cd decentralization-manager
git checkout <release-tag>

Release tags have the form v<version>. The build fetches its Git dependencies over HTTPS from public repositories. It needs no SSH key.

The frontend imports TypeScript types that the gen-types binary generates from the Rust code. The repository does not track the generated file. A fresh checkout therefore does not build without this step:

Terminal window
DECMAN_SKIP_FRONTEND=1 cargo run -p decman --features typegen --bin gen-types

The command writes crates/decman/frontend/src/types.generated.ts. Run it again after you check out a different commit. If you installed just, just gen-types runs the same command.

Terminal window
mkdir -p ./development/participant-1

The node reads an optional .env file from the -d or --dir directory. Without -d, the node reads .env from the working directory. The file belongs at the root of the -d directory, not in its data/ subdirectory.

Option A: insecure mode, for local development only

Section titled “Option A: insecure mode, for local development only”

Use this path only against a Canton participant that uses unsafe shared-secret (HS256) authentication. Insecure mode starts only on devnet. The network defaults to devnet when DECPM_CANTON_NETWORK is unset.

Create ./development/participant-1/.env:

Terminal window
DECPM_PORT=8081
DECPM_NOISE_PORT=9001
DECPM_PUBLIC_ADDRESS=127.0.0.1
DECPM_CANTON_ADMIN_HOST=localhost
DECPM_CANTON_ADMIN_PORT=5002
DECPM_CANTON_LEDGER_HOST=localhost
DECPM_CANTON_LEDGER_PORT=5001
DECPM_CANTON_SYNCHRONIZER=global
DECPM_CANTON_NETWORK=devnet
DECPM_LOG_FORMAT=text

The node signs its Canton token with these defaults:

VariableDefaultMust match on the Canton participant
DECPM_CANTON_HMAC_SECRETunsafeThe unsafe auth-service secret
DECPM_CANTON_HMAC_AUDIENCEhttps://canton.network.globalThe target audience
DECPM_CANTON_HMAC_SUBJECTledger-api-userThe Ledger API user

Add these variables to .env only when your participant uses other values.

Start the node with --insecure:

Terminal window
cargo run -p decman --bin dec-party-manager -- -d ./development/participant-1 serve --insecure

Use the same .env file, and add the settings of one identity provider:

Terminal window
# Keycloak
DECPM_KEYCLOAK_URL=https://<your-keycloak-host>
DECPM_KEYCLOAK_REALM=<your-realm>
DECPM_KEYCLOAK_CLIENT_ID=<frontend-client-id>
# Or Auth0
# DECPM_AUTH0_DOMAIN=<your-tenant-domain>
# DECPM_AUTH0_CLIENT_ID=<spa-client-id>
# DECPM_AUTH0_AUDIENCE=<api-identifier>

Start the node without --insecure:

Terminal window
cargo run -p decman --bin dec-party-manager -- -d ./development/participant-1 serve

For a release build:

Terminal window
cargo build --release -p decman
./target/release/dec-party-manager -d ./development/participant-1 serve

Authentication and operator roles explains the identity-provider clients. Do not put production credentials in .env, and do not commit the file.

5. Open the operator UI and check the node

Section titled “5. Open the operator UI and check the node”

Open http://localhost:8081. Complete the login when the node uses an identity provider.

Check the HTTP listener and the metrics listener:

Terminal window
curl -s http://localhost:8081/healthz
curl -s http://localhost:9464/metrics | head

The first command returns {"status":"ok"}.

The node does these steps on a successful start:

  1. It reads .env from the -d directory, or from the working directory.
  2. It reads its participant ID from the Canton Admin API. If the Admin API is unreachable, the process exits with an error.
  3. It creates or opens the SQLite database and runs the database migrations.
  4. It generates a Noise key on the first start, or loads the existing key.
  5. It starts the metrics listener, the Noise listener and the HTTP listener.

The log shows Serving metrics on, Noise listener started on and Starting HTTP server on. In insecure mode, the log also shows INSECURE MODE ENABLED.

The data directory holds the node state under data/:

participant-1/
├── .env
└── data/
├── noise.key Noise identity of the node
└── decpm.db SQLite database: peers, party credentials, workflow state

Restart the process with the same data directory. Confirm that the Noise public key stays the same. Do not delete or replace noise.key after peers register it.

Each node opens three listeners: HTTP, Noise and metrics. Two nodes on one host need different values for all three. Each node also needs its own data directory and its own Canton participant.

Create ./development/participant-2/.env:

Terminal window
DECPM_PORT=8082
DECPM_NOISE_PORT=9002
DECPM_METRICS_PORT=9465
DECPM_PUBLIC_ADDRESS=127.0.0.1
DECPM_CANTON_ADMIN_HOST=localhost
DECPM_CANTON_ADMIN_PORT=5012
DECPM_CANTON_LEDGER_HOST=localhost
DECPM_CANTON_LEDGER_PORT=5011
DECPM_CANTON_SYNCHRONIZER=global
DECPM_CANTON_NETWORK=devnet
DECPM_LOG_FORMAT=text

Replace the Canton ports with the ports of your second participant. Start the node with -d ./development/participant-2.

The metrics port defaults to 9464 on every node. The listeners react differently to a port that is already in use:

ListenerVariableResult of a port collision
HTTPDECPM_PORTThe process exits.
NoiseDECPM_NOISE_PORTThe node logs Failed to bind Noise listener and retries every 5 seconds.
MetricsDECPM_METRICS_PORTThe node logs binding the metrics port failed; this node reports no metrics. It keeps running without metrics.

Set DECPM_METRICS_PORT to a free port on every extra node. Set it to 0 to turn off metrics on that node. A metrics port that equals the HTTP port or the Noise port of the same node gives the error metrics_port collides with another listener.

SymptomLikely check
The frontend build fails with Cannot find module './types.generated'Run the type generation in step 2.
cargo run says that it could not determine which binary to runAdd --bin dec-party-manager.
unexpected argument '-d' foundPut -d before serve.
The process exits with nothing accepts TCP connections thereThe Admin API is down, or its host or port is wrong.
Every Canton call fails with transport error or BrokenPipeThe TLS setting does not match the endpoint. Set DECPM_CANTON_ADMIN_TLS or DECPM_CANTON_LEDGER_TLS to true or false.
The process exits with only permitted on the devnet networkInsecure mode starts only on devnet. Set DECPM_CANTON_NETWORK=devnet.
The UI does not openCheck DECPM_PORT, the process log and the local firewall.
Login failsCheck the provider URL, realm or audience, public client, redirect URI, web origin, PKCE and token claims.
/metrics does not answer on a second nodeSet a distinct DECPM_METRICS_PORT.
Peers cannot connect laterCheck the Noise port, DECPM_PUBLIC_ADDRESS, the peer record and the Noise public key.
State disappears after restartUse the same -d directory, and keep it writable.