# Besu Configuration for RPC Nodes
# RPC nodes provide public JSON-RPC API, no P2P enabled

data-path="/data/besu"
genesis-file="/config/genesis.json"

# Network Configuration
network-id=138

# P2P Configuration (DISABLED for RPC nodes)
p2p-enabled=false

# Consensus (RPC nodes don't participate)
consensus-protocol="ibft2"
miner-enabled=false

# Sync Configuration
sync-mode="SNAP"
# Alternative: sync-mode="FULL" for full sync
# Alternative: sync-mode="FAST" for fast sync
fast-sync-min-peers=3

# RPC Configuration (PUBLIC)
rpc-http-enabled=true
rpc-http-host="0.0.0.0"
rpc-http-port=8545
rpc-http-api=["ETH","NET","WEB3","TXPOOL","DEBUG","TRACE"]
# CORS origins - Production: Restrict to specific domains
# For initial deployment, allow all (update after DNS is configured)
rpc-http-cors-origins=["*"]
# TODO: Update with actual domains after deployment:
# rpc-http-cors-origins=["https://rpc.d-bis.org", "https://explorer.d-bis.org", "https://app.d-bis.org"]
# Host allowlist - Production: Restrict to specific hosts
# For initial deployment, allow all (update after DNS is configured)
rpc-http-host-allowlist=["*"]
# TODO: Update with actual hosts after deployment:
# rpc-http-host-allowlist=["rpc.d-bis.org", "rpc2.d-bis.org", "localhost", "127.0.0.1"]

rpc-ws-enabled=true
rpc-ws-host="0.0.0.0"
rpc-ws-port=8546
rpc-ws-api=["ETH","NET","WEB3","TXPOOL"]
# WebSocket origins - Production: Restrict to specific domains
# For initial deployment, allow all (update after DNS is configured)
rpc-ws-origins=["*"]
# TODO: Update with actual domains after deployment:
# rpc-ws-origins=["https://rpc.d-bis.org", "https://explorer.d-bis.org", "https://app.d-bis.org"]

# GraphQL (optional, internal only)
graphql-http-enabled=false
graphql-http-host="127.0.0.1"
graphql-http-port=8547

# Metrics
metrics-enabled=true
metrics-port=9545
metrics-host="0.0.0.0"
metrics-push-enabled=false

# Logging
logging="INFO"
log-destination="CONSOLE"

# Permissioning (account permissioning for RPC methods)
permissions-nodes-config-file-enabled=false
permissions-accounts-config-file-enabled=true
permissions-accounts-config-file="/config/permissions-accounts.toml"

# Transaction Pool
tx-pool-max-size=16384
tx-pool-price-bump=10
tx-pool-retention-hours=12

# Data Storage
database-path="/data/besu/database"
trie-logs-enabled=true

# Gas Configuration
rpc-tx-feecap="0x0"

# Native Accounts (disabled for security)
accounts-enabled=false

# JSON-RPC Limits
rpc-max-logs-range=10000
rpc-max-trace-range=10000

# Cache Configuration
cache-size-bytes=536870912

# Ethstats (optional monitoring)
ethstats=""

