Lux Docs
Run Nodes

Archive Node

Run a Lux Network archive node for full historical state access

Running an Archive Node

An archive node stores the complete historical state of the blockchain, not just the current state. This allows you to query account balances, contract storage, and transaction traces at any past block height.

Archive vs Full Node

CapabilityFull NodeArchive Node
Verify current transactionsYesYes
Current state queriesYesYes
Historical state at block NNo (pruned)Yes
Transaction tracesLimitedFull
Debug and replay transactionsNoYes
Disk space~1 TB~4+ TB

A full node prunes old state to save disk space. An archive node retains every historical state trie, enabling queries like "What was the balance of address X at block 500,000?"

Use Cases

Block Explorers

Explorers need historical data to display past balances, internal transactions, and contract state evolution.

Analytics Platforms

DeFi analytics, portfolio trackers, and research tools require access to historical state for accurate calculations.

Debugging and Auditing

Trace historical transactions step-by-step, replay failed transactions, and audit contract behavior at specific blocks.

Indexing Services

Services like subgraphs and custom indexers need to process all historical events and state changes.

System Requirements

Archive nodes have significantly higher storage requirements than full nodes.

ComponentMinimumRecommended
CPU16 cores32+ cores
RAM32 GB64+ GB
Storage4 TB NVMe8+ TB NVMe RAID
Network1 Gbps10 Gbps

Storage requirements grow continuously. Plan for at least 2 TB/year of growth and use NVMe drives for acceptable query latency on historical state. SATA SSDs will work but result in significantly slower historical queries.

Configuration

Enable archive mode by disabling state pruning in the C-Chain configuration.

C-Chain Config

Create or update ~/.luxd/configs/chains/C/config.json:

{
  "pruning-enabled": false,
  "state-sync-enabled": false,
  "eth-apis": [
    "eth",
    "eth-filter",
    "net",
    "web3",
    "internal-eth",
    "internal-blockchain",
    "internal-transaction",
    "internal-tx-pool",
    "internal-account",
    "debug-tracer"
  ],
  "local-txs-enabled": true
}

Key Flags

FlagValueDescription
pruning-enabledfalseRetain all historical state (archive mode)
state-sync-enabledfalseSync from genesis instead of a recent snapshot
eth-apisSee aboveEnable debug and trace APIs

Node Config

Start luxd with indexing enabled:

luxd \
  --network-id=mainnet \
  --index-enabled=true \
  --db-dir=/data/luxd/db \
  --config-file=$HOME/.luxd/config.json

Syncing from Genesis

Archive nodes must sync from block 0 because they need every historical state transition. This is significantly slower than a full node sync.

NetworkExpected Sync Time
Mainnet24-72 hours
Testnet6-12 hours

State sync (state-sync-enabled: true) is incompatible with archive mode because state sync skips historical state. You must sync from genesis.

Monitor Sync Progress

# Check if C-Chain is bootstrapped
curl -s -X POST --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "info.isBootstrapped",
  "params": {"chain": "C"}
}' -H 'content-type:application/json' http://localhost:9650/ext/info

# Check current block number (compare with explorer)
curl -s -X POST --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_blockNumber",
  "params": []
}' -H 'content-type:application/json' http://localhost:9650/ext/bc/C/rpc

Querying Historical State

Once synced, you can query any historical block.

Historical Balance

# Get balance at a specific block
curl -s -X POST --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBalance",
  "params": ["0xYourAddress", "0x7A120"]
}' -H 'content-type:application/json' http://localhost:9650/ext/bc/C/rpc

The second parameter is the block number in hex. A full node would return an error for old blocks; an archive node returns the actual historical balance.

Transaction Traces

# Trace a transaction
curl -s -X POST --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "debug_traceTransaction",
  "params": ["0xTransactionHash", {"tracer": "callTracer"}]
}' -H 'content-type:application/json' http://localhost:9650/ext/bc/C/rpc

Historical Contract Storage

# Read contract storage at a past block
curl -s -X POST --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getStorageAt",
  "params": ["0xContractAddress", "0x0", "0x7A120"]
}' -H 'content-type:application/json' http://localhost:9650/ext/bc/C/rpc

Storage Management

Disk Layout

/data/luxd/db/
  mainnet/
    C/                  # C-Chain state (largest)
    P/                  # P-Chain state
    X/                  # X-Chain state

The C-Chain directory consumes the vast majority of storage on an archive node.

Monitoring Disk Usage

Set up alerts for disk usage at 80% capacity. When storage is nearly full, the node will fail to process new blocks.

# Check disk usage
df -h /data/luxd/db/

# Check C-Chain state size
du -sh /data/luxd/db/mainnet/C/

Storage Expansion

If you need to migrate to a larger disk:

  1. Stop luxd
  2. Copy the entire db directory to the new disk
  3. Update --db-dir in your configuration
  4. Restart luxd

Further Reading

On this page