# URL of a JSON RPC for Ethereum mainnet or Sepolia testnetXLAYER_NODE_ETHERMAN_URL="http://your.L1node.url"# PATH WHERE THE STATEDB POSTGRES CONTAINER WILL STORE PERSISTENT DATAXLAYER_NODE_STATEDB_DATA_DIR="./xlayer_mainnet_data/statedb"# OR ./xlayer_testnet_datastatedb/ for testnet# PATH WHERE THE POOLDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA #XLAYER_NODE_POOLDB_DATA_DIR="./xlayer_mainnet_data/pooldb"# OR ./xlayer_testnet_data/pooldb/ for testnet
Restore latest Layer 2 snapshot
Restoring the Layer 2 snapshot database locally will allow synchronizing of Layer 2 data quickly.
# mainnet./run_xlayer_mainnet.shrestore# If using testnet./run_xlayer_testnet.shrestore
Start X Layer Node
# mainnet./run_xlayer_mainnet.shstart# If using testnet./run_xlayer_testnet.shstartdockerps-a# The following containers should be available: xlayer-rpcxlayer-syncxlayer-state-dbxlayer-pool-dbxlayer-prover
Query X Layer Node
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' http://localhost:8545
# The response should resemble the follow{"jsonrpc":"2.0","id":1,"result":"0xcab5ab"}
Additional Commands
# Stop X Layer Node./run_xlayer_mainnet.shstop# Restart./run_xlayer_mainnet.shrestart# Updating./run_xlayer_mainnet.shupdate
Access Logs
# TO VIEW LOGSdockerlogs [container idORcontainername]