Peercoin blockchain package

I have packaged the blockchain, it is available in repository as of now.

** This is a snapshot of blockchain @ 20:00 GMT +1 2014.09.05 @ block 131247 **

I recommend this for new Peerbox installs, but it is not there by default. Read bellow to see why.
Package is compatible with all Peerbox releases to this day, you can install it with:

sudo pacman -Sy ppcoind-blockchain

However, please note:

  1. If you are already synced no need to do this, right?
  2. If this is your fresh Peerbox installation, stop ppcoind right away when you boot.
  3. Before installing you must stop the ppcoind daemon and remove everything from your /var/lib/ppcoind directory
sudo rm -rf /var/lib/ppcoind/*
  1. After installation you must manually edit /etc/conf.d/ppcoind.conf; this is to tell ppcoind to load this blockchain.
    Use your favorite text editor (nano or vi) with sudo to edit this file.

Find line starting with “ARGS=”, comment it out:
[size=8pt](commenting out means putting # in front of the line)[/size]

#ARGS="-checkblocks=50000 -upnp"

and add one bellow it:

ARGS="-loadblock=blk0001.dat"

After this is finished, you will just invert this. Comment out the -loadblock line and uncomment one above.

[center]############################[/center]

I’m sorry this seems complicated, but it is only way to do it right now.
When configuration interface is complete, this will be just a menu option.

Blockchain syncing is much faster this way, well naturally. But not instant.
Compared to usual 48h to sync, now it takes about 7-8h.

If you wonder why syncing is not instant, read this.

To understand it we must understand what are those files in /var/lib/ppcoind.

blk0001.dat is raw blockchain, concatenated stream of raw data.
This is what is shared among nodes.
If extracted it using this method: http://yacointalk.grokonet.com/t/how-to-create-a-clean-block-chain-file-blk0001-dat/82
(it is good article, so I will not repeat what has already been told)

blkindex.dat is a clients representation of the raw data in Berkeley database format.
So, local client (ppcoind) reads from blk0001.dat and saves it in more “understandable” format in blkindex.dat.
This is why cpu usage is high when new node is syncing.

This file can not be shared, I have tried. Ppcoind will not start if this file is installed with raw blockchain.

So syncing is not instant since ppcoind must digest the raw blockchain (blk0001.dat) and take a dump in blkindex.dat.

I have copied blk0001.dat blkindex.dat addr.dat wallet.dat ppcoin.conf and database/* from my windows 7 laptop to a new peerbox. Once I fixed problems with permission and owner of the files, and there isn’t anything strainge in db.log and debog.log I was able get it to sync quickly ( within an hour? ).
Do you mean it is not going to work to put all these files, with an empty wallet.dat, in a peerbox distro?

[quote=“mhps, post:3, topic:2853”]I have copied blk0001.dat blkindex.dat addr.dat wallet.dat ppcoin.conf and database/* from my windows 7 laptop to a new peerbox. Once I fixed problems with permission and owner of the files, and there isn’t anything strainge in db.log and debog.log I was able get it to sync quickly ( within an hour? ).
Do you mean it is not going to work to put all these files, with an empty wallet.dat, in a peerbox distro?[/quote]

blkindex.dat is obviously client specific, thus I would wait to test this more. Or get some input from someone who knows this in detail.
I do not want to leak something private or mess up the node in some way.

About copying it all from existing installation; yes that is how I do it too.
I will make this automated in the future, but for now I’ll treat this as blank new Peerbox installation.

p.s.

but you are right, I have forgot to include “database/…” in this package. That could be why ppcoind is confused when started.

[quote=“peerchemist, post:4, topic:2853”][quote=“mhps, post:3, topic:2853”]I have copied blk0001.dat blkindex.dat addr.dat wallet.dat ppcoin.conf and database/* from my windows 7 laptop to a new peerbox. Once I fixed problems with permission and owner of the files, and there isn’t anything strainge in db.log and debog.log I was able get it to sync quickly ( within an hour? ).
Do you mean it is not going to work to put all these files, with an empty wallet.dat, in a peerbox distro?[/quote]

blkindex.dat is obviously client specific, thus I would wait to test this more. Or get some input from someone who knows this in detail.
I do not want to leak something private or mess up the node in some way.[/quote]

I didn’t write down the details. I think new blkindex.dat and wallet.dat will be generated if they don’t exist in the directory. Sometimes addr.dat will need to be regenerated if peerbox is moved from one network environment to another. There is clue in the log files. So it seems only the blk0001.dat, an empty wallet.dat, database/log.* are needed.

I will make this automated in the future, but for now I'll treat this as blank new Peerbox installation.

That is the safe thing to do.

btw I change the 50000 to 5000 in “#ARGS=”-checkblocks=50000 -upnp" so the start up of daemon is faster.

Yes, this is expected behaviour and this what I’ve described this package uses.

So it seems only the blk0001.dat, an empty wallet.dat, database/log.* are needed.

Not quite.
If there is only blk0001.dat, everything else will be generated automagically in 8h long process (to fill up local database).

If I want to make it ultra fast, by distributing already filled up database I would need to include blkindex.dat and database/*.

btw I change the 50000 to 5000 in "#ARGS="-checkblocks=50000 -upnp" so the start up of daemon is faster.

I have chosen 50k randomly, and enough to make sure everything is ok.
5k should be enough too, since ppcoin blockchain is slow.

[quote=“peerchemist, post:7, topic:2853”]

So it seems only the blk0001.dat, an empty wallet.dat, database/log.* are needed.

Not quite.
If there is only blk0001.dat, everything else will be generated automagically in 8h long process (to fill up local database).[/quote]

Don’t remember it takes that long. I might mix it up with -rescan runs.

Might I suggest a wrapper program for ppcoind that incorporates a torrent bootstrap of the blockchain?

That way you can have peerboxd (the wrapper) manage the ppcoind version it uses (by settings in its ppcoin.conf file, and setting the conf file path as a flag) and manage the blockchain.

Hell, you could just have peerboxd be the standard way of interfacing with ppcoind on a peerbox machine.

We do not have means to make boostrap.dat, at least not in bitcoin way since we lack tools needed for the job.
Bitcoin guys use python program which acts as dummy client and it is only good for copying blockchain from another node and striping junk out of it.

I did this, but poor man’s way as described bellow.

That way you can have peerboxd (the wrapper) manage the ppcoind version it uses (by settings in its ppcoin.conf file, and setting the conf file path as a flag) and manage the blockchain.

Hell, you could just have peerboxd be the standard way of interfacing with ppcoind on a peerbox machine.

I’m not so sure what you propose.
I do not see need for wrapper, as everything is already separated (conf files, directories…)