README.leveldb: no need for txindex
[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
8 __________________________________________________________
9 1. patch and compile bitcoind.
10
11 Install version 0.8 or equivalent.
12 Patch it with the patch distributed with Electrum.
13
14 Note: Even though Electrum's database uses pruning, you cannot use it
15 with a ultra-pruning bitcoind (forthcoming in 0.9 or later).
16 A full bitcoin node is required in order to know for each address 
17 if it has been used. Pruning occurs only at the level of the Electrum database.
18 txindex=1 however is *not* needed!
19
20 __________________________________________________________
21
22 2. Install python-leveldb: 
23
24 Starting at Ubuntu 12.10 you can use apt to install leveldb. If you 
25 rather stay on 12.04 LTS you can use the backport and add 
26 "deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe"
27 to your sources file. Install the package with: 
28
29 sudo apt-get install python-leveldb
30
31 alternatively build yourself, see
32 http://code.google.com/p/py-leveldb/ 
33 and
34 http://peter-hoffmann.com/2011/installation-leveldb-ubuntu-python.html
35 make sure you have libtool, automake and pkg-config
36
37 __________________________________________________________
38
39 3. edit /etc/electrum.conf : 
40
41 [server]
42 backend = leveldb
43
44 [leveldb]
45 path = /path/to/your/database
46 pruning_limit = 10
47
48 ______________________________________________________________
49
50 4. catch up with the blockchain.
51
52 In order to speed up the initial catch_up phase, it is recommended to
53 locate your database in shared memory:
54
55  path = /run/shm/electrum_db
56
57 Once your server has finished catching up, copy your database to disk
58 and update the path in /etc/electrum.conf
59
60 During the catch_up phase, you can interrupt the server with Ctrl-C;
61 it will safely write the current status in the database and exit.
62
63 _________________________________
64
65 5. enjoy!
66
67 Once the server is synchronized, it will listen to ports, and the
68 normal way to stop it is to type: ./server.py stop
69
70 Other commands are available: 
71
72 ./server info   : view connections
73 ./server load   : view the size of the queue
74
75
76 ______________________
77 Troubleshooting:
78
79 * if your server or bitcoind is killed because is uses too much
80 memory, configure bitcoind to limit the number of connections
81
82 * if you see "Too many open files" errors, you may need to increase
83 your user's File Descriptors limit. For this, see
84 http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
85