a539b76a8bdcc194b9329ba21d16f75b405e3b7a
[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.6u4 or higher.
14 __________________________________________________________
15
16 2. Install python-leveldb: 
17
18 Starting at Ubuntu 12.10 you can use apt to install leveldb. If you 
19 rather stay on 12.04 LTS you can use the backport and add 
20 "deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe"
21 to your sources file. Install the package with: 
22
23 sudo apt-get install python-leveldb
24
25 alternatively build yourself, see
26 http://code.google.com/p/py-leveldb/ 
27 and
28 http://peter-hoffmann.com/2011/installation-leveldb-ubuntu-python.html
29 make sure you have libtool, automake and pkg-config
30
31 __________________________________________________________
32
33 3. edit /etc/electrum.conf : 
34
35 [server]
36 backend = leveldb
37
38 [leveldb]
39 path = /path/to/your/database
40 pruning_limit = 10
41
42 ______________________________________________________________
43
44 4. catch up with the blockchain.
45
46 In order to speed up the initial catch_up phase, it is recommended to
47 locate your database in shared memory:
48
49  path = /run/shm/electrum_db
50
51 Once your server has finished catching up, copy your database to disk
52 and update the path in /etc/electrum.conf
53
54 During the catch_up phase, you can interrupt the server with Ctrl-C;
55 it will safely write the current status in the database and exit.
56
57 _________________________________
58
59 5. enjoy!
60
61 Once the server is synchronized, it will listen to ports, and the
62 normal way to stop it is to use the 'stop' script. This script will
63 wait until the database is closed.
64
65 Other commands are available: 
66
67 ./server info   : view connections
68 ./server load   : view the size of the queue
69
70
71 ______________________
72 Troubleshooting:
73
74 * if your server or novacoind is killed because is uses too much
75 memory, configure novacoind to limit the number of connections
76
77 * if you see "Too many open files" errors, you may need to increase
78 your user's File Descriptors limit. For this, see
79 http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
80