Skip to content

Commit 2f019ec

Browse files
author
Eagle[TM]
committed
mark rpcuser / rpcpassword / maxconnections optional; increase open files; add bsdmainutils build dependency
1 parent 686275e commit 2f019ec

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

HOWTO.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ to your `.bashrc`, `.profile`, or `.bash_profile`, then logout and relogin:
9696
We currently recommend bitcoin core 0.13.2 stable. If your package manager does not supply
9797
a recent bitcoind or you prefer to compile it yourself, here are some pointers for Ubuntu:
9898

99-
$ sudo apt-get install make g++ python-leveldb libboost-all-dev libssl-dev libdb++-dev pkg-config libevent-dev
99+
$ sudo apt-get install make bsdmainutils g++ python-leveldb libboost-all-dev libssl-dev libdb++-dev pkg-config libevent-dev
100100
$ sudo su - bitcoin
101101
$ cd ~/src && wget https://bitcoin.org/bin/bitcoin-core-0.13.2/bitcoin-0.13.2.tar.gz
102102
$ sha256sum bitcoin-0.13.2.tar.gz | grep 621201189c0409cb17a5073278872dcdcfff1ea147ead6958b55e94416b896d7
@@ -120,7 +120,10 @@ Write this in `bitcoin.conf`:
120120

121121
daemon=1
122122
txindex=1
123-
maxconnections=8
123+
124+
rpcuser / rpcpassword options are only needed for non-localhost connections.
125+
you can consider setting maxconnections if you want to reduce bitcoind bandwidth
126+
(as stated above)
124127

125128
If you have an existing installation of bitcoind and have not previously
126129
set txindex=1 you need to reindex the blockchain by running
@@ -283,14 +286,14 @@ If you intend to run the server publicly have a look at README-IRC.md
283286

284287
Electrum server currently needs quite a few file handles to use leveldb. It also requires
285288
file handles for each connection made to the server. It's good practice to increase the
286-
open files limit to 64k.
289+
open files limit to 128k.
287290

288291
The "configure" script will take care of this and ask you to create a user for running electrum-server.
289292
If you're using the user `bitcoin` to run electrum and have added it as shown in this document, run
290293
the following code to add the limits to your /etc/security/limits.conf:
291294

292-
echo "bitcoin hard nofile 65536" >> /etc/security/limits.conf
293-
echo "bitcoin soft nofile 65536" >> /etc/security/limits.conf
295+
echo "bitcoin hard nofile 131072" >> /etc/security/limits.conf
296+
echo "bitcoin soft nofile 131072" >> /etc/security/limits.conf
294297

295298
If you are on Debian > 8.0 Jessie or another distribution based on it, you also need to add these lines in /etc/pam.d/common-session and /etc/pam.d/common-session-noninteractive otherwise the limits in /etc/security/limits.conf will not work:
296299

configure

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ fi
4747
if [ ! id -u $user >/dev/null 2>&1 ]; then
4848
echo "adding user $user"
4949
useradd $user
50-
echo "$user hard nofile 65536" >> /etc/security/limits.conf
51-
echo "$user soft nofile 65536" >> /etc/security/limits.conf
50+
echo "$user hard nofile 131072" >> /etc/security/limits.conf
51+
echo "$user soft nofile 131072" >> /etc/security/limits.conf
5252
fi
5353

5454

@@ -110,13 +110,13 @@ chown $user:$user $logfile
110110

111111
bitcoind_user=$(read_config "bitcoind_user")
112112
if ! [ "$bitcoind_user" ]; then
113-
read -p "rpcuser (from your bitcoin.conf file): " -r
113+
read -p "rpcuser (from your bitcoin.conf file, leave empty for localhost): " -r
114114
write_config "bitcoind_user" $REPLY
115115
fi
116116

117117
bitcoind_password=$(read_config "bitcoind_password")
118118
if ! [ "$bitcoind_password" ]; then
119-
read -p "rpcpassword (from your bitcoin.conf file): " -r
119+
read -p "rpcpassword (from your bitcoin.conf file, leave emtpy for localhost): " -r
120120
write_config "bitcoind_password" $REPLY
121121
fi
122122

electrum-server

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ case "$1" in
5757
fi
5858

5959
echo "Starting server as daemon"
60-
cmd="ulimit -n 65536 ; nohup run_electrum_server.py > /dev/null 2>>$logfile &"
60+
cmd="ulimit -n 131072 ; nohup run_electrum_server.py > /dev/null 2>>$logfile &"
6161
if [ `id -u` = 0 ] ; then
6262
su $user -c "$cmd"
6363
else

electrum.conf.sample

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ pruning_limit = 100
3535
[bitcoind]
3636
bitcoind_host = localhost
3737
bitcoind_port = 8332
38-
# user and password from bitcoin.conf
39-
bitcoind_user =
40-
bitcoind_password =
38+
# user and password from bitcoin.conf (not needed for localhost)
39+
#bitcoind_user =
40+
#bitcoind_password =

0 commit comments

Comments
 (0)