ClawNetworkClawNetwork

Configuration

CLI flags, environment variables, and network configuration.

CLI Reference

claw-node init

Initialize a new node data directory.

claw-node init [OPTIONS]
FlagDefaultDescription
--networkdevnetNetwork to join: devnet, testnet, mainnet
--data-dir~/.clawnetworkData directory path

claw-node start

Start the node.

claw-node start [OPTIONS]
FlagDefaultDescription
--network, -ndevnetNetwork: devnet, testnet, mainnet
--rpc-port9710JSON-RPC HTTP port
--p2p-port9711P2P networking port
--bootstrap(built-in)Additional bootstrap peer multiaddr
--singlefalseSingle-node mode (no P2P)
--data-dir~/.clawnetworkData directory path
--log-formattextLog 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-checkfalseSkip 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 address

claw-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

SectionFieldTypeDefaultDescription
nodenetworkstring"devnet"Network preset: "devnet", "testnet", or "mainnet". Cannot be changed after chain is initialized.
networkrpc_portinteger9710Port to bind the JSON-RPC HTTP server on.
networkp2p_portinteger9711Port to bind the P2P networking socket on.
networkbootstraparray 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.
networksinglebooleanfalseIf true, forces single-node mode (no P2P). Mainnet/testnet bootstrap peers are still disabled.
logformatstring"text"Log output format: "text" (human-readable) or "json" (structured).
logfilterstring(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/9711

Environment Variables

VariableDefaultDescription
RUST_LOGclaw=infoLog level filter
CLAW_RPC_URLhttp://localhost:9710RPC endpoint (for SDK/MCP)
CLAW_RPC_CORS_ORIGINSlocalhost onlyComma-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

PortProtocolDescription
9710TCP/HTTPJSON-RPC API
9711TCPP2P 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 mainnet

Use 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 mainnet

Comma-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 mainnet

Note: This is consistent with industry practice — similar to Geth's --http.corsdomain and Substrate's --rpc-cors flags.

RPC Limits

LimitValue
Rate limit100 requests/second per IP
Max body size256 KB
Max P2P message16 MB
Max peer connections50