Skip to content
Permalink
Browse files

mark rpcuser / rpcpassword / maxconnections optional; increase open f…

…iles; add bsdmainutils build dependency
  • Loading branch information...
Eagle[TM]
Eagle[TM] committed Jan 7, 2017
1 parent 686275e commit 2f019ece2e1541eb60e652c7d3551c0dcf30c45e
Showing with 16 additions and 13 deletions.
  1. +8 −5 HOWTO.md
  2. +4 −4 configure
  3. +1 −1 electrum-server
  4. +3 −3 electrum.conf.sample
@@ -96,7 +96,7 @@ to your `.bashrc`, `.profile`, or `.bash_profile`, then logout and relogin:
We currently recommend bitcoin core 0.13.2 stable. If your package manager does not supply
a recent bitcoind or you prefer to compile it yourself, here are some pointers for Ubuntu:

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

daemon=1
txindex=1
maxconnections=8

rpcuser / rpcpassword options are only needed for non-localhost connections.
you can consider setting maxconnections if you want to reduce bitcoind bandwidth
(as stated above)

If you have an existing installation of bitcoind and have not previously
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

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

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

echo "bitcoin hard nofile 65536" >> /etc/security/limits.conf
echo "bitcoin soft nofile 65536" >> /etc/security/limits.conf
echo "bitcoin hard nofile 131072" >> /etc/security/limits.conf
echo "bitcoin soft nofile 131072" >> /etc/security/limits.conf

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:

@@ -47,8 +47,8 @@ fi
if [ ! id -u $user >/dev/null 2>&1 ]; then
echo "adding user $user"
useradd $user
echo "$user hard nofile 65536" >> /etc/security/limits.conf
echo "$user soft nofile 65536" >> /etc/security/limits.conf
echo "$user hard nofile 131072" >> /etc/security/limits.conf
echo "$user soft nofile 131072" >> /etc/security/limits.conf
fi


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

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

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

@@ -57,7 +57,7 @@ case "$1" in
fi

echo "Starting server as daemon"
cmd="ulimit -n 65536 ; nohup run_electrum_server.py > /dev/null 2>>$logfile &"
cmd="ulimit -n 131072 ; nohup run_electrum_server.py > /dev/null 2>>$logfile &"
if [ `id -u` = 0 ] ; then
su $user -c "$cmd"
else
@@ -35,6 +35,6 @@ pruning_limit = 100
[bitcoind]
bitcoind_host = localhost
bitcoind_port = 8332
# user and password from bitcoin.conf
bitcoind_user =
bitcoind_password =
# user and password from bitcoin.conf (not needed for localhost)
#bitcoind_user =
#bitcoind_password =

0 comments on commit 2f019ec

Please sign in to comment.
You can’t perform that action at this time.