Skip to main content

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​

KeyPurpose
hostValidator host or tunnel endpoint.
ledgerPortLedger gRPC port. Default: 5001.
adminPortAdmin gRPC port for FULL mode checks. Default: 5002.
grpcAuthoritygRPC :authority for vhost routing.
adminGrpcAuthorityAdmin gRPC :authority when Admin is vhost-routed.
httpHost, httpPortJSON Ledger API host/port for vetting fallback.
tls, tlsCertFileTLS for gRPC connections.
tokenJWT string, usually from an environment variable.
tokenFilePath to a file containing a raw JWT.
tokenCommandCommand that prints a JWT to stdout.
scanApiUrlValidator scan-proxy or public Scan API base URL.
synchronizerIdOptional. Set when vetting or sync checks need a specific synchronizer.
fallbackUsdPerCc, fallbackUsdPerMbOffline pricing fallbacks when Scan is unavailable.
highCostWarnCcThreshold for W002. Default: 0 on LocalNet, 5 on mainnet, 1 otherwise.
grpcMaxInboundBytesPayload size limit used for W001. Default: 4 MB.

Environment overrides​

Env varOverrides
CANTON_PROFILER_NETWORKdefaultNetwork
CANTON_PROFILER_HOSThost
CANTON_PROFILER_LEDGER_PORTledgerPort
CANTON_PROFILER_ADMIN_PORTadminPort
CANTON_PROFILER_TOKENtoken
CANTON_PROFILER_GRPC_AUTHORITYgrpcAuthority
CANTON_PROFILER_GRPC_DEADLINE_MSgRPC timeout. Default: 60000.
CANTON_PROFILER_JSON_TIMEOUT_MSJSON API timeout. Default: 20000.
CANTON_PROFILER_ADMIN_PROBE_MSAdmin 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',
},