This guide assumes you've completed the Quick Start from the README and are ready to explore advanced features, detailed configuration, and best practices.
After completing the README's quick start, this guide will teach you:
- Authentication Management: Token management, refresh, and troubleshooting
- Development Mode: Testing without authentication using
--disable-authflag - Service Configuration: Using different proxy servers and custom URLs
- Direct P2P: How messages flow directly to nodes via ADR-0002
- Advanced Features: Message persistence, webhooks, and monitoring
- Production Best Practices: Performance optimization and troubleshooting
Before following this guide, ensure you have:
- ✅ Installed the CLI via the install script or manual download
- ✅ Completed authentication with
mump2p login - ✅ Tested basic publish/subscribe from the README examples
If you haven't done these steps yet, please start with the README first.
You should already be authenticated from the README quick start. This section covers authentication management and troubleshooting.
Check your current authentication status and token details:
mump2p whoamiThis displays:
- Your client ID and email
- Token expiration time (24 hours from login)
- Token validity status
- Rate limits and quotas for your account
If your token is about to expire, you can refresh it:
mump2p refreshBy default, authentication tokens are stored in ~/.mump2p/auth.yml. For production deployments, security requirements, or non-root users, you can customize this location:
# Use custom authentication file path
mump2p --auth-path /opt/mump2p/auth/token.yml login
# All subsequent commands will use the same custom path
mump2p --auth-path /opt/mump2p/auth/token.yml publish --topic=demo --message="Hello"
mump2p --auth-path /opt/mump2p/auth/token.yml logoutEnvironment Variable Support:
# Set via environment variable (applies to all commands)
export MUMP2P_AUTH_PATH="/opt/mump2p/auth/token.yml"
mump2p login
mump2p publish --topic=demo --message="Hello"Use Cases:
- Security: Store auth files in secure, restricted directories
- Deployment Automation: Use with Ansible, Terraform without root permissions
- Multi-user Environments: Separate auth files per user/service
- Container Deployments: Mount auth files from persistent volumes
Important Notes:
- The directory will be created automatically if it doesn't exist
- Rate limiting usage files will be stored in the same directory
- Ensure the user has write permissions to the specified directory
For development and testing scenarios, you can bypass authentication entirely using the --disable-auth flag:
# All commands work without login (requires --client-id and --service-url)
mump2p --disable-auth --client-id="my-test-client" whoami
mump2p --disable-auth --client-id="my-test-client" publish --topic=test --message="Hello" --service-url="http://us1-proxy.getoptimum.io:8080"
mump2p --disable-auth --client-id="my-test-client" subscribe --topic=test --service-url="http://us1-proxy.getoptimum.io:8080"
mump2p --disable-auth --client-id="my-test-client" list-topics --service-url="http://us1-proxy.getoptimum.io:8080"
mump2p --disable-auth usage
# Combine with debug mode
mump2p --disable-auth --client-id="my-test-client" --debug publish --topic=test --message="Hello" --service-url="http://us1-proxy.getoptimum.io:8080"When using --disable-auth:
- Must provide
--client-idflag with your chosen client ID - No rate limits enforced (bypasses all quotas)
- No usage tracking
- All functionality works without authentication
- Requires
--service-urlfor network operations (publish, subscribe, list-topics)
To remove your stored authentication token:
mump2p logoutThe README used the default proxy. This section shows how to configure different proxy servers for better performance or geographic proximity.
The CLI connects to proxy servers for session management, then communicates directly with P2P nodes. By default, it uses http://us1-proxy.getoptimum.io:8080, but you can specify a different one using the --service-url flag.
Available proxies:
http://us1-proxy.getoptimum.io:8080http://us2-proxy.getoptimum.io:8080http://us3-proxy.getoptimum.io:8080
Example using a specific proxy:
mump2p publish --topic=test --message='Hello' --service-url="http://us2-proxy.getoptimum.io:8080"
mump2p subscribe --topic=test --service-url="http://us3-proxy.getoptimum.io:8080"You've already tried basic topic subscription from the README. This section covers advanced options and configuration.
- CLI requests a session from the proxy (control plane)
- Proxy returns a list of scored P2P nodes with JWT tickets
- CLI connects directly to the best node via gRPC
- Messages stream directly from the node — no proxy hop
mump2p subscribe --topic=your-topic-nameBy default, 3 nodes are requested for automatic failover. If the primary node fails, the CLI falls back to the next one.
To persist messages to a local file while subscribing:
mump2p subscribe --topic=your-topic-name --persist=/path/to/save/If you provide just a directory path, messages will be saved to a file named messages.log in that directory.
To forward messages to an HTTP webhook:
mump2p subscribe --topic=your-topic-name --webhook=https://your-server.com/webhookNote: The webhook endpoint must be configured to accept POST requests.
The CLI supports flexible JSON template formatting for webhooks. You can define custom schemas using Go template syntax with available variables.
Available Template Variables:
{{.Message}}- The message content{{.Timestamp}}- Message timestamp (RFC3339 format){{.Topic}}- The topic name{{.ClientID}}- Sender's client ID{{.MessageID}}- Unique message identifier
Discord Webhooks:
mump2p subscribe --topic=alerts --webhook="https://discord.com/api/webhooks/123456789/abcdef" --webhook-schema='{"content":"{{.Message}}"}'Slack Webhooks:
mump2p subscribe --topic=notifications --webhook="https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX" --webhook-schema='{"text":"{{.Message}}"}'Telegram Webhooks:
mump2p subscribe --topic=alerts --webhook="https://api.telegram.org/bot<BOT_TOKEN>/sendMessage" --webhook-schema='{"chat_id":"<CHAT_ID>","text":"{{.Message}}"}'Raw Messages (No Schema):
mump2p subscribe --topic=logs --webhook="https://webhook.site/your-unique-id"For more control over webhook behavior:
mump2p subscribe --topic=your-topic-name \
--webhook=https://your-server.com/webhook \
--webhook-queue-size=200 \
--webhook-timeout=5Options:
--webhook-queue-size: Maximum number of messages to queue before dropping (default:100)--webhook-timeout: Timeout in seconds for each webhook POST request (default:3)
You can both save messages locally and forward them to a webhook:
mump2p subscribe --topic=your-topic-name \
--persist=/path/to/messages.log \
--webhook=https://your-server.com/webhookYou've tried basic publishing from the README. This section covers advanced publishing options and file handling.
mump2p publish --topic=your-topic-name --message='Your message content'To publish the contents of a file:
mump2p publish --topic=your-topic-name --file=/path/to/your/file.jsonRate limits will be automatically applied based on your authentication token.
To see all topics you're currently subscribed to:
mump2p list-topicsYou can check your topics on a specific proxy server:
mump2p list-topics --service-url="http://us2-proxy.getoptimum.io:8080"Note: Each proxy server maintains separate topic states, so you may have different topics on different proxies.
To see your current usage statistics and rate limits:
mump2p usageInteractive real-time dashboard showing network metrics, message statistics, and latency data.
mump2p tracer dashboardOptions:
--window: Time window for metrics (default:10s)--topic: Topic for auto-publishing demo messages (default:demo)--count: Number of messages to auto-publish (default:60)--interval-ms: Interval between published messages in ms (default:500)
Press q or Ctrl+C to exit.
mump2p healthmump2p health --service-url="http://us2-proxy.getoptimum.io:8080"The --debug flag provides detailed session, node, and timing information for troubleshooting and performance analysis. When enabled, it shows:
- Session details: Session ID, proxy URL, session creation timing
- Node selection: Node addresses, regions, scores, connection attempts
- Message metadata: Timestamps, size, hash, protocol, P2P peer paths
- Timing breakdown: Session vs publish/subscribe timing
# Debug publish
mump2p --debug publish --topic=test-topic --message='Hello World'
# Debug subscribe
mump2p --debug subscribe --topic=test-topicDebug mode is useful for load testing and performance analysis:
# Terminal 1: Subscribe with debug mode
mump2p --debug subscribe --topic=load-test
# Terminal 2: Send multiple messages rapidly
for i in {1..50}; do
mump2p --debug publish --topic=load-test --message="Test message $i"
done- Topic Names: Choose descriptive and unique topic names to avoid message conflicts
- Message Size: Be aware of your maximum message size limit when publishing files
- Token Refresh: For long-running operations, refresh your token before it expires
- Topic Management: Use
mump2p list-topicsto check your active topics - Persistent Subscriptions: Use the
--persistoption when you need a record of messages - Webhook Reliability: Increase the queue size for high-volume topics to prevent message drops
- Failover: Use
--expose-amountto control how many backup nodes are available (subscribe defaults to 3) - Health Monitoring: Check proxy health with
mump2p healthbefore long operations - Debug Analysis: Use
--debugflag for performance monitoring and troubleshooting message flow issues
- Authentication Errors: Run
mump2p whoamito check token status, andmump2p loginto re-authenticate - Rate Limit Errors: Use
mump2p usageto check your current usage against limits - Topic Issues: Use
mump2p list-topicsto verify your active topics - Connection Issues: Check proxy server health with
mump2p health, try a different proxy with--service-url - Webhook Failures: Check that your webhook endpoint is accessible and properly configured to accept POST requests