Skip to content

CLI flags

This page lists the flags of the two binaries in go-ricochet 1.1.0, from their flag definitions. Flags override the config file; see config.yaml for the full precedence.

Source: cmd/ricochet/main.go. The packaged binary is /opt/ricochet/ricochet_server.

Flag Type Default Meaning
--port int 0 (unset: 55223 from the preset or file) UDP listen port; rewrites the port of every listen address
--development bool false Development preset: 1 GB storage, 100 connections, TLS to PostgreSQL off, DEBUG logging
--production bool false Production preset: 50 GB storage, 10,000 connections, pool of 50
--high-capacity bool false High-capacity preset: 100 GB storage, 50,000 connections, forwarding on, 8 push workers
--config string "" (then /etc/ricochet/config.yaml if it exists) YAML config file
--data-dir string "" Data directory (storage.data_directory)
--identity-file string "" Ed25519 identity key file (server.identity_file)
--external-addrs string "" Comma-separated multiaddrs to advertise, such as /ip4/203.0.113.10/udp/55223/udx
--debug-dht bool false Debug logging for the dht, dht/RtRefreshManager, relay and relaysvc subsystems, info for basichost
--pg-host string "" PostgreSQL host
--pg-port int 0 (unset: 5432) PostgreSQL port
--pg-database string "" Database name
--pg-username string "" Role name
--pg-password string "" Password; visible in the process list, so prefer RICOCHET_PG_PASSWORD
--pg-sslmode string "" (unset: require) require or disable
--version bool false Print ricochet <version> and exit

An empty or zero flag leaves the value from the preset and config file. Passing more than one preset flag exits with code 2. Presets are described on Presets.

Event Result
SIGINT or SIGTERM Graceful shutdown: drain, wait up to ops.shutdown_timeout, stop
Second signal before shutdown finishes Immediate exit, code 128 + signal number (130 for SIGINT, 143 for SIGTERM)
Graceful shutdown fails Exit code 1
Config file unreadable, unparsable or with an unknown key Exit code 2
More than one preset flag Exit code 2
Startup failure (database, listen address, identity) Exit code 1

See Upgrades & draining.

Source: cmd/ricochet-bench/main.go. Usage:

Terminal window
ricochet-bench [flags] <server-multiaddr> <server-peer-id>
Flag Type Default Meaning
-n int 1000 Total requests
-c int 10 Concurrent workers; each has its own libp2p host
-protocol string msa Scenario to run (below)
-payload-size int 1024 Payload size in bytes
-duration duration 0 Run for this long instead of a fixed count, such as 30s
-warmup int 10 Requests before measuring
-batch-size int 100 Documents or messages per request in the batch scenarios; at least 1
-docs int 500 Vault size for the sync scenarios; at least 1
-v bool false Show libp2p and UDX diagnostic logs

For the sync-* scenarios, -n, -warmup and -c default to 10, 1 and 1 unless you set them. -c is lowered to -n when it is larger and no -duration is set.

Scenario Operations
msa SendMessage
maa RetrieveMessages (pre-seeds the mailbox)
sda PutDocument then GetDocument
sfa AppendFeedEntry then GetFeedEntry
sca PutCollectionItem then QueryCollection
mma CreateMailbox then DeleteMailbox
mixed Random mix of the six above
sda-batch PutDocuments, -batch-size per request
msa-batch SendMessages, -batch-size per request
sync-cold PutDocument × -docs, every document new
sync-warm PutDocument × -docs, every document replaced
sync-noop ListDocuments and compare ETags, no writes

See Benchmarking.