Skip to content

Configuration

This guide covers all configuration options for Ashen nodes, including environment variables, CLI arguments, and genesis configuration.

Terminal window
# Initialize a single node with funded account
node init --data-dir ./node-data --alloc "0xYOUR_ADDRESS=1000000000000"
# Run with defaults
node run --data-dir ./node-data
# Run with custom settings
NODE_BLOCK_TIME_MS=500 NODE_LISTEN=0.0.0.0:3030 node run

All CLI arguments can be set via environment variables. The variable name is the argument name in SCREAMING_SNAKE_CASE with NODE_ prefix.

VariableDefaultDescription
NODE_DATA_DIR./node-dataDirectory for chain data, genesis, and state
NODE_LISTEN127.0.0.1:3030RPC server listen address
NODE_BLOCK_TIME_MS1000Target block time in milliseconds
NODE_PRODUCE_EMPTYtrueProduce blocks even when mempool is empty
NODE_AUTH_TOKENnoneOptional authentication token for RPC
VariableDefaultDescription
NODE_LOG_FILEstdoutPath to log file (enables rotation when set)
NODE_LOG_ROTATIONdailyRotation policy: daily, hourly, or never
NODE_LOG_MAX_FILES7Maximum rotated log files to retain
NODE_LOG_PREFIXnodeLog file prefix (e.g., node.2026-01-22.log)
VariableDefaultDescription
NODE_RATE_LIMIT_PER_S1000RPC requests per second limit
NODE_RATE_LIMIT_BURST2000RPC burst allowance
NODE_NO_RATE_LIMITfalseDisable rate limiting (development only)
NODE_UTILITY_RATE_LIMIT_PER_S100Rate limit for /metrics and /health
NODE_UTILITY_RATE_LIMIT_BURST200Burst for utility endpoints
NODE_MAX_BODY_BYTES20971520Maximum request body size (20 MB)
VariableDefaultDescription
NODE_ARCHIVE_MODEfalsePreserve all historical state (no pruning)
NODE_PRUNE_KEEP_EPOCHS10Epochs of state to retain (ignored in archive mode)
NODE_CHECKPOINT_INTERVALepoch boundaryBlocks between state checkpoints
VariableDefaultDescription
NODE_TX_FORWARD_URLnoneForward tx_submit to this URL (gateway mode)

Initialize a new node data directory with genesis configuration.

Terminal window
node init \
--data-dir ./node-data \
--alloc "0xADDRESS1=1000000000000" \
--alloc "0xADDRESS2=500000000000" \
--seed 42 \
--seed-count 10 \
--seed-balance 1000000000
OptionDescription
--data-dirDirectory to initialize
--alloc ADDRESS=BALANCEPre-fund accounts (repeatable)
--seedSeed for deterministic address generation
--seed-countNumber of seeded accounts to create
--seed-balanceBalance for each seeded account

Run a node (single-node or validator mode).

Terminal window
# Single-node mode (development)
node run --data-dir ./node-data
# Validator mode (production)
node run \
--data-dir ./node-data \
--validator \
--validator-network-key "keystore:my-validator" \
--peers ./peers.yaml \
--p2p-port 4040 \
--bls-share "0x..." \
--bls-polynomial "0x..."

Run RPC server only, sharing data directory with another node.

Terminal window
node rpc \
--data-dir ./validator-data \
--listen 127.0.0.1:3031 \
--refresh-interval-s 1

Useful for offloading RPC traffic from validators.

Run as P2P follower (non-validator), syncing via gossip.

Terminal window
node follower \
--data-dir ./follower-data \
--peers peers.yaml \
--bootstrapper 0xPUBKEY... \
--sync-batch-size 64 \
--sync-poll-ms 500
OptionDefaultDescription
--sync-batch-size32Headers per sync request
--sync-poll-ms1000Poll interval when caught up

Control consensus timing behavior. Defaults scale with block time.

VariableDefaultDescription
NODE_LEADER_TIMEOUT_MS2 × block_timeWait for leader proposal
NODE_NOTARIZATION_TIMEOUT_MS4 × block_timeWait for notarization
NODE_NULLIFY_RETRY_MS1000Retry interval for nullification
NODE_FETCH_TIMEOUT_MS10 × block_timeTimeout for block fetches
NODE_ACTIVITY_TIMEOUT10 (view deltas)Activity timeout before view change
NODE_SKIP_TIMEOUT5 (view deltas)When to skip to higher view

Configure threshold BLS key generation for each epoch.

VariableDefaultDescription
NODE_DKG_COMMIT_TIMEOUT_S30Commitment phase timeout
NODE_DKG_SHARE_TIMEOUT_S30Share distribution timeout
NODE_DKG_COMPLAINT_TIMEOUT_S30Complaint/justification timeout
NODE_DKG_FINALIZE_TIMEOUT_S30Finalization timeout
NODE_DKG_LEAD_BLOCKS10Blocks before epoch to start DKG
NODE_DKG_MAX_RETRIES3Retry attempts for failed DKG
NODE_TLE_SHARE_TIMEOUT_MS500TLE decryption share collection

Epochs control key rotation and validator set changes.

EPOCH_LENGTH = 16 blocks (hardcoded)
  • New threshold BLS keys are generated via DKG at epoch boundaries
  • State checkpoints default to epoch boundaries
  • Pruning is configured in epochs

For multi-validator deployments.

VariableDefaultDescription
NODE_P2P_PORT4040P2P listen port (separate from RPC)
NODE_PEERS_FILEnonePath to peers.yaml
NODE_BOOTSTRAPPERSnoneBootstrapper public keys (hex)
NODE_LOCAL_P2PfalseSkip external IP discovery (testing)
NODE_P2P_MAILBOX_SIZE16384P2P message buffer size
NODE_P2P_MESSAGE_BACKLOG16384Message backlog size
peers:
- pubkey: "0x1234...abcd"
address: "192.168.1.10:4040"
- pubkey: "0x5678...efgh"
address: "192.168.1.11:4040"
- pubkey: "0x9abc...ijkl"
address: "192.168.1.12:4040"

Ashen uses an encrypted keystore for validator keys.

VariableDescription
NODE_KEYSTORE_PATHKeystore file location (default: ~/.local/share/ashen/keystore/keystore.json)
NODE_VALIDATOR_NETWORK_KEYKey reference: keystore:<handle> or ks:<label>
Terminal window
# Reference key by handle
--validator-network-key "keystore:my-validator-key"
--validator-network-key "ks:validator-1"
# Password input
--keystore-password-stdin # Read from stdin
--keystore-password-file /path/to/password

For production validators with pre-distributed BLS shares:

Terminal window
--bls-share "0x..." # Your BLS share (hex)
--bls-polynomial "0x..." # Public commitment polynomial (hex)

For testing with deterministic keys:

Terminal window
--bls-seed 42 # Same seed across all validators
--validator-index 0 # Your index (0-based)

The genesis.json file defines the initial chain state.

{
"allocations": [
{
"address": "493615aa1e16a24f618d3ab6dd93a9250ca76e19996e46493a372c5994862e8c",
"balance": 13370000000000
},
{
"address": "deadbeef...",
"balance": 1000000000000
}
]
}
FieldDescription
allocationsInitial account balances
allocations[].addressAccount address (hex, no 0x prefix)
allocations[].balanceInitial balance in base units

Terminal window
# Single node, fast blocks, no rate limits
node run \
--data-dir ./dev-data \
--block-time-ms 500 \
--no-rate-limit \
--produce-empty-blocks
Terminal window
node run \
--data-dir /var/lib/ashen \
--validator \
--validator-network-key "keystore:prod-validator" \
--peers /etc/ashen/peers.yaml \
--p2p-port 4040 \
--listen 127.0.0.1:3030 \
--bls-share "$BLS_SHARE" \
--bls-polynomial "$BLS_POLY" \
--archive-mode \
--log-file /var/log/ashen/ \
--log-rotation daily \
--log-max-files 30
Terminal window
# Offload RPC from validator
node rpc \
--data-dir /var/lib/ashen \
--listen 0.0.0.0:3030 \
--rate-limit-per-s 5000 \
--rate-limit-burst 10000 \
--refresh-interval-s 1
Terminal window
node follower \
--data-dir /var/lib/ashen-archive \
--peers /etc/ashen/peers.yaml \
--bootstrapper 0x... \
--listen 0.0.0.0:3030 \
--sync-batch-size 64

Enable execution tracing for debugging:

Terminal window
ASHEN_TRACE_OUTPUT=1 node run --data-dir ./node-data
ASHEN_TRACE_OUTPUT_DIR=./traces node run --data-dir ./node-data

Skip startup validation (testing only):

Terminal window
node run --skip-preflight --data-dir ./node-data