RaiBlocks Wallet Sync Workaround!

in #raiblocks7 years ago (edited)

The majority of users can see the potential in RaiBlocks. With zero transaction fees, block lattice technology, a Qualcomm engineer as the dev, and a far smaller market cap than its closest competitor ($IOTA), whats not to like? Oh, yeah. The Wallet.

Its no secret that it seems to take forever to sync a new wallet, or even one you havent opened in a while. But RaiBlocks seems to take this to another patience-straining level altogether. Why? I did some testing on my own, and working with the dev and his associates found the reason behind the slowdown. Since the issue has been found, the dev can now find a suitable solution and hopefully the next wallet release will be a breeze to sync and use.

The problem

Storage. Specifically, the speed limits inherent in our storage hardware and how RaiBlocks stores its data. Until now, the answer to all your questions was always to be patient, give it time, it will sync eventually. And it does! But it could take days and the more cautious among us want to know NOW if our funds are where they need to be! So why do we need to wait so long? Rather than a simple block-to-block chain in 1 dimension (time), RaiBlocks uses a block lattice structure. This is a 2D version of a block chain, with every account having its own chain of blocks. Thus, to sync the whole block lattice, EVERY account must be fetched and downloaded, meaning you are essentially downloading lots and lots of little blockchains.

The slowdown

Currently the RaiBlocks wallet (verified as of 7.9.0) commits all downloaded blocks in the lattice when they are aquired. This means lots of little write operations to the on-disk database of your wallet. With traditional wallets, most blocks are around 1MB or more in size, which is an easy amount of data to write at once. When you ask a disk to write much smaller pieces of data at a time (sometimes 100 BYTES at a time), you start to get some overhead, since modern filesystems store data in larger clusters. If you use a traditional spinning platter HDD (hard disk drive) you will notice the slowdown the most. If you use Windows 8 or 10, open your Task Manager and see how much disk usage rai_wallet shows, odds are it will be a very high percentage while you are syncing! This is because the wallet is trying to save all those little pieces of block lattice data to its database and the disk simply cannot keep up! If you have a SSD (solid state drive) you wont see as much of a slow down as those with HDDs do, but the wallet will still put a massive strain on your drive. And since SSDs are more sensitive to write operations, you might see a shortening of your SSDs lifespan due to the sheer number of disk write operations.

The solution

Now, there are a number of ways this could be resolved. The dev might change how data is stored by the wallet, or process data in chunks before writing a whole batch of them to disk. The solution is up to the dev and what he finds works best. What is the solution though, for us here and now? Well what if we would use a disk that was REALLY, REALLY FAST? A disk that didnt care how much you wrote to it? That, my friends, would be a RAM Disk.

A RAM Disk maps a portion of your computer's RAM to act as a storage device. Since RAM is volatile, meaning it loses its data when it loses power, we dont want to keep our files on this disk for a long time! What we do what to do, however, is move our RaiBlocks folder onto a super speedy chunk of RAM, let it sync, and then move it back to our storage device of choice. This way the RaiBlocks wallet gets the speed it needs to gather up all those little block lattice transactions, and we get our wallet online sooner!

Here is what you need to do:

  1. Download ImDisk from https://sourceforge.net/projects/imdisk-toolkit/
  2. Install ImDisk, and launch its control panel.
  3. Before you configure anything, first MAKE A COPY OF ALL YOUR RAIBLOCKS DATA!!! Its usually stored at C:\Users\Your Username\AppData\Local\RaiBlocks
  4. Delete your RaiBlocks folder's contents.
  5. Configure ImDisk with 3 or 4GB of your RAM, you MIGHT be able to make due with 2GB, for now.
  6. Have ImDisk mount the RAM Disk to your RaiBlocks folder, not a drive letter! This creates something called a SymLink, telling windows whatever is in that folder is actually elsewhere. In our case, thats on our RAM Disk.
  7. DO NOT CLOSE IMDISK! Keep it open for as long as you need to sync!
  8. Copy your RaiBlocks folder data back into the RaiBlocks folder, which is now existing in RAM!
  9. Launch your RaiBlocks wallet and let it sync!

The sync process may take as long as 4 hours if you are starting fresh, or as little as 10 minutes if you have a fast connection and have already sync-ed most of the database.

Once sync is complete, BACKUP your RaiBlocks data again. Then, close ImDisk. Copy your RaiBlocks data back to its old folder. You can now use your wallet as before.

If you want to continue using RAM, you can tell ImDisk where to store your RaiBlocks data when it closes the RAM Disk. Be aware though, if a sudden crash or power outage happens you might lose this data! So always keep a backup! Enjoy using RaiBlocks, folks!

UPDATE: Dev has said he will be fine tuning caching parameters in the wallet, so we should have an update to address this soon.



Congratulations @icarusglider! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You published your First Post

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

This is great news, the sync issues are what has prevented XRB from being listed on bigger exchanges.

Has this been fixed?

Agree, has this problem been fixed, seems pretty awful.

When I try to perform step 6 I dont see any option within ImDisk (version 2.0.9) to mount the RAM Disk to my RaiBlocks folder (or any folder for that matter). So it looks like I still have to mount the RAM Disk to a drive letter first, for instance R: and then use Link Shel Extension to make a symbolic link, hopefully causing the contents of the RaiBlocks folder to be stored in the fast RAM Disk R:
Am I doing something wrong or am I overseeing something?

Congratulations @icarusglider! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.23
TRX 0.12
JST 0.029
BTC 66278.21
ETH 3557.49
USDT 1.00
SBD 3.14