Blockchain disk space...

+2 votes
I have been running a test environment with multichain the last month and I noticed that the blockchain is growing rather quickly. The size of the chain is well over 100MB in disk space in just a few weeks. I am wondering is this normal or is there something wrong with my setup?

In just a few weeks I have over 100,000 blocks in the chain. In the test environment I only have a dozen or so addresses with less than 100 transactions and about 4 nodes mining. Right now I am averaging around 200 megs per month that will add up to several Gigs in space per year if my calculations are correct. What can I expect in disk space after a year in operation with 100 addresses and well over 100 transactions per month?
asked Sep 19, 2016 by dtarsio

1 Answer

+1 vote

In your case, all of the space is being taken up by the empty blocks, rather than those few transactions you have initiated, which will take up less than a megabyte in total.

Each block has an 80-byte header, as well as a "coinbase" transaction that contains the miner's signature, even if there are no 'real' transactions in it. And those blocks are indexed in various ways.

So our recommendation would be to run a blockchain with a longer target-block-time parameter. We are also considering adding a future option whereby a block will not be mined if there are no real transactions within.

answered Sep 20, 2016 by MultiChain
So with the default configuration this is approx 80 bytes every 15 seconds?  About 320 bytes per minute?
It's more than that because of the coinbase transactions and the indexing of the blockchain, and debug logs, and a lot else. Right now it's about 2.5 KB / block on disk, and over time we will reduce this a lot. But the blocks themselves take up around 250-300 bytes each. So for now with a 15-second block time you can estimate something like 5 GB/year, but once we approach a release version, more like 1 GB/year.
Ok lets say I start a chain today with current alpha version 24. As more wallets start to connect and transactions grow and wallets are upgraded to alpha version 25,26, etc. Will the yearly usages start to drop if you are optimizing this in future releases or will I be stuck with the current usage for the life of the blockchain that I start today?  Does that question make sense?  Another words will the chain optimizations reflect in future releases if the chain is started now.
I'm afraid this is too hard to predict at this stage. But you always have the option of starting a new node on the same chain using a newer version of MultiChain, and using dumpprivkey/importprivkey to move the private keys across.
I am running a test chain with very few transactions right now and its been in operation a little less than a month. I am finding that the chain is using up a lot of disk space. Not 5GB/yr but more like 16GB/month. To be a little more specific I noticed the permissions.log file is getting huge and taking up almost 16GB. Any idea why that file is taking up so much space on all the nodes? Any way to fix this problem?
Do you mean permissions.dat or permissions.log?
permissions.log is huge at 16Gigs with only 89583 blocks in the chain.
OK, thanks - we'll be looking into disk usage in general as part of the next alpha (27).
I deleted the .log file and started the chain again.  In only a few hours its back up to several Gigs.  Its a huge file again but I was able to extract some data out of it.  Its logging about every half second "CanSend: FALSE". We are going to need some kind of fix as soon as possible because the .log file grows so large and so fast its maxing out disk space on most of the nodes causing them to shut down.
OK, thanks. Can you please grab the last 100000 lines of the file using "tail -n 100000 permissions.log" then gzip it and send to multichain.debug@gmail.com.
We got it - thanks - and are taking a look at the problem.
I'm told by our dev team that this has been fixed in alpha 26 already.
Ok I am running alpha 24.  I will upgrade and see if it fixes the problem.
...