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