Fix reorg issues
[electrum-server.git] / README.leveldb
1 How to run a pruning node with leveldb
2
3 Pruning nodes use a lightweight database to store address histories.
4 Only unspent coins are kept in that database; spent outputs are
5 pruned.
6
7 As of November 2013 all public servers operate this way.
8 Please see HOWTO.md for more detailled information. The following is a 
9 short outline:
10 __________________________________________________________
11 1. Run novacoind.
12
13 Install version 0.4.4.6u5 or higher. Previous versions won't provide sufficient getblock/getblockbynumber functionality.
14
15 __________________________________________________________
16
17 2. Install python-leveldb: 
18
19 Starting at Ubuntu 12.10 you can use apt to install leveldb. If you 
20 rather stay on 12.04 LTS you can use the backport and add 
21 "deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe"
22 to your sources file. Install the package with: 
23
24 sudo apt-get install python-leveldb
25
26 alternatively build yourself, see
27 http://code.google.com/p/py-leveldb/ 
28 and
29 http://peter-hoffmann.com/2011/installation-leveldb-ubuntu-python.html
30 make sure you have libtool, automake and pkg-config
31
32 __________________________________________________________
33
34 3. edit /etc/electrum.conf : 
35
36 [server]
37 backend = leveldb
38
39 [leveldb]
40 path = /path/to/your/database
41 pruning_limit = 10
42
43 ______________________________________________________________
44
45 4. catch up with the blockchain.
46
47 In order to speed up the initial catch_up phase, it is recommended to
48 locate your database in shared memory:
49
50  path = /run/shm/electrum_db
51
52 Once your server has finished catching up, copy your database to disk
53 and update the path in /etc/electrum.conf
54
55 During the catch_up phase, you can interrupt the server with Ctrl-C;
56 it will safely write the current status in the database and exit.
57
58 _________________________________
59
60 5. enjoy!
61
62 Once the server is synchronized, it will listen to ports, and the
63 normal way to stop it is to use the 'stop' script. This script will
64 wait until the database is closed.
65
66 Other commands are available: 
67
68 ./server info   : view connections
69 ./server load   : view the size of the queue
70
71
72 ______________________
73 Troubleshooting:
74
75 * if your server or novacoind is killed because is uses too much
76 memory, configure novacoind to limit the number of connections
77
78 * if you see "Too many open files" errors, you may need to increase
79 your user's File Descriptors limit. For this, see
80 http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
81