To download the Latest Snapshot visit https://en-backups.matterlabs.dev and copy the desired link.
Run the below command in screen as the download may take hours/day depending upon internet speed & snapshot size.
Start ZkSync Node
Example docker-compose file
Import Database
Ensure that your database has finished importing before proceeding to the next step.
cd /root/zksync/repo/usr/bin
# Set migration folder as source and specify database
nohup ./sqlx migrate info --source /root/FINAL/repo/migrations --database-url postgres://postgres:password@localhost/zksync_local_ext_node & disown
# Run Database Migration
nohup ./sqlx migrate run --source /root/FINAL/repo/migrations --database-url postgres://postgres:password@localhost/zksync_local_ext_node & disown
docker compose --file ~/zksync-era/docs/src/guides/external-node/docker-compose-examples/mainnet-external-node-docker-compose.yml up -d --force-recreate
{"jsonrpc":"2.0","id":1,"result":{"startingBlock":"0x0","currentBlock":"0x3219750","highestBlock":"0x35fc3d7"}}
# or
{"jsonrpc":"2.0","id":1,"result":false} # If block is synced or < 11 block behind
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber", "params":[],"id":1}' http://localhost:3060