Configuration
CLI flags, environment variables, and network configuration.
CLI Reference
claw-node init
Initialize a new node data directory.
claw-node init [OPTIONS]| Flag | Default | Description |
|---|---|---|
--network | devnet | Network to join: devnet, testnet, mainnet |
--data-dir | ~/.clawnetwork | Data directory path |
claw-node start
Start the node.
claw-node start [OPTIONS]| Flag | Default | Description |
|---|---|---|
--network, -n | devnet | Network: devnet, testnet, mainnet |
--rpc-port | 9710 | JSON-RPC HTTP port |
--p2p-port | 9711 | P2P networking port |
--bootstrap | (built-in) | Additional bootstrap peer multiaddr |
--single | false | Single-node mode (no P2P) |
--data-dir | ~/.clawnetwork | Data directory path |
--log-format | text | Log format: text or json |
--allow-genesis | (network preset) | Allow creating a new genesis when no chain data exists. Default: true for devnet, false for mainnet/testnet |
--skip-version-check | false | Skip version check at startup (development/emergency use only) |
claw-node key
Key management commands.
claw-node key generate # Generate new key file
claw-node key show # Display current addressclaw-node status
Display node status information.
config.toml Reference
The node configuration file is stored at ~/.clawnetwork/config.toml. It is created automatically by claw-node init with sensible defaults. CLI flags override config.toml values.
Structure
# ClawNetwork node configuration
# CLI arguments override these values.
[node]
network = "mainnet" # Network to join: "devnet", "testnet", or "mainnet"
[network]
rpc_port = 9710 # JSON-RPC HTTP server port
p2p_port = 9711 # P2P networking port
# bootstrap = ["/ip4/1.2.3.4/tcp/9711"] # Additional bootstrap peers (multiaddr format)
# single = false # Force single-node mode (no P2P)
[log]
format = "text" # Log format: "text" or "json"
# filter = "claw=info" # Log level filter (e.g. "claw=debug,other=info")Field Reference
| Section | Field | Type | Default | Description |
|---|---|---|---|---|
node | network | string | "devnet" | Network preset: "devnet", "testnet", or "mainnet". Cannot be changed after chain is initialized. |
network | rpc_port | integer | 9710 | Port to bind the JSON-RPC HTTP server on. |
network | p2p_port | integer | 9711 | Port to bind the P2P networking socket on. |
network | bootstrap | array of strings | (built-in) | Additional bootstrap peers in multiaddr format (e.g., /ip4/1.2.3.4/tcp/9711). Built-in peers are used automatically. Only uncomment to add custom peers. |
network | single | boolean | false | If true, forces single-node mode (no P2P). Mainnet/testnet bootstrap peers are still disabled. |
log | format | string | "text" | Log output format: "text" (human-readable) or "json" (structured). |
log | filter | string | (not set) | Log level filter directive. Examples: "claw=info", "claw=debug,other=warn". See tracing-subscriber for syntax. |
Bootstrap Peers
Mainnet Bootstrap
[network]
bootstrap = ["/ip4/178.156.162.162/tcp/9711"]Custom Peers
To add a custom bootstrap peer, uncomment or add to the bootstrap array:
[network]
bootstrap = ["/ip4/YOUR_IP/tcp/9711"]Alternatively, use the CLI flag (which takes precedence):
claw-node start --bootstrap /ip4/YOUR_IP/tcp/9711 --bootstrap /ip4/OTHER_IP/tcp/9711Environment Variables
| Variable | Default | Description |
|---|---|---|
RUST_LOG | claw=info | Log level filter |
CLAW_RPC_URL | http://localhost:9710 | RPC endpoint (for SDK/MCP) |
CLAW_RPC_CORS_ORIGINS | localhost only | Comma-separated allowed CORS origins (use * for public RPC) |
Network Configuration
Devnet (Local Development)
claw-node init --network devnet
claw-node start --single # No P2P, single node- Chain ID:
claw-devnet - Faucet: enabled
- P2P: disabled by default
Testnet
claw-node init --network testnet
claw-node start- Chain ID:
claw-testnet - Faucet: enabled
- Bootstrap peers: built-in
- P2P: enabled
Mainnet
claw-node init --network mainnet
claw-node start- Chain ID:
claw-mainnet - Faucet: disabled
- P2P: enabled
Ports
| Port | Protocol | Description |
|---|---|---|
| 9710 | TCP/HTTP | JSON-RPC API |
| 9711 | TCP | P2P networking (libp2p) |
Ensure both ports are open in your firewall for full node operation.
CORS Configuration
By default, the node only allows requests from localhost origins (http://localhost:*, http://127.0.0.1:*). This is safe for local development but must be configured when exposing a public RPC endpoint.
Set the CLAW_RPC_CORS_ORIGINS environment variable to control which origins can access your node's RPC API.
Allow All Origins (Public RPC)
CLAW_RPC_CORS_ORIGINS=* claw-node start --network mainnetUse this when running a public RPC endpoint that any dApp or explorer should be able to query.
Allow Specific Origins
CLAW_RPC_CORS_ORIGINS=https://myapp.com,https://explorer.example.com claw-node start --network mainnetComma-separated list of allowed origins. Only requests from these origins will be accepted.
systemd Example
To set CORS origins for a systemd-managed node, add an Environment directive:
[Service]
ExecStart=/usr/local/bin/claw-node start --network mainnet
Environment="CLAW_RPC_CORS_ORIGINS=*"Docker Example
docker run -d \
-e CLAW_RPC_CORS_ORIGINS=* \
-p 9710:9710 -p 9711:9711 \
ghcr.io/clawlabz/claw-node:latest start --network mainnetNote: This is consistent with industry practice — similar to Geth's
--http.corsdomainand Substrate's--rpc-corsflags.
RPC Limits
| Limit | Value |
|---|---|
| Rate limit | 100 requests/second per IP |
| Max body size | 256 KB |
| Max P2P message | 16 MB |
| Max peer connections | 50 |