Configure
Put canton-profiler.config.js in the directory where you run the command. Configuration precedence is: CLI flags, then environment variables, then config file values, then defaults.
// canton-profiler.config.js
module.exports = {
defaultNetwork: 'testnet',
networks: {
testnet: {
host: 'validator.example.com',
ledgerPort: 5001,
token: process.env.MY_JWT_TOKEN,
scanApiUrl: 'https://scan.sv.test.canton.global',
},
mainnet: {
host: 'validator.example.com',
ledgerPort: 5001,
tls: true,
tokenFile: './.tokens/mainnet.jwt',
scanApiUrl: 'https://scan.sv.canton.global',
},
},
};
Core keys​
| Key | Purpose |
|---|---|
host | Validator host or tunnel endpoint. |
ledgerPort | Ledger gRPC port. Default: 5001. |
adminPort | Admin gRPC port for FULL mode checks. Default: 5002. |
grpcAuthority | gRPC :authority for vhost routing. |
adminGrpcAuthority | Admin gRPC :authority when Admin is vhost-routed. |
httpHost, httpPort | JSON Ledger API host/port for vetting fallback. |
tls, tlsCertFile | TLS for gRPC connections. |
token | JWT string, usually from an environment variable. |
tokenFile | Path to a file containing a raw JWT. |
tokenCommand | Command that prints a JWT to stdout. |
scanApiUrl | Validator scan-proxy or public Scan API base URL. |
synchronizerId | Optional. Set when vetting or sync checks need a specific synchronizer. |
fallbackUsdPerCc, fallbackUsdPerMb | Offline pricing fallbacks when Scan is unavailable. |
highCostWarnCc | Threshold for W002. Default: 0 on LocalNet, 5 on mainnet, 1 otherwise. |
grpcMaxInboundBytes | Payload size limit used for W001. Default: 4 MB. |
Environment overrides​
| Env var | Overrides |
|---|---|
CANTON_PROFILER_NETWORK | defaultNetwork |
CANTON_PROFILER_HOST | host |
CANTON_PROFILER_LEDGER_PORT | ledgerPort |
CANTON_PROFILER_ADMIN_PORT | adminPort |
CANTON_PROFILER_TOKEN | token |
CANTON_PROFILER_GRPC_AUTHORITY | grpcAuthority |
CANTON_PROFILER_GRPC_DEADLINE_MS | gRPC timeout. Default: 60000. |
CANTON_PROFILER_JSON_TIMEOUT_MS | JSON API timeout. Default: 20000. |
CANTON_PROFILER_ADMIN_PROBE_MS | Admin probe timeout. Default: 5000. |
Nginx / vhost routing​
Some validators expose Ledger, Admin, and JSON APIs through one external TCP port and route by gRPC :authority or HTTP Host. In that setup, use the external port in config and set the matching authority/host for each API.
// canton-profiler.config.js (excerpt)
testnet: {
host: 'validator.example.com',
ledgerPort: 81,
grpcAuthority: 'grpc-ledger-api.localhost',
adminPort: 81,
adminGrpcAuthority: 'grpc-admin-api.localhost',
httpPort: 81,
httpHost: 'json-ledger-api.localhost',
token: process.env.MY_JWT_TOKEN,
scanApiUrl: 'http://validator.example.com:81/api/validator',
},