Skip to content

Instantly share code, notes, and snippets.

@DaWe35
Last active June 4, 2024 16:27
Show Gist options
  • Save DaWe35/aaa0d1a99be4a6fb0977fb7df7ddb702 to your computer and use it in GitHub Desktop.
Save DaWe35/aaa0d1a99be4a6fb0977fb7df7ddb702 to your computer and use it in GitHub Desktop.
Monero sync modes

Sync modes

Full node

Download, verify, and store the whole blockchain

monerod --fast-block-sync=0

Fast sync

Sync up most of the way by using embedded, known block hashes.

monerod

As you can see, fast block sync is on by default.

Prune

Prune blockchain

monerod --prune-blockchain --sync-pruned-blocks

Again, fast-block-sync is on by default in this case too.

Explanation

Flag Reduces Explanation
--fast-block-sync (default 1) CPU usage Sync up most of the way by using embedded, known block hashes.
--prune-blockchain Storage usage Some unnecessary data won't be stored on your computer, reducing the local blockchain database size by ~66%
--sync-pruned-blocks Bandwidth Allow syncing from nodes with only pruned blocks (only when --prune-blockchain is on)

Sync time estimates

All estimates are calculated on 2024 february. I ran tests in docker on a 3 vCore, 4GB RAM, 200 Mbit/s port, SSD VPS. At this date, the uncompressed Monero block chain is size was 180GB. You can get the current number by running this command:

x=$(curl -sd '{"jsonrpc":"2.0","id":"0","method":"get_info"}' http://node.moneroworld.com:18089/json_rpc | grep 'database_size' | sed -r 's/.*: ([0-9]*)\,.*/\1/g'); y=$((x/1024/1024/1024)); echo -e "\tCurrent uncompressed Monero block chain is: "$y"GB"

  • Full sync: monerod estimates a 15 days. I'll update this when I get more precise info, I started the sync around 2024-02-25 13:00 UTC
  • Fast sync takes around 4 days to complete
  • Pruned sync should be just a bit faster than fast sync when --sync-pruned-blocks is on. Don't expect big performance improvements.

Please comment your tests so we can see a better average.

@lkraider
Copy link

What is the current size of the pruned database?

@DaWe35
Copy link
Author

DaWe35 commented May 23, 2024

What is the current size of the pruned database?

It's around 75 GB, while the full chain is 209 GB

@Demontager
Copy link

Demontager commented Jun 2, 2024

also looking the most optimal config to accelerate monero-wallet-cli sync from own node. Now i'm syncing with own node to create pruned-node
./monerod --prune-blockchain --add-exclusive-node 192.168.1.100:18080

Then i will try to fit whole pruned blockchain into memory, probably further to decrease latency. I got 128gb ddr3 memory, so non-pruned blockchain wont fit.

@Demontager
Copy link

Demontager commented Jun 4, 2024

Once i fully synced pruned node and tried to sync monero-wallet-cli, it just stops syncing randomly at some blocks.

 ./monero-wallet-cli --daemon-address 127.0.0.1:15000 --trusted-daemon --generate-from-view-key wallet0 --restore-height 2000000
...
The daemon is not set up to background mine.
With background mining enabled, the daemon will mine when idle and not on battery.
Enabling this supports the network you are using, and makes you eligible for receiving new monero
Do you want to do it now? (Y/Yes/N/No): : n
Background mining not enabled. Set setup-background-mining to 1 to change.
If you are new to Monero, type "welcome" for a brief overview.
Starting refresh...
Error: refresh failed: no connection to daemon. Please make sure daemon is running.. Blocks received: 23976
Background refresh thread started
[wallet 46qPuY (out of sync)]: 

But it fine syncs if it syncs with own full node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment